-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
30 lines (28 loc) · 974 Bytes
/
.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
stages:
- build
- deploy
push_to_github:
stage: build
image: docker-registry.muensmedia.de/muensmedia-docker/alpine-tools
variables:
before_script:
- eval $(ssh-agent -s)
- echo "$GIT_SSH_PRIVATE_KEY" | ssh-add -
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- git config --global user.email "[email protected]"
- git config --global user.name "Gitlab CI"
script:
- git reset --hard
- git clean -fd
- git checkout $CI_COMMIT_REF_NAME
- git pull origin $CI_COMMIT_REF_NAME
- git remote set-url origin [email protected]:muensmedia/docker-gsales.git
- git push origin master
trigger_deployment:
stage: deploy
image: docker-registry.muensmedia.de/muensmedia-docker/alpine-tools
script:
# wait until new docker image is build
- sleep 15m
- "curl -X POST -F token=${TRIGGER_TOKEN} -F ref=muensmedia https://git.muensmedia.de/api/v4/projects/150/trigger/pipeline"