Skip to content

Commit

Permalink
adjust continous delivery scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
icedevml committed Jan 10, 2019
1 parent 9eb240f commit f02972e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: naskpl/docker-compose
image: certpl/docker-ci-base:latest

variables:
DOCKER_DRIVER: overlay2
Expand All @@ -8,6 +8,7 @@ services:

stages:
- build
- deploy

before_script:
- echo "Start job $CI_BUILD_NAME" at `date +%Y-%m-%d-%H-%M-%S`
Expand All @@ -19,6 +20,25 @@ build_ursadb:
script:
- docker build -t "$DOCKER_REGISTRY/ursadb:$CI_PIPELINE_ID" .
- docker tag "$DOCKER_REGISTRY/ursadb:$CI_PIPELINE_ID" "$DOCKER_REGISTRY/ursadb:latest"
- docker tag "$DOCKER_REGISTRY/ursadb:$CI_PIPELINE_ID" "$DOCKER_REGISTRY/ursadb:build-$CI_COMMIT_SHA"

- docker push "$DOCKER_REGISTRY/ursadb:$CI_PIPELINE_ID"
- docker push "$DOCKER_REGISTRY/ursadb:build-$CI_COMMIT_SHA"
- docker push "$DOCKER_REGISTRY/ursadb:latest"

deploy_ursadb:
stage: deploy
when: manual
only:
- master
environment:
name: prod
script:
- eval $(ssh-agent -s)
- echo "$GIT_DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$VCS_SSH_KEYS" >> ~/.ssh/known_hosts
- git clone "$VCS_DEPLOY_REPO_URL"
- cd "$VCS_DEPLOY_REPO_NAME"
- sh deploy_ursadb.sh

0 comments on commit f02972e

Please sign in to comment.