Skip to content

Commit 6a4491b

Browse files
Merge pull request #238 from psu-libraries/feat-test-always
Fix CI workflow for test-application
2 parents ccb6453 + 522b24e commit 6a4491b

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.circleci/config.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,20 @@ jobs:
249249
command: |
250250
gem install bundler -v "$(grep -A 1 'BUNDLED WITH' Gemfile.lock | tail -n 1 | xargs)"
251251
bundle _$(grep -A 1 'BUNDLED WITH' Gemfile.lock | tail -n 1 | xargs)_ install
252+
- attach_workspace:
253+
at: /tmp
252254
- run:
253-
name: Build and run containers
254-
command: docker-compose -f docker-compose.yml build && docker-compose -f docker-compose.yml up --force-recreate -d
255+
name: Load Docker image from build-image
256+
command: |
257+
if [ -f /tmp/docker-image.tar ]; then
258+
docker load -i /tmp/docker-image.tar
259+
else
260+
echo "No persisted image found; falling back to local build"
261+
docker-compose -f docker-compose.yml build
262+
fi
263+
- run:
264+
name: Start services (no-build when image available)
265+
command: docker-compose -f docker-compose.yml up --force-recreate -d --no-build
255266
- run:
256267
name: Wait for mysql to be ready
257268
command: docker-compose exec web bash ./wait_for_db.sh
@@ -284,11 +295,7 @@ workflows:
284295
name: build-image
285296
context:
286297
- org-global
287-
filters:
288-
branches:
289-
only:
290-
- main
291-
- /preview\/.*/
298+
292299
- deploy-application:
293300
name: deploy-application
294301
context:
@@ -329,4 +336,6 @@ workflows:
329336
name: test-application
330337
context:
331338
- org-global
339+
requires:
340+
- build-image
332341

0 commit comments

Comments
 (0)