Skip to content

Instantly share code, notes, and snippets.

@aviadlevy
Last active August 12, 2019 07:39
Show Gist options
  • Save aviadlevy/8d1121e0dc0ea7a23a797239fa68dff8 to your computer and use it in GitHub Desktop.
Save aviadlevy/8d1121e0dc0ea7a23a797239fa68dff8 to your computer and use it in GitHub Desktop.
.gitlab-ci-old.yml
image: docker:latest
services:
- docker:dind
stages:
- build
- integration-test
- push
- dev-deploy
- prod-deploy
# Cache downloaded dependencies and plugins between builds.
cache:
paths:
- .m2/repository
key: "$CI_JOB_NAME"
variables:
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
CONTAINER_RELEASE_IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest
DEV_KUBECTL_CONFIG: $k8s_deploy_config_kube1
EU_PROD_KUBECTL_CONFIG: $k8s_deploy_config_eu_west_1_kube2
US_PROD_KUBECTL_CONFIG: $k8s_deploy_config_us_east_1_kube1
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
maven-build:
image: snirnx/docker-maven:3.5.4
stage: build
script:
- "sh ci_scripts/run_build.sh dev jar"
except:
- master
maven-build-master:
image: snirnx/docker-maven:3.5.4
stage: build
script:
- "sh ci_scripts/run_build.sh master jar"
only:
- master
integration:
image: snirnx/docker-maven:3.5.4
stage: integration-test
script:
- "bash ci_files/integration_test.sh $CI_COMMIT_SHA"
artifacts:
name: "CI_COMMIT_SHA-results"
when: always
expire_in: 4 days
paths:
- reputation-service-integration-tests/target/site/
- reputation-service-integration-tests/log/
tags:
- reputation-integration-tests
development-deploy:
stage: dev-deploy
image: snirnx/kubectl:v1.8.6
script:
- "sh ci_scripts/deploy.sh dev eu"
only:
- master
production-deploy:
stage: prod-deploy
image: snirnx/kubectl:v1.8.6
script:
- "sh ci_scripts/deploy.sh prod us"
- "sh ci_scripts/deploy.sh prod eu"
only:
- master
when: manual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment