forked from draxis-environmental/hackair-web
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
66 lines (57 loc) · 2.04 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
image: node:7.10-wheezy
cache:
paths:
- node_modules/
- www/lib/
before_script:
# Install ssh-agent if not already installed, it is required by Docker.
# (change apt-get to yum if you use a CentOS-based image)
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- ssh-add <(echo "$SSH_PRIVATE_KEY")
# For Docker builds disable host key checking. Be aware that by adding that
# you are suspectible to man-in-the-middle attacks.
# WARNING: Use this only with the Docker executor, if you use it with shell
# you will overwrite your user's SSH config.
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
# In order to properly check the server's host key, assuming you created the
# SSH_SERVER_HOSTKEYS variable previously, uncomment the following two lines
# instead.
# - mkdir -p ~/.ssh
# - '[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts'
# Install node dependencies
- echo "Installing node dependencies..."
- npm install
stages:
- build
- deploy
build_app:
stage: build
only:
- staging
script:
- echo "Building HackAIR..."
- npm run deploy
- echo "Deploying to staging server..."
- chmod -R 755 out/Release/
- rsync -azp --delete out/Release/ draxis@192.168.210.35:/home/draxis/hackair-docker-stack/hackair-web/dist
environment:
name: staging
url: http://hackair.draxis.gr
build_app_prod:
stage: build
only:
- production
script:
- echo "Building HackAIR..."
- npm run deploy
- echo "Deploying to production server..."
- chmod -R 755 out/Release/
- rsync -azp -e "ssh -p 2310" --delete out/Release/ draxis@production.hackair.eu:/home/draxis/containers/hackair-web/dist
environment:
name: production
url: https://platform.hackair.eu