forked from blindsidenetworks/scalelite
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
80 lines (74 loc) · 2.25 KB
/
.gitlab-ci.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
69
70
71
72
73
74
75
76
77
78
79
stages:
- test
- build
- publish
variables:
RUBY_VERSION: "2.6"
.test:
stage: test
image: ruby:$RUBY_VERSION
cache:
key:
files:
- Gemfile.lock
prefix: test-$RUBY_VERSION
paths:
- vendor/bundle/ruby
before_script:
- ruby -v
- gem install --no-document bundler -v '~> 2.0'
- bundle config set path vendor/bundle
- bundle install
interruptible: true
.rubocop:
extends: .test
script:
- bundle exec rubocop
rails_test:
extends: .test
services:
- postgres:11
variables:
POSTGRES_USER: scalelite
POSTGRES_PASSWORD: scalelitepw
DATABASE_URL: postgres://scalelite:scalelitepw@postgres/scalelite_test
script:
- bundle exec rails test:db
docker:
stage: build
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image:v0.4.0"
services:
- docker:19.03.12-dind
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://localhost:2375
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
- docker build
--target poller
--build-arg BUILDKIT_INLINE_CACHE=1
--build-arg BUILD_NUMBER="${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}}"
--cache-from $CI_REGISTRY_IMAGE/poller:git-$CI_COMMIT_SHA
--network host
--tag $CI_REGISTRY_IMAGE/poller:git-$CI_COMMIT_SHA
.
- docker push $CI_REGISTRY_IMAGE/poller:git-$CI_COMMIT_SHA
- docker build
--target recording-importer
--build-arg BUILDKIT_INLINE_CACHE=1
--build-arg BUILD_NUMBER="${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}}"
--cache-from $CI_REGISTRY_IMAGE/recording-importer:latest
--network host
--tag $CI_REGISTRY_IMAGE/recording-importer:git-$CI_COMMIT_SHA
.
- docker push $CI_REGISTRY_IMAGE/recording-importer:git-$CI_COMMIT_SHA
- docker build
--target api
--build-arg BUILDKIT_INLINE_CACHE=1
--build-arg BUILD_NUMBER="${CI_COMMIT_TAG:-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}}"
--cache-from $CI_REGISTRY_IMAGE/api:git-$CI_COMMIT_SHA
--tag $CI_REGISTRY_IMAGE/api:git-$CI_COMMIT_SHA
--network host
.
- docker push $CI_REGISTRY_IMAGE/api:git-$CI_COMMIT_SHA