Skip to content

Commit

Permalink
Merge branch 'master' into utilization-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaxter-18f authored Apr 3, 2018
2 parents 3377b88 + 4631516 commit 6ea4207
Show file tree
Hide file tree
Showing 47 changed files with 1,646 additions and 676 deletions.
84 changes: 61 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,36 @@
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
cf-docker-image: &CF_DOCKER_IMAGE
docker:
- image: 18fgsa/cloud-foundry-cli
environment:
- TZ=America/New_York
- CF_API: https://api.fr.cloud.gov
working-directory: &WORKING_DIRECTORY
working_directory: ~/repo


version: 2
jobs:
build:
docker:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
- image: circleci/python:3.6.4-jessie-node-browsers
- image: circleci/python:3.6.5-jessie-node-browsers
environment:
- TZ=America/New_York
- PIPENV_VENV_IN_PROJECT=true

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
- image: circleci/postgres:9.6.6
- image: circleci/postgres:9.6.8
environment:
- POSTGRES_USER=circleci
- POSTGRES_DB=tock-test

working_directory: ~/repo
<<: *WORKING_DIRECTORY

steps:
- checkout
Expand Down Expand Up @@ -70,40 +80,59 @@ jobs:
- ./*

deploy_to_staging:
docker:
- image: 18fgsa/cloud-foundry-cli
environment:
- TZ=America/New_York
- CF_API: https://api.fr.cloud.gov
<<: *CF_DOCKER_IMAGE

<<: *WORKING_DIRECTORY

working_directory: ~/repo
steps:
- attach_workspace:
at: .
- run:
name: Login to cloud.gov Staging
command: cf login -a ${CF_API} -u ${CF_DEPLOYER_USERNAME_STAGING} -p ${CF_DEPLOYER_PASSWORD_STAGING}
- run:
name: Save version to file system
command: echo ${CIRCLE_SHA1} > tock/VERSION
- run:
name: deploy Tock Staging to cloud.gov
command: |
cf login -a ${CF_API} -u ${CF_DEPLOYER_USERNAME_STAGING} -p ${CF_DEPLOYER_PASSWORD_STAGING}
echo ${CIRCLE_SHA1} > tock/VERSION
cf_deploy.sh tock gsa-18f-tock staging manifest-staging.yml
command: cf_deploy.sh tock gsa-18f-tock staging manifest-staging.yml

deploy_to_production:
docker:
- image: 18fgsa/cloud-foundry-cli
environment:
- TZ=America/New_York
- CF_API: https://api.fr.cloud.gov
working_directory: ~/repo
<<: *CF_DOCKER_IMAGE

<<: *WORKING_DIRECTORY

steps:
- attach_workspace:
at: .
- run:
name: deploy Tock Production to cloud.gov
name: Login to cloud.gov Production
command: cf login -a ${CF_API} -u ${CF_DEPLOYER_USERNAME_PRODUCTION} -p ${CF_DEPLOYER_PASSWORD_PRODUCTION}
- run:
name: Save version to file system
command: echo ${CIRCLE_TAG} > tock/VERSION
- run:
name: Deploy Tock Production to cloud.gov
command: cf_deploy.sh tock gsa-18f-tock prod manifest-production.yml

recycle_production:
<<: *CF_DOCKER_IMAGE

<<: *WORKING_DIRECTORY

steps:
- run:
name: Login to cloud.gov Production
command: cf login -a ${CF_API} -u ${CF_DEPLOYER_USERNAME_PRODUCTION} -p ${CF_DEPLOYER_PASSWORD_PRODUCTION}
- run:
name: Install cf-recycle-plugin 1.0.0 release
command: |
cf login -a ${CF_API} -u ${CF_DEPLOYER_USERNAME_PRODUCTION} -p ${CF_DEPLOYER_PASSWORD_PRODUCTION}
echo ${CIRCLE_TAG} > tock/VERSION
cf_deploy.sh tock gsa-18f-tock prod manifest-production.yml
curl -L -o cf-recycle-plugin https://github.com/rogeruiz/cf-recycle-plugin/releases/download/v1.0.0/cf-recycle-plugin.linux64
chmod +x cf-recycle-plugin
cf install-plugin cf-recycle-plugin -f
- run:
name: Recycle Tock Production instances
command: cf recycle tock

workflows:
version: 2
Expand Down Expand Up @@ -141,3 +170,12 @@ workflows:
only: /v20[1-9][0-9][0-9]+\.[0-9]+/
branches:
ignore: /.*/
recycle-prod:
jobs:
- recycle_production
triggers:
- schedule:
cron: "0 10 * * *" # Roughly 5am ET
filters:
branches:
only: /.*/
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
package-lock.json binary
requirements.txt binary
Pipfile.lock binary
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6.4
FROM python:3.6.5

RUN apt-get update && apt-get install -y postgresql-client

Expand Down
72 changes: 38 additions & 34 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6ea4207

Please sign in to comment.