Skip to content

Instantly share code, notes, and snippets.

@slamdev
Created September 3, 2017 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slamdev/7514762b317f2c5e0eb9198154fd2c6c to your computer and use it in GitHub Desktop.
Save slamdev/7514762b317f2c5e0eb9198154fd2c6c to your computer and use it in GitHub Desktop.
image: java:8-jdk-alpine
stages:
- validate
- build
- deploy
cache:
paths:
- .gradle
- $HOME/.gradle
- $HOME/.m2
validate:
stage: validate
script: ./gradlew check
build:
stage: build
script: ./gradlew assemble
deploy-review:
stage: deploy
script: ./gradlew deploy -Penv=review
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://$CI_ENVIRONMENT_SLUG.example.com/
except:
- master
deploy-dev:
stage: deploy
script: ./gradlew deploy -Penv=dev
environment:
name: dev
url: https://dev.example.com
only:
- master
deploy-prod:
stage: deploy
script:
- ./gradlew deploy -Penv=prod
environment:
name: prod
url: https://prod.example.com
only:
- master
when: manual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment