Skip to content

Commit

Permalink
Merge pull request #348 from department-of-veterans-affairs/circleci-…
Browse files Browse the repository at this point in the history
…deploy

Circleci deploy
  • Loading branch information
bkjohnson authored Dec 2, 2020
2 parents e6b7f40 + e3c914b commit 04c3483
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 27 deletions.
50 changes: 44 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,50 @@
version: 2.1
# Use a package of configuration called an orb.
orbs:
# Declare a dependency on the welcome-orb
welcome: circleci/[email protected]
aws-cli: circleci/[email protected]

jobs:
build-deploy:
docker:
- image: cimg/ruby:2.7.2-node
environment:
AWS_DEFAULT_REGION: us-gov-west-1
parameters:
bucket:
type: string

steps:
- checkout
- aws-cli/setup
- run: yarn install
# If this works, think about adding it to the Gemfile
- run: gem install bundler:1.16.6
- run: bundle install
- run: yarn build
- run: bundle exec jekyll build
- run: aws s3 sync _site s3://<< parameters.bucket >> --acl public-read

# Orchestrate or schedule a set of jobs
workflows:
# Name the workflow "welcome"
welcome:
# Run the welcome/run job in its own container
deploy-dev:
jobs:
- welcome/run
- build-deploy:
# Set the bucket parameter to be the dev bucket
bucket: "dev-design.va.gov"
filters:
branches:
only: master
context:
# The Platform context has the environment variables for setting up the aws cli
- Platform
deploy-staging:
jobs:
- build-deploy:
# Set the bucket parameter to be the staging bucket
bucket: "staging-design.va.gov"
filters:
branches:
only: master
context:
# The Platform context has the environment variables for setting up the aws cli
- Platform
22 changes: 1 addition & 21 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,5 @@ pipeline {
}
}

stage('Deploy dev & staging') {
when {
expression { env.BRANCH_NAME == 'master' }
}
steps {
script {
commit = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
}

build job: 'deploys/vets-design-system-documentation-vagov-dev', parameters: [
booleanParam(name: 'notify_slack', value: true),
stringParam(name: 'ref', value: commit)
], wait: false

build job: 'deploys/vets-design-system-documentation-vagov-staging', parameters: [
booleanParam(name: 'notify_slack', value: true),
stringParam(name: 'ref', value: commit)
], wait: false
}
}
}
}
}

0 comments on commit 04c3483

Please sign in to comment.