Skip to content

Instantly share code, notes, and snippets.

@idugalic
Last active October 7, 2017 02:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idugalic/8a1d533a8bfc828ac6203ce1300c0cf2 to your computer and use it in GitHub Desktop.
Save idugalic/8a1d533a8bfc828ac6203ce1300c0cf2 to your computer and use it in GitHub Desktop.
defaults: &defaults
working_directory: /home/circleci/kotlin-spring-boot-reactjs-poc
docker:
- image: circleci/openjdk:8-jdk-browsers
version: 2
jobs:
build:
<<: *defaults
steps:
- checkout
- restore_cache:
key: kotlin-spring-boot-reactjs-poc-{{ checksum "pom.xml" }}
- run: mvn dependency:go-offline
- save_cache:
paths:
- ~/.m2
key: kotlin-spring-boot-reactjs-poc-{{ checksum "pom.xml" }}
- run: mvn package
- store_test_results:
path: target/surefire-reports/
- run: rm -rf target/classes/
- run: rm -rf target/node/
- run: rm -rf target/maven-archiver/
- store_artifacts:
path: target/
- persist_to_workspace:
root: target/
paths:
- .
staging:
<<: *defaults
steps:
- attach_workspace:
at: workspace/
- run: ls -la workspace/
staging-e2e:
<<: *defaults
steps:
- attach_workspace:
at: workspace/
- run: ls -la workspace/
production:
<<: *defaults
steps:
- attach_workspace:
at: workspace/
- run: ls -la workspace/
workflows:
version: 2
continuous-delivery-workflow:
jobs:
- build
- staging:
requires:
- build
filters:
branches:
only: master
- staging-e2e:
requires:
- staging
filters:
branches:
only: master
- approve-production:
type: approval
requires:
- staging-e2e
filters:
branches:
only: master
- production:
requires:
- approve-production
filters:
branches:
only: master
@idugalic
Copy link
Author

idugalic commented Jul 9, 2017

workflow

@naviat
Copy link

naviat commented Oct 7, 2017

Sorry for my question, I have a confuse here. This workflow you run is only master branch. So If I have 2 branches ( dev and prd), I update code to dev branch, run build-dev then create a approval for deploy to production. The build-prd job I run in prd branch. When i run this workflow, after approved, I can not see build-prd job on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment