diff --git a/.circleci/config.yml b/.circleci/config.yml
new file mode 100644
index 00000000..0ab0e8e6
--- /dev/null
+++ b/.circleci/config.yml
@@ -0,0 +1,181 @@
+version: 2.1
+
+orbs:
+ nypr-deploy: nypr/nypr-deploy@0.0.81
+
+filter_all: &filter_all
+ filters:
+ branches:
+ only: /.*/
+ tags:
+ only: /.*/
+
+filter_demo: &filter_demo
+ filters:
+ branches:
+ only: main
+ tags:
+ only: demo
+
+filter_prod: &filter_prod
+ filters:
+ branches:
+ ignore: /.*/
+ tags:
+ only: /^v[0-9]+\.[0-9]+\.[0-9]+/
+
+filter_qa: &filter_qa
+ filters:
+ tags:
+ ignore: /.*/
+ branches:
+ only: /[A-Za-z-_]+/[A-Za-z-_\d]+/
+
+
+ cache: &cache
+ key: v3-{{arch}}-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
+ cache_deploy: &cache_deploy
+ key: v2-deploy-{{ checksum ".circleci/config.yml" }}
+ cache_modernizr: &cache_modernizr
+ key: v2-modernizr-{{ .Revision }}
+
+ executor_node: &executor_node
+ docker:
+ - image: circleci/node:10-browsers
+ environment:
+ TERM: xterm
+ JOBS: 2
+ executor_python: &executor_python
+ docker:
+ - image: circleci/python:3.6
+
+ deploy_static: &deploy_static
+ <<: *executor_node
+ steps:
+ - checkout
+ - restore_cache:
+ <<: *cache
+ - restore_cache:
+ <<: *cache_modernizr
+ - run:
+ name: Deploy to S3
+ command: |
+ env | sed -n 's/^DEPLOY_//p' > .env
+ env | sed -n "s/^${ENV}_//p" >> .env
+
+ export QA_BUILD="$QA_PREFIX/$CIRCLE_BRANCH"
+ export QA_URL="$DEMO_WQXR_URL?build=$QA_BUILD"
+
+ npx ember deploy ${LONG_ENV:-qa:$QA_BUILD} --verbose --activate
+ mkdir -p /tmp/qa-builds
+
+ if [[ -z "$LONG_ENV" ]]; then
+ echo "$QA_URL" \
+ >> /tmp/qa-builds/$CIRCLE_SHA1.html
+ fi
+ - store_artifacts:
+ path: /tmp/qa-builds
+
+workflows:
+ build-test-deploy:
+ jobs:
+ - build:
+ <<: *filter_all
+ - test_ember:
+ <<: *filter_all
+ requires:
+ - build
+ - deploy_static_demo:
+ <<: *filter_demo
+ requires:
+ - test_ember
+ context: "AWS Deploy"
+ - deploy_static_prod:
+ <<: *filter_prod
+ requires:
+ - test_ember
+ context: "AWS Deploy"
+ - nypr-deploy/build_and_deploy:
+ <<: *filter_demo
+ name: "Deploy Demo Fastboot"
+ context: "AWS Deploy"
+ repo: "wqxr-web-client"
+ service: "wqxr-web-client"
+ cluster: "fastboot"
+ cpu: 512
+ memory: 1024
+ requires:
+ - build
+ - test_ember
+ - deploy_static_demo
+ - nypr-deploy/build_and_deploy:
+ <<: *filter_prod
+ name: "Deploy Production Fastboot"
+ context: "AWS Deploy"
+ repo: "wqxr-web-client"
+ service: "wqxr-web-client"
+ cluster: "fastboot"
+ cpu: 512
+ memory: 1024
+ requires:
+ - build
+ - test_ember
+ - deploy_static_prod
+
+jobs:
+ build:
+ <<: *executor_node
+ steps:
+ - checkout
+ - restore_cache:
+ <<: *cache
+ - run:
+ name: Install Node Dependencies
+ command: |
+ [ -d ./node_modules ] || yarn --pure-lockfile
+ - save_cache:
+ <<: *cache
+ paths:
+ - node_modules
+ - /home/circleci/.cache/Cypress
+ - restore_cache:
+ <<: *cache_modernizr
+ - run:
+ name: Build Modernizr
+ command: |
+ [ -f vendor/modernizr/modernizr-build.js ] || npx grunt modernizr:dist
+ - save_cache:
+ <<: *cache_modernizr
+ paths:
+ - vendor/modernizr/modernizr-build.js
+
+ test_ember:
+ <<: *executor_node
+ steps:
+ - checkout
+ - restore_cache:
+ <<: *cache
+ - restore_cache:
+ <<: *cache_modernizr
+ - run:
+ name: Test Ember
+ command: |
+ cp .env.sample .env
+ npx ember test -r xunit
+ environment:
+ CIRCLE_TEST_REPORTS: test-results
+ - store_test_results:
+ path: test-results/
+
+ deploy_static_demo:
+ environment:
+ ENV: DEMO
+ LONG_ENV: demo
+ <<: *deploy_static
+
+ deploy_static_prod:
+ environment:
+ ENV: PROD
+ LONG_ENV: production
+ <<: *deploy_static
+
diff --git a/circle.yml b/circle.yml
deleted file mode 100644
index 6497b924..00000000
--- a/circle.yml
+++ /dev/null
@@ -1,255 +0,0 @@
----
-version: 2
-
-templates:
-
- # Cache Keys:
- #############################################################################
- cache: &cache
- key: v3-{{arch}}-{{ checksum "yarn.lock" }}-{{ checksum "circle.yml" }}
- cache_deploy: &cache_deploy
- key: v2-deploy-{{ checksum "circle.yml" }}
- cache_modernizr: &cache_modernizr
- key: v2-modernizr-{{ .Revision }}
-
- # Environments:
- #############################################################################
- demo: &demo
- environment:
- ENV: DEMO
- LONG_ENV: demo
- prod: &prod
- environment:
- ENV: PROD
- LONG_ENV: production
- qa: &qa
- environment:
- ENV: DEMO
-
- # Executors:
- #############################################################################
- executor_node: &executor_node
- docker:
- - image: circleci/node:10-browsers
- environment:
- TERM: xterm
- JOBS: 2
- executor_python: &executor_python
- docker:
- - image: circleci/python:3.6
-
- # Filters:
- #############################################################################
- filter_all: &filter_all
- filters:
- tags:
- only: /.*/
- filter_demo: &filter_demo
- filters:
- branches:
- only: main
- tags:
- only: demo
- filter_prod: &filter_prod
- filters:
- tags:
- only: /^v[0-9]+\.[0-9]+\.[0-9]+/
- branches:
- ignore: /.*/
- filter_qa: &filter_qa
- filters:
- tags:
- ignore: /.*/
- branches:
- only: /[\w-]+/[\w-]+/
-
- # Job Templates:
- #############################################################################
- deploy_ecs: &deploy_ecs
- <<: *executor_python
- steps:
- - checkout
- - setup_remote_docker
- - restore_cache:
- <<: *cache_deploy
- - run:
- name: Deploy Fastboot
- command: |
- if [[ ! -d ~/.venv ]]; then
- python -m venv ~/.venv
- . ~/.venv/bin/activate
- pip install -U git+https://github.com/nypublicradio/nyprsetuptools.git
- fi
- . ~/.venv/bin/activate
- TAG="${CIRCLE_TAG:-demo}"
- ENV="${ENV,,}"
- export "${ENV}_SENTRY_RELEASE"="${TAG}"
- nyprsetuptools DockerDeploy \
- --cpu=512 \
- --ecr-repository=wqxr-web-client \
- --ecs-cluster=fastboot \
- --environment=$ENV \
- --execution-role=wqxr-web-client-$ENV \
- --fargate \
- --memory-reservation=1024 \
- --ports=3000 \
- --tag=$TAG \
- --task-role=wqxr-web-client-$ENV \
- --wait=300
- - save_cache:
- <<: *cache_deploy
- paths:
- - ~/.venv
- deploy_static: &deploy_static
- <<: *executor_node
- steps:
- - checkout
- - restore_cache:
- <<: *cache
- - restore_cache:
- <<: *cache_modernizr
- - run:
- name: Deploy to S3
- command: |
- env | sed -n 's/^DEPLOY_//p' > .env
- env | sed -n "s/^${ENV}_//p" >> .env
-
- export QA_BUILD="$QA_PREFIX/$CIRCLE_BRANCH"
- export QA_URL="$DEMO_WQXR_URL?build=$QA_BUILD"
-
- npx ember deploy ${LONG_ENV:-qa:$QA_BUILD} --verbose --activate
- mkdir -p /tmp/qa-builds
-
- if [[ -z "$LONG_ENV" ]]; then
- echo "$QA_URL" \
- >> /tmp/qa-builds/$CIRCLE_SHA1.html
- fi
- - store_artifacts:
- path: /tmp/qa-builds
-
-
-jobs:
- build:
- <<: *executor_node
- steps:
- - checkout
- - restore_cache:
- <<: *cache
- - run:
- name: Install Node Dependencies
- command: |
- [ -d ./node_modules ] || yarn --pure-lockfile
- - save_cache:
- <<: *cache
- paths:
- - node_modules
- - /home/circleci/.cache/Cypress
- - restore_cache:
- <<: *cache_modernizr
- - run:
- name: Build Modernizr
- command: |
- [ -f vendor/modernizr/modernizr-build.js ] || npx grunt modernizr:dist
- - save_cache:
- <<: *cache_modernizr
- paths:
- - vendor/modernizr/modernizr-build.js
-
- test_ember:
- <<: *executor_node
- steps:
- - checkout
- - restore_cache:
- <<: *cache
- - restore_cache:
- <<: *cache_modernizr
- - run:
- name: Test Ember
- command: |
- cp .env.sample .env
- npx ember test -r xunit
- environment:
- CIRCLE_TEST_REPORTS: test-results
- - store_test_results:
- path: test-results/
-
- test_cypress:
- <<: *executor_node
- steps:
- - checkout
- - restore_cache:
- <<: *cache
- - restore_cache:
- <<: *cache_modernizr
- - run: sudo apt-get install libgconf-2-4
- - run: cp .env.sample .env
- - run:
- name: Run Cypress tests in parallel
- command: yarn run cy:ci:test
- - store_test_results:
- path: test-results/
-
- deploy_static_demo:
- <<: *deploy_static
- <<: *demo
-
- deploy_ecs_demo:
- <<: *deploy_ecs
- <<: *demo
-
- deploy_static_prod:
- <<: *deploy_static
- <<: *prod
-
- deploy_ecs_prod:
- <<: *deploy_ecs
- <<: *prod
-
- deploy_static_qa:
- <<: *deploy_static
- <<: *qa
-
-workflows:
- version: 2
- build-test-deploy:
- jobs:
- - build:
- <<: *filter_all
- - test_ember:
- <<: *filter_all
- requires:
- - build
- - test_cypress:
- <<: *filter_all
- requires:
- - build
- - deploy_static_demo:
- <<: *filter_demo
- requires:
- - test_ember
- - test_cypress
- context: "AWS Deploy"
- - deploy_ecs_demo:
- <<: *filter_demo
- requires:
- - test_ember
- - test_cypress
- context: "AWS Deploy"
- - deploy_static_prod:
- <<: *filter_prod
- requires:
- - test_ember
- - test_cypress
- context: "AWS Deploy"
- - deploy_ecs_prod:
- <<: *filter_prod
- requires:
- - test_ember
- - test_cypress
- context: "AWS Deploy"
- - deploy_static_qa:
- <<: *filter_qa
- requires:
- - test_ember
- - test_cypress
- context: "AWS Deploy"
diff --git a/cypress/integration/404-page.spec.js b/cypress/integration/404-page.spec.js
index 3657e40b..412b7c17 100644
--- a/cypress/integration/404-page.spec.js
+++ b/cypress/integration/404-page.spec.js
@@ -1,5 +1,5 @@
// describe('404 page', () => {
-// ['true','false'].forEach(fastbootStatus => {
+// ['false'].forEach(fastbootStatus => {
// it(`displays the 404 page (fastboot=${fastbootStatus})`, () => {
// cy.fastbootCheck(`/bad-path-that-should-404`, fastbootStatus, false);
//
diff --git a/cypress/integration/blog-detail.spec.js b/cypress/integration/blog-detail.spec.js
index 15196fce..74211168 100644
--- a/cypress/integration/blog-detail.spec.js
+++ b/cypress/integration/blog-detail.spec.js
@@ -1,5 +1,5 @@
describe('Blog detail page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the blog detail page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/blogs/wqxr-blog/`, fastbootStatus);
diff --git a/cypress/integration/event-page.spec.js b/cypress/integration/event-page.spec.js
index b677e5b3..14c1c9a7 100644
--- a/cypress/integration/event-page.spec.js
+++ b/cypress/integration/event-page.spec.js
@@ -1,5 +1,5 @@
describe('Events page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the events page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/events`, fastbootStatus);
diff --git a/cypress/integration/forgot-page.spec.js b/cypress/integration/forgot-page.spec.js
index bcb0eb87..af8505e7 100644
--- a/cypress/integration/forgot-page.spec.js
+++ b/cypress/integration/forgot-page.spec.js
@@ -1,5 +1,5 @@
describe('Forgot page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the forgot page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/forgot`, fastbootStatus);
diff --git a/cypress/integration/home-page.spec.js b/cypress/integration/home-page.spec.js
index 284f653c..e1f3637e 100644
--- a/cypress/integration/home-page.spec.js
+++ b/cypress/integration/home-page.spec.js
@@ -1,5 +1,5 @@
describe('Home page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the home page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/`, fastbootStatus);
diff --git a/cypress/integration/login-page.spec.js b/cypress/integration/login-page.spec.js
index d09965ab..3a71f9cc 100644
--- a/cypress/integration/login-page.spec.js
+++ b/cypress/integration/login-page.spec.js
@@ -1,5 +1,5 @@
describe('Login page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the login page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/login`, fastbootStatus);
diff --git a/cypress/integration/playlist-daily-page.spec.js b/cypress/integration/playlist-daily-page.spec.js
index d5e12e2d..99e71c6c 100644
--- a/cypress/integration/playlist-daily-page.spec.js
+++ b/cypress/integration/playlist-daily-page.spec.js
@@ -1,5 +1,5 @@
describe('Playlist Daily page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the playlist daily page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/playlist-daily`, fastbootStatus);
diff --git a/cypress/integration/playlist-page.spec.js b/cypress/integration/playlist-page.spec.js
index 86fe0adc..4f5b70ee 100644
--- a/cypress/integration/playlist-page.spec.js
+++ b/cypress/integration/playlist-page.spec.js
@@ -1,5 +1,5 @@
describe('Playlist page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the playlist page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/streams/new-sounds`, fastbootStatus);
diff --git a/cypress/integration/profile-page.spec.js b/cypress/integration/profile-page.spec.js
index 83378ce5..b90be9b6 100644
--- a/cypress/integration/profile-page.spec.js
+++ b/cypress/integration/profile-page.spec.js
@@ -1,5 +1,5 @@
describe('Profile page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the profile page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/profile`, fastbootStatus);
diff --git a/cypress/integration/reset-page.spec.js b/cypress/integration/reset-page.spec.js
index 85dfd4f5..3234ee26 100644
--- a/cypress/integration/reset-page.spec.js
+++ b/cypress/integration/reset-page.spec.js
@@ -1,5 +1,5 @@
describe('reset page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the reset page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/reset`, fastbootStatus);
diff --git a/cypress/integration/schedule-page.spec.js b/cypress/integration/schedule-page.spec.js
index 8711b904..1aeb30ad 100644
--- a/cypress/integration/schedule-page.spec.js
+++ b/cypress/integration/schedule-page.spec.js
@@ -1,5 +1,5 @@
describe('Schedule page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the schedule page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/schedule`, fastbootStatus);
diff --git a/cypress/integration/series-detail.spec.js b/cypress/integration/series-detail.spec.js
index b3572aa0..6a2e11a0 100644
--- a/cypress/integration/series-detail.spec.js
+++ b/cypress/integration/series-detail.spec.js
@@ -1,5 +1,5 @@
describe('Series detail page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the series detail page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/series/inventing-abstraction`, fastbootStatus);
cy.visit(`/series/inventing-abstraction?fastboot=${fastbootStatus}`);
diff --git a/cypress/integration/set-password-page.spec.js b/cypress/integration/set-password-page.spec.js
index 2dce09d7..99709cdd 100644
--- a/cypress/integration/set-password-page.spec.js
+++ b/cypress/integration/set-password-page.spec.js
@@ -1,5 +1,5 @@
describe('Set password page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the set password page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/set-password`, fastbootStatus);
diff --git a/cypress/integration/settings-page.spec.js b/cypress/integration/settings-page.spec.js
index ff7bd56a..699e415c 100644
--- a/cypress/integration/settings-page.spec.js
+++ b/cypress/integration/settings-page.spec.js
@@ -1,5 +1,5 @@
describe('Settings page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the settings page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/settings`, fastbootStatus);
diff --git a/cypress/integration/show-detail.spec.js b/cypress/integration/show-detail.spec.js
index 13e49356..78ba43b5 100644
--- a/cypress/integration/show-detail.spec.js
+++ b/cypress/integration/show-detail.spec.js
@@ -1,5 +1,5 @@
describe('Show detail page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the show detail page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/shows/carnegie`, fastbootStatus);
diff --git a/cypress/integration/show-page.spec.js b/cypress/integration/show-page.spec.js
index 38eeabc7..f0c07cc0 100644
--- a/cypress/integration/show-page.spec.js
+++ b/cypress/integration/show-page.spec.js
@@ -1,5 +1,5 @@
describe('Show page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the shows page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/shows`, fastbootStatus);
diff --git a/cypress/integration/signup-page-spec.js b/cypress/integration/signup-page-spec.js
index 585cc717..dcdc9615 100644
--- a/cypress/integration/signup-page-spec.js
+++ b/cypress/integration/signup-page-spec.js
@@ -1,5 +1,5 @@
describe('Signup page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the signup page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/signup`, fastbootStatus);
diff --git a/cypress/integration/stream-page.spec.js b/cypress/integration/stream-page.spec.js
index 8b38a82d..d1f4e0cf 100644
--- a/cypress/integration/stream-page.spec.js
+++ b/cypress/integration/stream-page.spec.js
@@ -1,5 +1,5 @@
describe('Streams page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the streams page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/streams`, fastbootStatus);
diff --git a/cypress/integration/tag-detail.spec.js b/cypress/integration/tag-detail.spec.js
index 6a1cc118..2233aa58 100644
--- a/cypress/integration/tag-detail.spec.js
+++ b/cypress/integration/tag-detail.spec.js
@@ -1,5 +1,5 @@
describe('Tag detail page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the tag detail page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/tags/prince`, fastbootStatus);
diff --git a/cypress/integration/validate-page.spec.js b/cypress/integration/validate-page.spec.js
index 9354dd09..5986d64c 100644
--- a/cypress/integration/validate-page.spec.js
+++ b/cypress/integration/validate-page.spec.js
@@ -1,5 +1,5 @@
describe('Validate page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the validate daily page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/validate`, fastbootStatus);
diff --git a/cypress/integration/verify-page.spec.js b/cypress/integration/verify-page.spec.js
index 99c91e7d..ff38e5bf 100644
--- a/cypress/integration/verify-page.spec.js
+++ b/cypress/integration/verify-page.spec.js
@@ -1,5 +1,5 @@
describe('verify page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the verify daily page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/verify`, fastbootStatus);
diff --git a/cypress/integration/videos-page.spec.js b/cypress/integration/videos-page.spec.js
index 09f24b74..1d475a97 100644
--- a/cypress/integration/videos-page.spec.js
+++ b/cypress/integration/videos-page.spec.js
@@ -1,5 +1,5 @@
describe('Videos page', () => {
- ['true','false'].forEach(fastbootStatus => {
+ ['false'].forEach(fastbootStatus => {
it(`displays the videos page (fastboot=${fastbootStatus})`, () => {
cy.fastbootCheck(`/videos`, fastbootStatus);