Skip to content

Commit

Permalink
Merge pull request #160 from sergiitk/circleci/replace-machines
Browse files Browse the repository at this point in the history
CircleCI: replace VMs with docker nodes
  • Loading branch information
sergiitk authored May 3, 2021
2 parents c9f09ab + a0ef93f commit a9f49da
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
23 changes: 18 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ jobs:

# Build Docker image in production mode
docker-image:
machine: true
<<: *docker_node
working_directory: ~/repo
steps:
- checkout
# Install docker.
- setup_remote_docker: &docker_remote_settings
# https://circleci.com/docs/2.0/building-docker-images/#docker-version
version: 20.10.2
# Not available on the free plan
docker_layer_caching: false
# Restore assets.
- attach_workspace:
at: /tmp/workspace
Expand Down Expand Up @@ -120,10 +126,11 @@ jobs:

# Run acceptance tests (Puppeteer) against the app running in Docker
test-acceptance:
machine: true
<<: *docker_node
working_directory: ~/repo
steps:
- checkout
- setup_remote_docker: *docker_remote_settings
# List Docker images to verify the app image isn't loaded.
- run:
name: List Docker images on the clean system
Expand Down Expand Up @@ -168,9 +175,11 @@ jobs:
# Store AVA report in xUnit format
- run:
name: Save test results
command: |
mkdir -p /tmp/pb/test-results/acceptance
cp ./tmp/xunit-acceptance.xml /tmp/pb/test-results/acceptance/results.xml
command: >
mkdir -p /tmp/pb/test-results/acceptance &&
docker cp
$(docker-compose -f docker-compose.circleci.yaml ps -q test-out):/usr/src/app/tmp/xunit-acceptance.xml
/tmp/pb/test-results/acceptance/results.xml
when: always
- store_test_results:
path: /tmp/pb/test-results
Expand All @@ -187,6 +196,7 @@ jobs:
# Run unit tests
test-unit:
<<: *docker_node
resource_class: small
working_directory: ~/repo
steps:
- checkout
Expand Down Expand Up @@ -224,6 +234,7 @@ jobs:
# Run integration tests
test-integration:
<<: *docker_node
resource_class: small
working_directory: ~/repo
steps:
- checkout
Expand Down Expand Up @@ -253,6 +264,7 @@ jobs:
# Lint
lint:
<<: *docker_node
resource_class: small
working_directory: ~/repo
steps:
- checkout
Expand All @@ -278,6 +290,7 @@ jobs:
# Release
semantic-release:
<<: *docker_node
resource_class: small
working_directory: ~/repo
steps:
- checkout
Expand Down
16 changes: 15 additions & 1 deletion docker-compose.circleci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ services:
ports:
- "8090:8090"

test-out:
image: sergiitk/pagerbeauty:ci-${CIRCLE_SHA1}
entrypoint: ''
command: ['sleep', 'infinity']
init: true
volumes:
# Test reports
- out:/usr/src/app/tmp:ro

test-acceptance:
build:
context: .
Expand All @@ -73,7 +82,12 @@ services:
PAGERBEAUTY_HTTP_ACCESS_TOKEN: 9A37F64B-931B-4767-94D3-E41B92991F7C
volumes:
# Test reports
- ./tmp:/usr/src/app/tmp
- out:/usr/src/app/tmp:rw
depends_on:
- test-out
- pagerbeauty-ci
- pagerbeauty-ci-with-auth

# Use shared output volume
volumes:
out:

0 comments on commit a9f49da

Please sign in to comment.