forked from AsherGlick/ResourceCalculator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
47 lines (39 loc) · 1.26 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
variables:
DEPLOY_FOLDER: "resourcecalculator.com"
stages:
- build
# - test
- deploy
build-site:
image: asherglick/webbuild:20190601
stage: build
script:
- pip3 install -r requirements.txt
- npm install
# Build System Website
- python3 build.py
artifacts:
paths:
- output
# Expire after 1 hour
expire_in: 1 hr
deploy-dreamhost-prod:
image: asherglick/webdeploy:20170802
stage: deploy
script:
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add the SSH key stored in the environment to the agent store
- ssh-add <(echo "$PROD_SSH_PRIVATE_KEY")
# For Docker builds disable host key checking. Be aware that by adding that
# you are susceptible 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'
- ssh $PROD_USER@$PROD_HOST ls
# Sync over the files
- rsync --recursive --archive --verbose -e ssh --delete output/ $PROD_USER@$PROD_HOST:/home/$PROD_USER/$DEPLOY_FOLDER/
- ssh $PROD_USER@$PROD_HOST "cd $DEPLOY_FOLDER; tree -a"
only:
- master