-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
53 lines (47 loc) · 1.56 KB
/
.gitlab-ci.yml
File metadata and controls
53 lines (47 loc) · 1.56 KB
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
lektor:build:
stage: build
image: python:latest
script:
- pip install lektor
- lektor build -f jsminify -f scsscompile --output-path build
- cd build
- tar -czvf build.tar.gz ./*
- mv build.tar.gz ../build.tar.gz
artifacts:
paths:
- build.tar.gz
deploy-to-stage:
stage: deploy
image: debian:stable
variables:
GIT_STRATEGY: none
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SERVER_SSH_PRIV_KEY")
script:
- scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p build.tar.gz "$USERNAME@$DOMAIN:tmp"
- ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $USERNAME@$DOMAIN "mkdir -p webseite/staging-$CI_COMMIT_REF_NAME && tar -xzvf /tmp/build.tar.gz -C webseite/staging-$CI_COMMIT_REF_NAME"
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://toolbox-bodensee.de/staging-$CI_COMMIT_REF_NAME
dependencies:
- lektor:build
except:
- master
deploy-to-prod:
stage: deploy
image: debian:stable
variables:
GIT_STRATEGY: none
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SERVER_SSH_PRIV_KEY")
script:
- scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p build.tar.gz "$USERNAME@$DOMAIN:tmp"
- ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $USERNAME@$DOMAIN "tar -xzvf /tmp/build.tar.gz -C webseite"
dependencies:
- lektor:build
only:
- master