From 9da2a9ee48f3f1689f5674e1a8b0f9bae8a869ba Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Wed, 21 Jan 2026 15:22:43 -0500 Subject: [PATCH 01/18] Trying something out. --- .circleci/config.yml | 153 ++++++++++++++++++++++++++----------------- 1 file changed, 92 insertions(+), 61 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d73602fe4..07c03bc78 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,6 +10,92 @@ version: 2.1 # Settings > Advanced > Auto-cancel redundant builds jobs: + deploy: + docker: + - image: cimg/base:2025.01 + steps: + # Install Cloud Foundry cli (cf) before deploy step. cf is used to push to Cloud.gov + - run: + name: Install-cf-cli + command: | + # Download and convert the GPG key to binary format for modern apt + wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo gpg --dearmor -o /usr/share/keyrings/cloudfoundry-cli.gpg + echo "deb [signed-by=/usr/share/keyrings/cloudfoundry-cli.gpg] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list + sudo apt-get update + sudo apt-get install -y cf8-cli + cf -v + + - run: + name: Deploy Sidekiq worker servers + command: | + # Only deploy from a single parallel node to avoid concurrent CF pushes. + if [ "${CIRCLE_NODE_INDEX:-0}" != "0" ]; then + echo "Skipping Sidekiq deploy on parallel node ${CIRCLE_NODE_INDEX}" + exit 0 + fi + # Keep prebuilt Rust library - extconf.rb builds it during bundle install with correct paths + # The library is built with rutie which properly links against the CF Ruby installation + # echo "Removing prebuilt Rust library (will be rebuilt on CF)..." + # rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true + # rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true + ./.circleci/deploy-sidekiq.sh + no_output_timeout: 30m + + - run: + name: Deploy web server(s) + command: | + # Only deploy from a single parallel node to avoid concurrent CF pushes. + if [ "${CIRCLE_NODE_INDEX:-0}" != "0" ]; then + echo "Skipping web deploy on parallel node ${CIRCLE_NODE_INDEX}" + exit 0 + fi + # Wait for Sidekiq deployment to complete before starting web deploy + sleep 120 + # Keep prebuilt Rust library - extconf.rb builds it during bundle install with correct paths + # echo "Removing prebuilt Rust library (will be rebuilt on CF)..." + # rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true + # rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true + ./.circleci/deploy.sh + no_output_timeout: 30m + + test: + docker: + - image: cimg/ruby:3.2.8-browsers # Matches deployed Ruby version in CF + environment: + RAILS_ENV: test + PGHOST: 127.0.0.1 + PGUSER: root + + - image: cimg/redis:7.2.7 + environment: + REDIS_URL: redis://redis:6379/1 + + # 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: cimg/postgres:15.8 + environment: + POSTGRES_USER: root + POSTGRES_DB: touchpoints_test + parallelism: 4 + steps: + # run tests! + - run: + name: Run tests + command: | + mkdir /tmp/test-results + TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)" + + bundle exec rspec --format progress \ + --format RspecJunitFormatter \ + --out /tmp/test-results/rspec.xml \ + --format progress \ + $TEST_FILES + # collect reports + - store_test_results: + path: /tmp/test-results + - store_artifacts: + path: coverage build: docker: - image: cimg/ruby:3.2.8-browsers # Matches deployed Ruby version in CF @@ -30,7 +116,6 @@ jobs: POSTGRES_USER: root POSTGRES_DB: touchpoints_test - parallelism: 4 working_directory: ~/repo steps: @@ -114,66 +199,6 @@ jobs: npm i rails assets:precompile - # run tests! - - run: - name: Run tests - command: | - mkdir /tmp/test-results - TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)" - - bundle exec rspec --format progress \ - --format RspecJunitFormatter \ - --out /tmp/test-results/rspec.xml \ - --format progress \ - $TEST_FILES - # Install Cloud Foundry cli (cf) before deploy step. cf is used to push to Cloud.gov - - run: - name: Install-cf-cli - command: | - # Download and convert the GPG key to binary format for modern apt - wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo gpg --dearmor -o /usr/share/keyrings/cloudfoundry-cli.gpg - echo "deb [signed-by=/usr/share/keyrings/cloudfoundry-cli.gpg] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list - sudo apt-get update - sudo apt-get install -y cf8-cli - cf -v - # collect reports - - store_test_results: - path: /tmp/test-results - - store_artifacts: - path: coverage - - - run: - name: Deploy Sidekiq worker servers - command: | - # Only deploy from a single parallel node to avoid concurrent CF pushes. - if [ "${CIRCLE_NODE_INDEX:-0}" != "0" ]; then - echo "Skipping Sidekiq deploy on parallel node ${CIRCLE_NODE_INDEX}" - exit 0 - fi - # Keep prebuilt Rust library - extconf.rb builds it during bundle install with correct paths - # The library is built with rutie which properly links against the CF Ruby installation - # echo "Removing prebuilt Rust library (will be rebuilt on CF)..." - # rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true - # rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true - ./.circleci/deploy-sidekiq.sh - no_output_timeout: 30m - - - run: - name: Deploy web server(s) - command: | - # Only deploy from a single parallel node to avoid concurrent CF pushes. - if [ "${CIRCLE_NODE_INDEX:-0}" != "0" ]; then - echo "Skipping web deploy on parallel node ${CIRCLE_NODE_INDEX}" - exit 0 - fi - # Wait for Sidekiq deployment to complete before starting web deploy - sleep 120 - # Keep prebuilt Rust library - extconf.rb builds it during bundle install with correct paths - # echo "Removing prebuilt Rust library (will be rebuilt on CF)..." - # rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true - # rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true - ./.circleci/deploy.sh - no_output_timeout: 30m cron_tasks: docker: @@ -209,3 +234,9 @@ workflows: build-deploy: jobs: - build + - test + requires: + - build + - deploy + requires: + - test From 09ae42b8defa5f2668cbd4b33eefca7041c99095 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Wed, 21 Jan 2026 15:28:01 -0500 Subject: [PATCH 02/18] Fix yaml. --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07c03bc78..ac9189637 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -234,9 +234,9 @@ workflows: build-deploy: jobs: - build - - test + - test: requires: - build - - deploy + - deploy: requires: - test From 60d368c760bc58d261259349606030c4ce6cdb2c Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Wed, 21 Jan 2026 15:52:22 -0500 Subject: [PATCH 03/18] Use workspaces. --- .circleci/config.yml | 194 +++++++++++++++++++++++-------------------- 1 file changed, 103 insertions(+), 91 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ac9189637..8eaad2d3f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,92 +10,6 @@ version: 2.1 # Settings > Advanced > Auto-cancel redundant builds jobs: - deploy: - docker: - - image: cimg/base:2025.01 - steps: - # Install Cloud Foundry cli (cf) before deploy step. cf is used to push to Cloud.gov - - run: - name: Install-cf-cli - command: | - # Download and convert the GPG key to binary format for modern apt - wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo gpg --dearmor -o /usr/share/keyrings/cloudfoundry-cli.gpg - echo "deb [signed-by=/usr/share/keyrings/cloudfoundry-cli.gpg] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list - sudo apt-get update - sudo apt-get install -y cf8-cli - cf -v - - - run: - name: Deploy Sidekiq worker servers - command: | - # Only deploy from a single parallel node to avoid concurrent CF pushes. - if [ "${CIRCLE_NODE_INDEX:-0}" != "0" ]; then - echo "Skipping Sidekiq deploy on parallel node ${CIRCLE_NODE_INDEX}" - exit 0 - fi - # Keep prebuilt Rust library - extconf.rb builds it during bundle install with correct paths - # The library is built with rutie which properly links against the CF Ruby installation - # echo "Removing prebuilt Rust library (will be rebuilt on CF)..." - # rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true - # rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true - ./.circleci/deploy-sidekiq.sh - no_output_timeout: 30m - - - run: - name: Deploy web server(s) - command: | - # Only deploy from a single parallel node to avoid concurrent CF pushes. - if [ "${CIRCLE_NODE_INDEX:-0}" != "0" ]; then - echo "Skipping web deploy on parallel node ${CIRCLE_NODE_INDEX}" - exit 0 - fi - # Wait for Sidekiq deployment to complete before starting web deploy - sleep 120 - # Keep prebuilt Rust library - extconf.rb builds it during bundle install with correct paths - # echo "Removing prebuilt Rust library (will be rebuilt on CF)..." - # rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true - # rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true - ./.circleci/deploy.sh - no_output_timeout: 30m - - test: - docker: - - image: cimg/ruby:3.2.8-browsers # Matches deployed Ruby version in CF - environment: - RAILS_ENV: test - PGHOST: 127.0.0.1 - PGUSER: root - - - image: cimg/redis:7.2.7 - environment: - REDIS_URL: redis://redis:6379/1 - - # 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: cimg/postgres:15.8 - environment: - POSTGRES_USER: root - POSTGRES_DB: touchpoints_test - parallelism: 4 - steps: - # run tests! - - run: - name: Run tests - command: | - mkdir /tmp/test-results - TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)" - - bundle exec rspec --format progress \ - --format RspecJunitFormatter \ - --out /tmp/test-results/rspec.xml \ - --format progress \ - $TEST_FILES - # collect reports - - store_test_results: - path: /tmp/test-results - - store_artifacts: - path: coverage build: docker: - image: cimg/ruby:3.2.8-browsers # Matches deployed Ruby version in CF @@ -123,11 +37,11 @@ jobs: name: Update packages command: sudo apt-get update - - run: - name: Ensure Chrome is available - command: | - # cimg/ruby:*-browsers images already include Chrome; skip orb command to avoid "Cannot find declaration" errors - echo "Using cimg/ruby:3.4.7-browsers which includes Chrome" +# - run: +# name: Ensure Chrome is available +# command: | +# # cimg/ruby:*-browsers images already include Chrome; skip orb command to avoid "Cannot find declaration" errors +# echo "Using cimg/ruby:3.4.7-browsers which includes Chrome" - checkout @@ -198,6 +112,104 @@ jobs: command: | npm i rails assets:precompile + + - persist_to_workspace: + root: ~/repo + paths: + - . + test: + docker: + - image: cimg/ruby:3.2.8-browsers # Matches deployed Ruby version in CF + environment: + RAILS_ENV: test + PGHOST: 127.0.0.1 + PGUSER: root + + - image: cimg/redis:7.2.7 + environment: + REDIS_URL: redis://redis:6379/1 + + # 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: cimg/postgres:15.8 + environment: + POSTGRES_USER: root + POSTGRES_DB: touchpoints_test + + parallelism: 4 + + steps: + - attach_workspace: + at: ~/repo + + # run tests! + - run: + name: Run tests + command: | + mkdir /tmp/test-results + TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)" + + bundle exec rspec --format progress \ + --format RspecJunitFormatter \ + --out /tmp/test-results/rspec.xml \ + --format progress \ + $TEST_FILES + # collect reports + - store_test_results: + path: /tmp/test-results + - store_artifacts: + path: coverage + + deploy: + docker: + - image: cimg/base:2025.01 + steps: + # Install Cloud Foundry cli (cf) before deploy step. cf is used to push to Cloud.gov + - run: + name: Install-cf-cli + command: | + # Download and convert the GPG key to binary format for modern apt + wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo gpg --dearmor -o /usr/share/keyrings/cloudfoundry-cli.gpg + echo "deb [signed-by=/usr/share/keyrings/cloudfoundry-cli.gpg] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list + sudo apt-get update + sudo apt-get install -y cf8-cli + cf -v + + - run: + name: Deploy Sidekiq worker servers + command: | + # Only deploy from a single parallel node to avoid concurrent CF pushes. + if [ "${CIRCLE_NODE_INDEX:-0}" != "0" ]; then + echo "Skipping Sidekiq deploy on parallel node ${CIRCLE_NODE_INDEX}" + exit 0 + fi + # Keep prebuilt Rust library - extconf.rb builds it during bundle install with correct paths + # The library is built with rutie which properly links against the CF Ruby installation + # echo "Removing prebuilt Rust library (will be rebuilt on CF)..." + # rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true + # rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true + ./.circleci/deploy-sidekiq.sh + no_output_timeout: 30m + + - run: + name: Deploy web server(s) + command: | + # Only deploy from a single parallel node to avoid concurrent CF pushes. + if [ "${CIRCLE_NODE_INDEX:-0}" != "0" ]; then + echo "Skipping web deploy on parallel node ${CIRCLE_NODE_INDEX}" + exit 0 + fi + # Wait for Sidekiq deployment to complete before starting web deploy + sleep 120 + # Keep prebuilt Rust library - extconf.rb builds it during bundle install with correct paths + # echo "Removing prebuilt Rust library (will be rebuilt on CF)..." + # rm -rf ext/widget_renderer/target/release/libwidget_renderer.so 2>/dev/null || true + # rm -f ext/widget_renderer/libwidget_renderer.so 2>/dev/null || true + ./.circleci/deploy.sh + no_output_timeout: 30m + + cron_tasks: From d0079b4572e3527bd0f8dddbf362e5c9c4ce6da3 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Wed, 21 Jan 2026 17:11:18 -0500 Subject: [PATCH 04/18] Try to fix workspaces. --- .circleci/config.yml | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8eaad2d3f..8b910ebca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,8 +9,8 @@ version: 2.1 # Note: This must also be enabled in CircleCI project settings # Settings > Advanced > Auto-cancel redundant builds -jobs: - build: +executors: + docker-executor: docker: - image: cimg/ruby:3.2.8-browsers # Matches deployed Ruby version in CF environment: @@ -30,7 +30,9 @@ jobs: POSTGRES_USER: root POSTGRES_DB: touchpoints_test - working_directory: ~/repo +jobs: + build: + executor: docker-executor steps: - run: @@ -114,34 +116,15 @@ jobs: rails assets:precompile - persist_to_workspace: - root: ~/repo + root: . paths: - . - test: - docker: - - image: cimg/ruby:3.2.8-browsers # Matches deployed Ruby version in CF - environment: - RAILS_ENV: test - PGHOST: 127.0.0.1 - PGUSER: root - - - image: cimg/redis:7.2.7 - environment: - REDIS_URL: redis://redis:6379/1 - - # 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: cimg/postgres:15.8 - environment: - POSTGRES_USER: root - POSTGRES_DB: touchpoints_test - + test: parallelism: 4 steps: - attach_workspace: - at: ~/repo + at: . # run tests! - run: @@ -162,9 +145,11 @@ jobs: path: coverage deploy: - docker: - - image: cimg/base:2025.01 + executor: docker-executor steps: + - attach_workspace: + at: . + # Install Cloud Foundry cli (cf) before deploy step. cf is used to push to Cloud.gov - run: name: Install-cf-cli From dd9bfe2e9c57eda426157060b700748fc20bf47c Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Wed, 21 Jan 2026 17:15:40 -0500 Subject: [PATCH 05/18] Fix config. --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b910ebca..51ceed334 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -119,7 +119,8 @@ jobs: root: . paths: - . - test: + test: + executor: docker-executor parallelism: 4 steps: From f905f63f530c1c8c5852caf78eb0660e1a753781 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Wed, 21 Jan 2026 17:27:59 -0500 Subject: [PATCH 06/18] Try to fix bundle. --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 51ceed334..aa6c7bd55 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,6 +17,7 @@ executors: RAILS_ENV: test PGHOST: 127.0.0.1 PGUSER: root + BUNDLE_PATH: vendor/bundle - image: cimg/redis:7.2.7 environment: From 5ffd26f0dfb35d77c3125352e70406ad04341fba Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Thu, 22 Jan 2026 10:00:18 -0500 Subject: [PATCH 07/18] Formatting changes. --- .circleci/config.yml | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aa6c7bd55..dd02843f8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,24 +12,24 @@ version: 2.1 executors: docker-executor: docker: - - image: cimg/ruby:3.2.8-browsers # Matches deployed Ruby version in CF - environment: - RAILS_ENV: test - PGHOST: 127.0.0.1 - PGUSER: root - BUNDLE_PATH: vendor/bundle + - image: cimg/ruby:3.2.8-browsers # Matches deployed Ruby version in CF + environment: + RAILS_ENV: test + PGHOST: 127.0.0.1 + PGUSER: root + BUNDLE_PATH: vendor/bundle - - image: cimg/redis:7.2.7 - environment: - REDIS_URL: redis://redis:6379/1 + - image: cimg/redis:7.2.7 + environment: + REDIS_URL: redis://redis:6379/1 # 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: cimg/postgres:15.8 - environment: - POSTGRES_USER: root - POSTGRES_DB: touchpoints_test + - image: cimg/postgres:15.8 + environment: + POSTGRES_USER: root + POSTGRES_DB: touchpoints_test jobs: build: @@ -96,7 +96,7 @@ jobs: # Download and cache dependencies - restore_cache: keys: - - v1-bundle-{{ checksum "Gemfile.lock" }} + - v1-bundle-{{ checksum "Gemfile.lock" }} - run: bundle install @@ -134,12 +134,11 @@ jobs: command: | mkdir /tmp/test-results TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)" - - bundle exec rspec --format progress \ - --format RspecJunitFormatter \ - --out /tmp/test-results/rspec.xml \ - --format progress \ - $TEST_FILES + bundle exec rspec --format progress \ + --format RspecJunitFormatter \ + --out /tmp/test-results/rspec.xml \ + --format progress \ + $TEST_FILES # collect reports - store_test_results: path: /tmp/test-results From 2ff86b45067ff05649f144f618561294a1f37705 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Thu, 22 Jan 2026 10:00:42 -0500 Subject: [PATCH 08/18] Fix precompile assets job. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dd02843f8..a5eb024b0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -114,7 +114,7 @@ jobs: name: Precompile assets command: | npm i - rails assets:precompile + bundle exec rails assets:precompile - persist_to_workspace: root: . From 8d1627da5c140e49f0d833cf6b7b0d7ff0b1d5a4 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Thu, 22 Jan 2026 10:15:03 -0500 Subject: [PATCH 09/18] Move db init to test job. --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a5eb024b0..bc8301b52 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,10 +105,6 @@ jobs: - ./vendor/bundle key: v1-bundle-{{ checksum "Gemfile.lock" }} - # Database setup - - run: bundle exec rake db:create - - run: bundle exec rake db:schema:load - # Precompile assets (to use npm packages specified in assets.rb) - run: name: Precompile assets @@ -127,7 +123,11 @@ jobs: steps: - attach_workspace: at: . - + + # Database setup + - run: bundle exec rake db:create + - run: bundle exec rake db:schema:load + # run tests! - run: name: Run tests From a971f54c75126e0d06ccfed013f18853ef2d7a72 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Thu, 22 Jan 2026 10:38:38 -0500 Subject: [PATCH 10/18] Test deploy job. --- .circleci/config.yml | 6 ------ .circleci/deploy-sidekiq.sh | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc8301b52..82f248ee3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,12 +40,6 @@ jobs: name: Update packages command: sudo apt-get update -# - run: -# name: Ensure Chrome is available -# command: | -# # cimg/ruby:*-browsers images already include Chrome; skip orb command to avoid "Cannot find declaration" errors -# echo "Using cimg/ruby:3.4.7-browsers which includes Chrome" - - checkout - run: diff --git a/.circleci/deploy-sidekiq.sh b/.circleci/deploy-sidekiq.sh index df34be894..53da12960 100755 --- a/.circleci/deploy-sidekiq.sh +++ b/.circleci/deploy-sidekiq.sh @@ -202,3 +202,11 @@ then else echo "Not on the develop branch." fi + +# Temp for testing deployment on feature branch +echo "Logging into cloud.gov" +# Log into CF and push +cf login -a $CF_API_ENDPOINT -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE +echo "Pushing to Staging..." +cf_push_with_retry touchpoints-staging-sidekiq-worker +echo "Push to Staging Complete." \ No newline at end of file From 359998858e56d7272099b563cd48d3ad114ca954 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Thu, 22 Jan 2026 11:02:59 -0500 Subject: [PATCH 11/18] Test deploy job. --- .circleci/deploy.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index a70ce758c..330c37cf7 100755 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -318,3 +318,11 @@ then else echo "Not on the develop branch." fi + +# Temp for testing deployment on feature branch +echo "Logging into cloud.gov" +# Log into CF and push +cf login -a $CF_API_ENDPOINT -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE +echo "Pushing web servers to Staging..." +cf_push_with_retry touchpoints-staging "" true +echo "Push to Staging Complete." \ No newline at end of file From 8174dc6a93c9afad2468fb5d5875611cabe98c9e Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Thu, 22 Jan 2026 11:20:24 -0500 Subject: [PATCH 12/18] Use environment-specific manifest for deploy. --- .circleci/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index 330c37cf7..52520f3ed 100755 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -324,5 +324,5 @@ echo "Logging into cloud.gov" # Log into CF and push cf login -a $CF_API_ENDPOINT -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE echo "Pushing web servers to Staging..." -cf_push_with_retry touchpoints-staging "" true +cf_push_with_retry touchpoints-staging touchpoints-staging.yml true echo "Push to Staging Complete." \ No newline at end of file From df62598aeed1dee547160599db7d36b45c28e7d1 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Thu, 22 Jan 2026 12:06:36 -0500 Subject: [PATCH 13/18] Don't run migrations before deploying. --- .circleci/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index 52520f3ed..d9af3b182 100755 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -324,5 +324,5 @@ echo "Logging into cloud.gov" # Log into CF and push cf login -a $CF_API_ENDPOINT -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE echo "Pushing web servers to Staging..." -cf_push_with_retry touchpoints-staging touchpoints-staging.yml true +cf_push_with_retry touchpoints-staging touchpoints-staging.yml echo "Push to Staging Complete." \ No newline at end of file From b25f868c194993ac52f07b10db73741995069c21 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Thu, 22 Jan 2026 12:57:32 -0500 Subject: [PATCH 14/18] Update staging manifest file. --- touchpoints-staging.yml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/touchpoints-staging.yml b/touchpoints-staging.yml index 631485a26..9abd2091e 100644 --- a/touchpoints-staging.yml +++ b/touchpoints-staging.yml @@ -3,29 +3,30 @@ applications: memory: 2G disk_quota: 2G timeout: 180 - command: bundle exec rake cf:on_first_instance db:schema:load db:seed && bundle exec rails s -b 0.0.0.0 -p $PORT -e $RAILS_ENV + command: bundle exec rake cf:on_first_instance db:migrate && bundle exec rails s -b 0.0.0.0 -p $PORT -e $RAILS_ENV env: - AWS_SES_ACCESS_KEY_ID: ((AWS_SES_ACCESS_KEY_ID)) - AWS_SES_SECRET_ACCESS_KEY: ((AWS_SES_SECRET_ACCESS_KEY)) - AWS_SES_REGION: ((AWS_SES_REGION)) + # Non-secret env vars only - secrets are set via `cf set-env` and should NOT be in this manifest + # Empty values here would OVERWRITE existing secrets on cf push! DISABLE_DATABASE_ENVIRONMENT_CHECK: 1 LOGIN_GOV_CLIENT_ID: urn:gov:gsa:openidconnect.profiles:sp:sso:gsa-tts-opp:touchpoints-staging LOGIN_GOV_IDP_BASE_URL: https://idp.int.identitysandbox.gov/ - LOGIN_GOV_PRIVATE_KEY: ((LOGIN_GOV_PRIVATE_KEY)) LOGIN_GOV_REDIRECT_URI: https://app-staging.touchpoints.digital.gov/users/auth/login_dot_gov/callback - NEW_RELIC_KEY: ((NEW_RELIC_KEY)) RAILS_ENV: staging - S3_AWS_ACCESS_KEY_ID: ((S3_AWS_ACCESS_KEY_ID)) - S3_AWS_BUCKET_NAME: ((S3_AWS_BUCKET_NAME)) - S3_AWS_REGION: ((S3_AWS_REGION)) - S3_AWS_SECRET_ACCESS_KEY: ((S3_AWS_SECRET_ACCESS_KEY)) - TOUCHPOINTS_ADMIN_EMAILS: ((TOUCHPOINTS_ADMIN_EMAILS)) - TOUCHPOINTS_EMAIL_SENDER: ((TOUCHPOINTS_EMAIL_SENDER)) + RAILS_SERVE_STATIC_FILES: "true" TOUCHPOINTS_WEB_DOMAIN: touchpoints-staging.app.cloud.gov - TURNSTILE_SECRET_KEY: ((TURNSTILE_SECRET_KEY)) - TOUCHPOINTS_WEB_DOMAIN2: app-staging.touchpoints.digital.gov - ASSET_HOST: app-staging.touchpoints.digital.gov SKIP_WIDGET_RENDERER: "true" + # Secrets managed via cf set-env (DO NOT add empty keys here): + # - AWS_SES_ACCESS_KEY_ID + # - AWS_SES_SECRET_ACCESS_KEY + # - AWS_SES_REGION + # - LOGIN_GOV_PRIVATE_KEY + # - NEW_RELIC_KEY + # - S3_AWS_ACCESS_KEY_ID + # - S3_AWS_BUCKET_NAME + # - S3_AWS_REGION + # - S3_AWS_SECRET_ACCESS_KEY + # - TOUCHPOINTS_EMAIL_SENDER + # - TOUCHPOINTS_GTM_CONTAINER_ID buildpacks: - https://github.com/rileyseaburg/rust-buildpack-touchpoints.git - nodejs_buildpack From b69a29497db9c7acd48af874fd39fc3b5eb3100d Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Thu, 22 Jan 2026 13:54:38 -0500 Subject: [PATCH 15/18] Simplify push. --- .circleci/deploy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh index d9af3b182..acf9b1536 100755 --- a/.circleci/deploy.sh +++ b/.circleci/deploy.sh @@ -324,5 +324,6 @@ echo "Logging into cloud.gov" # Log into CF and push cf login -a $CF_API_ENDPOINT -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE echo "Pushing web servers to Staging..." -cf_push_with_retry touchpoints-staging touchpoints-staging.yml +cf push touchpoints-staging -f touchpoints-staging.yml --strategy rolling -t 180 --no-wait +# cf_push_with_retry touchpoints-staging touchpoints-staging.yml echo "Push to Staging Complete." \ No newline at end of file From 6775194a55668520f39c89a945e33de25e169220 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Thu, 22 Jan 2026 16:51:23 -0500 Subject: [PATCH 16/18] Try to fix flag. --- touchpoints-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/touchpoints-staging.yml b/touchpoints-staging.yml index 9abd2091e..55e316484 100644 --- a/touchpoints-staging.yml +++ b/touchpoints-staging.yml @@ -10,7 +10,7 @@ applications: DISABLE_DATABASE_ENVIRONMENT_CHECK: 1 LOGIN_GOV_CLIENT_ID: urn:gov:gsa:openidconnect.profiles:sp:sso:gsa-tts-opp:touchpoints-staging LOGIN_GOV_IDP_BASE_URL: https://idp.int.identitysandbox.gov/ - LOGIN_GOV_REDIRECT_URI: https://app-staging.touchpoints.digital.gov/users/auth/login_dot_gov/callback + LOGIN_GOV_REDIRECT_URI: https://touchpoints-staging.app.cloud.gov/users/auth/login_dot_gov/callback RAILS_ENV: staging RAILS_SERVE_STATIC_FILES: "true" TOUCHPOINTS_WEB_DOMAIN: touchpoints-staging.app.cloud.gov From 6eafc1a501c3d7dca9d6527ace0af43be8a1ffd0 Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Fri, 23 Jan 2026 11:09:28 -0500 Subject: [PATCH 17/18] Update CI config to support 'rerun failed tests'. --- .circleci/config.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 82f248ee3..5328eaa38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -127,12 +127,9 @@ jobs: name: Run tests command: | mkdir /tmp/test-results - TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)" - bundle exec rspec --format progress \ - --format RspecJunitFormatter \ - --out /tmp/test-results/rspec.xml \ - --format progress \ - $TEST_FILES + TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb")" + echo "$TEST_FILES" | circleci tests run --verbose --split-by=timings \ + --command="bundle exec rspec --format progress --format RspecJunitFormatter --out /tmp/test-results/rspec.xml # collect reports - store_test_results: path: /tmp/test-results From fb2369659b7859a7705212680e854664a653f42a Mon Sep 17 00:00:00 2001 From: Shelley Nason Date: Fri, 23 Jan 2026 11:21:35 -0500 Subject: [PATCH 18/18] Fix config. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5328eaa38..b41410171 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -129,7 +129,7 @@ jobs: mkdir /tmp/test-results TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb")" echo "$TEST_FILES" | circleci tests run --verbose --split-by=timings \ - --command="bundle exec rspec --format progress --format RspecJunitFormatter --out /tmp/test-results/rspec.xml + --command="bundle exec rspec --format progress --format RspecJunitFormatter --out /tmp/test-results/rspec.xml" # collect reports - store_test_results: path: /tmp/test-results