-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathci-compose.yml
executable file
·68 lines (64 loc) · 3.71 KB
/
ci-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This Compose file is meant to be used along the project's `docker-compose.yml`
# file on CI/CD contexts, such as SemaphoreCI or Github Actions.
#
# A useful alias to run this on your CI/CD pipelines:
# `alias ci-compose="docker-compose --file docker-compose.yml --file ci-compose.yml"`
#
# See https://docs.docker.com/compose/extends/#understanding-multiple-compose-files
# We'll use the '3.x spec since it supports the 'cache_from'
# option:
version: '3.7'
services:
test:
image: icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:testing-${GIT_COMMIT_SHORT_SHA:-latest}
build: &app_ci_build
context: .
target: testing
cache_from:
# The order of this list will be considered by the `docker-image-manager` script!
# Also, be sure to include the service image name in this list as well.
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:testing-${GIT_COMMIT_SHORT_SHA:-latest} # The resulting image must also be on cache_from!
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:testing-${TAG_SAFE_BRANCH}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:testing
depends_on:
- postgres
networks:
- backend
command: rspec
environment:
DATABASE_URL: postgres://postgres:3x4mpl3P455w0rd@postgres:5432/advanced_testing_techniques_test
RAILS_ENV: test
RACK_ENV: test
MAILER_HOST: localhost
MAILER_PORT: 3000
builder:
image: icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:builder-${GIT_COMMIT_SHORT_SHA:-latest}
build:
<<: *app_ci_build
target: builder
cache_from:
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:builder-${GIT_COMMIT_SHORT_SHA:-latest}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:testing-${GIT_COMMIT_SHORT_SHA:-latest}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:builder-${TAG_SAFE_BRANCH}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:testing-${TAG_SAFE_BRANCH}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:builder
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:testing
release:
image: icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:${GIT_COMMIT_SHORT_SHA:-latest}
build:
<<: *app_ci_build
target: release
args:
SOURCE_BRANCH: ${GIT_BRANCH}
SOURCE_COMMIT: ${GIT_COMMIT_SHA}
BUILD_DATE: ${BUILD_DATE}
IMAGE_NAME: "icalialabs/advanced-testing-techniques"
cache_from:
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:${GIT_COMMIT_SHORT_SHA:-latest}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:builder-${GIT_COMMIT_SHORT_SHA:-latest}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:testing-${GIT_COMMIT_SHORT_SHA:-latest}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:${TAG_SAFE_BRANCH}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:builder-${TAG_SAFE_BRANCH}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:testing-${TAG_SAFE_BRANCH}
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:builder
- icalia-labs.registry-beta.semaphoreci.com/icalialabs/advanced-testing-techniques:testing