Skip to content

Commit

Permalink
ci: Use semaphore to promote to production
Browse files Browse the repository at this point in the history
#122: Deploy to separate GCP project
  • Loading branch information
MichaelAkvo committed Apr 14, 2022
1 parent 9a522ac commit 805c8d4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 28 deletions.
27 changes: 27 additions & 0 deletions .semaphore/prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
version: v1.0
name: ISCO promotion
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
global_job_config:
secrets:
- name: isco
prologue:
commands:
- checkout
- export CI_COMMIT="${SEMAPHORE_GIT_SHA:0:7}"
- export CI_BRANCH="${SEMAPHORE_GIT_BRANCH}"
- export CI_TAG="${SEMAPHORE_GIT_TAG_NAME}"
- export CI_PULL_REQUEST="${SEMAPHORE_GIT_REF_TYPE/pull-request/true}"
- export CI_COMMIT_RANGE="${SEMAPHORE_GIT_COMMIT_RANGE}"
- export CLOUDSDK_CORE_DISABLE_PROMPTS=1
- export NO_PUSH=1
blocks:
- name: 'Promotion'
task:
jobs:
- name: Promote to production
commands:
- ./ci/deploy.sh
10 changes: 3 additions & 7 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ blocks:
commands:
- ./ci/build.sh
- ./ci/deploy.sh

promotions:
- name: "Promote to production"
run:
when: "tag =~ '.*'"
task:
jobs:
- name: Promote to production
commands:
- ./ci/deploy.sh
pipeline_file: prod.yml
2 changes: 1 addition & 1 deletion ci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ set -x # Renable it

auth

if [[ -z "${CI_TAG:=}" ]]; then
if [[ -z "${CI_TAG:=}" && -z "${NO_PUSH}" ]] ; then
push_image backend
push_image frontend
fi
Expand Down
20 changes: 0 additions & 20 deletions ci/promote-test-to-prod.sh

This file was deleted.

0 comments on commit 805c8d4

Please sign in to comment.