-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
stages: | ||
- build | ||
- deploy | ||
|
||
variables: | ||
GCLOUDSDK_CONTAINER_USE_V1_CLIENT: "false" | ||
GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcloud_key.json | ||
GCP_REGION: us-west1 | ||
CI_SHA1: $CI_COMMIT_SHA | ||
CI_BRANCH: $CI_COMMIT_REF_NAME | ||
CI_BUILD_NUM: $CI_JOB_ID | ||
CI_TAG: $CI_COMMIT_TAG | ||
DOCKER_HOST: tcp://localhost:2375 | ||
DOCKER_DRIVER: overlay2 | ||
|
||
image: quay.io/reactiveops/ci-images:v7-alpine | ||
services: | ||
- docker:dind | ||
|
||
.aliases: | ||
- &initialize-dev | | ||
export GCP_PROJECT=sample-dev-project | ||
export CLUSTER_NAME=sample-dev-cluster | ||
export GCLOUD_KEY=$GCLOUD_KEY_DEV | ||
export ROK8S_CONFIG="deploy/development.config" | ||
prepare-gcloud | ||
|
||
- &initialize-staging | | ||
export GCP_PROJECT=sample-staging-project | ||
export CLUSTER_NAME=sample-staging-cluster | ||
export GCLOUD_KEY=$GCLOUD_KEY_STAGING | ||
export ROK8S_CONFIG="deploy/staging.config" | ||
prepare-gcloud | ||
|
||
- &initialize-prod | | ||
export GCP_PROJECT=sample-staging-project | ||
export CLUSTER_NAME=sample-staging-cluster | ||
export GCLOUD_KEY=$GCLOUD_KEY_PROD | ||
export ROK8S_CONFIG="deploy/production.config" | ||
prepare-gcloud | ||
|
||
build: | ||
stage: build | ||
script: | ||
- *initialize-dev | ||
- docker-build -f $ROK8S_CONFIG | ||
- docker-push -f $ROK8S_CONFIG | ||
|
||
deploy_development: | ||
stage: deploy | ||
environment: | ||
name: development | ||
script: | ||
- *initialize-dev | ||
- helm-deploy -f $ROK8S_CONFIG | ||
only: | ||
- /^dev-.*/ | ||
|
||
deploy_staging: | ||
stage: deploy | ||
environment: | ||
name: staging | ||
script: | ||
- *initialize-staging | ||
- helm-deploy -f $ROK8S_CONFIG | ||
only: | ||
- master | ||
|
||
deploy_production: | ||
stage: deploy | ||
environment: | ||
name: production | ||
script: | ||
- *initialize-prod | ||
- helm-deploy -f $ROK8S_CONFIG | ||
only: | ||
- /^v.*/ | ||
when: manual |