forked from 18F/analytics.usa.gov
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '18F:master' into master
- Loading branch information
Showing
2,129 changed files
with
4,828,914 additions
and
61,463 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.*.sw? | ||
.env | ||
.DS_Store | ||
*.log | ||
./*.json | ||
./*.json~ | ||
./*.csv | ||
.sass-cache | ||
Guardfile | ||
|
||
./*.js | ||
/*.gz | ||
/*.map | ||
/work | ||
/dist | ||
/node_modules | ||
Dockerfile | ||
Dockerfile.production |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
version: 2.1 | ||
|
||
install_npm_packages: &install_npm_packages | ||
run: | ||
name: install npm dependencies | ||
command: | | ||
npm install | ||
sudo npm install -g eslint | ||
sudo npm install -g webpack | ||
sudo npm install -g envsub | ||
sudo npm install -g gulp-cli | ||
|
||
copy_uswds_assets: ©_uswds_assets | ||
run: | ||
name: copy uswds assets | ||
command: npm run copy-assets | ||
|
||
bundle_javascript: &bundle_javascript | ||
run: | ||
name: bundle for production javascript | ||
command: npm run build-prod | ||
|
||
install_gems: &install_gems | ||
run: | ||
name: install gems | ||
command: bundle install | ||
|
||
build_jekyll_site: &build_jekyll_site | ||
run: | ||
name: build site | ||
command: bundle exec jekyll build | ||
|
||
install_cf_cli: &install_cf_cli | ||
run: | ||
name: Install CF CLI | ||
command: | | ||
sudo wget --user-agent "Mozilla" -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - && sudo echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list && sudo apt-get update && sudo apt-get -y install cf8-cli curl | ||
|
||
jobs: | ||
development_env_deploy: | ||
docker: | ||
- image: cimg/ruby:3.1.4-browsers | ||
steps: | ||
- checkout | ||
- run: | ||
name: Replace Data URL in _config.yml file when deploying to develop | ||
command: | | ||
sed -i 's@url: https://analytics\.usa\.gov@url: https://analytics-develop.app.cloud.gov@g' _config.yml | ||
sed -i 's@- name: ${APP_NAME}@- name: analytics-develop@g' manifest.yml | ||
sed -i 's@- ${S3_BUCKET_NAME}@- analytics-s3-dev@g' manifest.yml | ||
- *install_npm_packages | ||
- *copy_uswds_assets | ||
- *bundle_javascript | ||
- *install_gems | ||
- *build_jekyll_site | ||
- *install_cf_cli | ||
- run: | ||
name: print env vars for debugging | ||
command: | | ||
env | sort -f | ||
- run: | ||
name: Run Envsubst on nginx.conf | ||
command: | | ||
sed -i 's@${S3_BUCKET_URL}/data/$url_full@${S3_BUCKET_URL_DEV}/data/$url_full@g' nginx.conf.src | ||
envsubst '${S3_BUCKET_URL_DEV}' < nginx.conf.src > nginx.conf && pwd && cat nginx.conf | ||
- run: | ||
name: deploy | ||
command: | | ||
set -e | ||
# Log into cloud.gov | ||
cf api api.fr.cloud.gov | ||
cf login -u $CF_USERNAME_DEV -p $CF_PASSWORD_DEV -o gsa-opp-analytics -s analytics-dev | ||
cf push -f "./manifest.yml" | ||
cf logout | ||
staging_env_deploy: | ||
docker: | ||
- image: cimg/ruby:3.1.4-browsers | ||
steps: | ||
- checkout | ||
- run: | ||
name: Replace Data URL in _config.yml file when deploying to staging | ||
command: | | ||
sed -i 's@url: https://analytics\.usa\.gov@url: https://analytics-staging.app.cloud.gov@g' _config.yml | ||
sed -i 's@- name: ${APP_NAME}@- name: analytics-staging@g' manifest.yml | ||
sed -i 's@- ${S3_BUCKET_NAME}@- analytics-s3-staging@g' manifest.yml | ||
- *install_npm_packages | ||
- *copy_uswds_assets | ||
- *bundle_javascript | ||
- *install_gems | ||
- *build_jekyll_site | ||
- *install_cf_cli | ||
- run: | ||
name: Run Envsubst on nginx.conf | ||
command: | | ||
sed -i 's@${S3_BUCKET_URL}/data/$url_full@${S3_BUCKET_URL_STAGE}/data/$url_full@g' nginx.conf.src | ||
envsubst '${S3_BUCKET_URL_STAGE}' < nginx.conf.src > nginx.conf && pwd && cat nginx.conf | ||
- run: | ||
name: deploy | ||
command: | | ||
set -e | ||
# Log into cloud.gov | ||
cf api api.fr.cloud.gov | ||
cf login -u $CF_USERNAME_STAGE -p $CF_PASSWORD_STAGE -o gsa-opp-analytics -s analytics-staging | ||
cf push -f "./manifest.yml" | ||
cf logout | ||
production_env_deploy: | ||
docker: | ||
- image: cimg/ruby:3.1.4-browsers | ||
steps: | ||
- checkout | ||
- *install_npm_packages | ||
- *copy_uswds_assets | ||
- *bundle_javascript | ||
- *install_gems | ||
- *build_jekyll_site | ||
- *install_cf_cli | ||
- run: | ||
name: Replace Data URL in _config.yml file when deploying to prod (First sed can go after cutover) | ||
command: | | ||
sed -i 's@url: https://analytics\.usa\.gov@url: https://analytics-prod.app.cloud.gov@g' _config.yml | ||
sed -i 's@- name: ${APP_NAME}@- name: analytics-prod@g' manifest.yml | ||
sed -i 's@- ${S3_BUCKET_NAME}@- analytics-s3-prod@g' manifest.yml | ||
- run: | ||
name: Run Envsubst on nginx.conf | ||
command: | | ||
sed -i 's@${S3_BUCKET_URL}/data/$url_full@${S3_BUCKET_URL_MAIN}/data/$url_full@g' nginx.conf.src | ||
envsubst '${S3_BUCKET_URL_MAIN}' < nginx.conf.src > nginx.conf && pwd && cat nginx.conf | ||
- run: | ||
name: deploy | ||
command: | | ||
set -e | ||
# Log into cloud.gov | ||
cf api api.fr.cloud.gov | ||
cf login -u $CF_USERNAME_MAIN -p $CF_PASSWORD_MAIN -o gsa-opp-analytics -s analytics-prod | ||
cf push -f "./manifest.yml" | ||
cf logout | ||
|
||
workflows: | ||
ci: | ||
jobs: | ||
- development_env_deploy: | ||
filters: | ||
branches: | ||
only: | ||
- develop | ||
- staging_env_deploy: | ||
filters: | ||
branches: | ||
only: | ||
- staging | ||
- production_env_deploy: | ||
filters: | ||
branches: | ||
only: | ||
- master |
Oops, something went wrong.