forked from MatthewJohn/terrarun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
53 lines (47 loc) · 1.22 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
image: python:3.10
.limit_release_and_non_pushes:
rules:
- if: $CI_COMMIT_MESSAGE =~ /^chore\(release\):.*/
when: never
- if: $CI_PIPELINE_SOURCE == 'push'
when: always
- when: never
build-e2e-test-docker-image:
stage: build
image: docker:latest
tags: [amd64]
extends: .limit_release_and_non_pushes
services:
- docker:dind
script:
- cd tests/e2e; docker build -f Dockerfile -t terrarun-e2e-image:v${CI_COMMIT_SHORT_SHA} --build-arg http_proxy=$http_proxy --build-arg HTTP_PROXY=$http_proxy --build-arg https_proxy=$https_proxy --build-arg HTTPS_PROXY=$https_proxy .
e2e-tests:
stage: test
extends: .limit_release_and_non_pushes
image: terrarun-e2e-image:v${CI_COMMIT_SHORT_SHA}
tags: [amd64]
script:
- bash ./tests/e2e/run_tests.sh
release:
stage: deploy
image: semantic-release:latest
cache:
paths:
- node_modules/
variables:
GITLAB_TOKEN: $GITLAB_TOKEN
GIT_STRATEGY: clone
script:
- semantic-release
rules:
- if: '$CI_COMMIT_REF_NAME != "main"'
when: never
- if: '$CI_COMMIT_MESSAGE =~ /chore\(release\)/'
when: never
- if: $CI_PIPELINE_SOURCE == 'push'
when: always
- when: never
stages:
- build
- test
- deploy