This repository has been archived by the owner on Dec 18, 2024. It is now read-only.
Merge pull request #45 from GSA/add-development-ssb #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: deploy | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
create-cloudgov-services-management-staging: | |
name: create services (management-staging) | |
environment: management-staging | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: create services | |
uses: cloud-gov/cg-cli-tools@main | |
with: | |
command: ./create-cloudgov-services.sh | |
cf_org: gsa-datagov | |
cf_space: management-staging | |
cf_username: ${{secrets.CF_SERVICE_USER}} | |
cf_password: ${{secrets.CF_SERVICE_AUTH}} | |
deploy-management-staging: | |
name: deploy (management-staging) | |
environment: management-staging | |
runs-on: ubuntu-latest | |
needs: | |
- create-cloudgov-services-management-staging | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: build dependencies | |
run: | | |
chmod -R 777 logstash | |
PWD=`pwd` make logstash-installation | |
- name: deploy-logstash | |
uses: cloud-gov/cg-cli-tools@main | |
with: | |
command: cf push --vars-file vars.management-staging.yml --strategy rolling | |
cf_org: gsa-datagov | |
cf_space: management-staging | |
cf_username: ${{secrets.CF_SERVICE_USER}} | |
cf_password: ${{secrets.CF_SERVICE_AUTH}} | |
- name: smoke test logstash | |
run: | | |
sleep 150 # Logstash is very slow to start up | |
[ "401" = "$(curl -w '%{http_code}' --output /dev/null --silent https://logstash-stage-datagov.app.cloud.gov)" ] | |
create-cloudgov-services-management: | |
name: create services (management) | |
environment: management | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: create services | |
uses: cloud-gov/cg-cli-tools@main | |
with: | |
command: ./create-cloudgov-services.sh | |
cf_org: gsa-datagov | |
cf_space: management | |
cf_username: ${{secrets.CF_SERVICE_USER}} | |
cf_password: ${{secrets.CF_SERVICE_AUTH}} | |
deploy-management: | |
name: deploy (management) | |
environment: management | |
runs-on: ubuntu-latest | |
needs: | |
- create-cloudgov-services-management | |
- deploy-management-staging | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: build dependencies | |
run: | | |
chmod -R 777 logstash | |
PWD=`pwd` make logstash-installation | |
- name: deploy-logstash | |
uses: cloud-gov/cg-cli-tools@main | |
with: | |
command: cf push --vars-file vars.management.yml --strategy rolling | |
cf_org: gsa-datagov | |
cf_space: management | |
cf_username: ${{secrets.CF_SERVICE_USER}} | |
cf_password: ${{secrets.CF_SERVICE_AUTH}} | |
- name: smoke test | |
run: | | |
sleep 150 # Logstash is very slow to start up | |
[ "401" = "$(curl -w '%{http_code}' --output /dev/null --silent https://logstash-stage-datagov.app.cloud.gov)" ] | |
drain-apps-in-staging: | |
name: drain everything in staging space | |
environment: management | |
runs-on: ubuntu-latest | |
needs: | |
- deploy-management | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: drain-staging-space | |
uses: cloud-gov/cg-cli-tools@main | |
with: | |
command: | | |
apt-get install -y jq && | |
curl -L -o drain-plugin https://github.com/cloudfoundry/cf-drain-cli/releases/download/v2.0.0/cf-drain-cli-linux && | |
cf install-plugin -f -r drain-plugin && | |
rm -f drain-plugin && | |
mkdir -p /root/.cf/ && touch /root/.cf/config.json && | |
./create-space-drain.sh management-staging | |
cf_org: gsa-datagov | |
cf_space: staging | |
cf_username: ${{secrets.CF_SERVICE_USER}} | |
cf_password: ${{secrets.CF_SERVICE_AUTH}} | |
drain-apps-in-prod: | |
name: drain everything in prod space | |
environment: management | |
runs-on: ubuntu-latest | |
needs: | |
- deploy-management | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: drain-prod-space | |
uses: cloud-gov/cg-cli-tools@main | |
with: | |
command: | | |
apt-get install -y jq && | |
curl -L -o drain-plugin https://github.com/cloudfoundry/cf-drain-cli/releases/download/v2.0.0/cf-drain-cli-linux && | |
cf install-plugin -f -r drain-plugin && | |
rm -f drain-plugin && | |
mkdir -p /root/.cf/ && touch /root/.cf/config.json && | |
./create-space-drain.sh management | |
cf_org: gsa-datagov | |
cf_space: prod | |
cf_username: ${{secrets.CF_SERVICE_USER}} | |
cf_password: ${{secrets.CF_SERVICE_AUTH}} |