This repository has been archived by the owner on Jan 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
127 lines (113 loc) · 4.09 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
variables:
API_IMAGE: aviralworld/backend
API_IMAGE_TAG: latest
NODE_VERSION: 14.7.0-alpine
NGINX_VERSION: 1.19.6-alpine
KANIKO_AUTH_CONFIG: >-
{
"auths": {
"$CI_REGISTRY": {
"username": "$CI_REGISTRY_USER",
"password": "$CI_REGISTRY_PASSWORD"
}
}
}
stages:
- test
- docker-base
- docker
test:
stage: test
image: "shivjm/node-chromium-alpine:node14.15.3-chromium81.0.4044.113"
services:
- name: adobe/s3mock:2.1.24@sha256:f444c12e38050dcf339e8784cacfa40d14a4876503d2818982acb7f117ef03df
alias: s3mock
- name: $CI_REGISTRY/$API_IMAGE/db:$API_IMAGE_TAG
alias: db
- $CI_REGISTRY/$API_IMAGE:$API_IMAGE_TAG
variables:
MOCHA_TIMEOUT: "60000"
POSTGRES_PASSWORD: "1234"
POSTGRES_DB: aviralworld
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_USER: postgres
BACKEND_DB_CONNECTION_STRING: "postgresql://postgres@db:5432/aviralworld"
BACKEND_S3_ACL: "public-read"
BACKEND_S3_CACHE_CONTROL: "public, max-age=604800, immutable"
BACKEND_BASE_URL: "https://www.example.com/"
BACKEND_RECORDINGS_PATH: "recordings"
BACKEND_PORT: "3030"
BACKEND_ADMIN_PORT: "3031"
BACKEND_TOKENS_PER_RECORDING: "2"
DOTENV_FILE: "testing.env"
FRONTEND_TEST_NAVIGATION_TIMEOUT: "5000"
S3_ACCESS_KEY: something
S3_SECRET_ACCESS_KEY: something_else
S3_REGION_NAME: fake
S3_BUCKET_NAME: test
S3_ENDPOINT: "http://s3mock:9090/"
S3_BASE_URL: "http://s3mock:9090/"
INITIALBUCKETS: "test"
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "1"
PUPPETEER_EXECUTABLE_PATH: "/usr/bin/chromium-browser"
# for the test script
PG_CONNECTION_STRING: "postgresql://postgres@db:5432/aviralworld"
ROARR_LOG: "true"
before_script:
- npm i -g pnpm
- pnpm i -s --frozen-lockfile
script:
- pnpm run format:prettier:check
# ESLint, Svelte, and TypeScript still don't quite seem to gel
# - pnpm run lint --silent
- pnpm test
only:
- merge_requests
interruptible: yes
docker-base:
stage: docker-base
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
artifacts:
paths:
- .gitlab-ci-timestamp
script:
- echo $KANIKO_AUTH_CONFIG > /kaniko/.docker/config.json
- export build_timestamp=`date +%Y%m%d%H%M%S`
- export tag="v$build_timestamp"
- echo $tag > .gitlab-ci-timestamp
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.base --cache=true --destination=$CI_REGISTRY_IMAGE/base:$tag --destination=$CI_REGISTRY_IMAGE/base:latest --build-arg NODE_VERSION=$NODE_VERSION --build-arg REVISION=$CI_COMMIT_SHA --build-arg TIMESTAMP=$build_timestamp
- echo $tag
only:
- master
docker:
stage: docker
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
dependencies:
- docker-base
script:
- echo $KANIKO_AUTH_CONFIG > /kaniko/.docker/config.json
- export build_timestamp=`date +%Y%m%d%H%M%S`
- export tag=`echo $(cat .gitlab-ci-timestamp)`
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --cache=true --destination=$CI_REGISTRY_IMAGE:$tag --destination=$CI_REGISTRY_IMAGE:latest --build-arg BASE_IMAGE=$CI_REGISTRY_IMAGE/base:$tag --build-arg NODE_VERSION=$NODE_VERSION --build-arg REVISION=$CI_COMMIT_SHA --build-arg TIMESTAMP=$build_timestamp
- echo $tag
only:
- master
docker-http:
stage: docker
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
dependencies:
- docker-base
script:
- echo $KANIKO_AUTH_CONFIG > /kaniko/.docker/config.json
- export build_timestamp=`date +%Y%m%d%H%M%S`
- export tag=`echo $(cat .gitlab-ci-timestamp)`
- echo $tag
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.http --cache=true --destination=$CI_REGISTRY_IMAGE/http:$tag --destination=$CI_REGISTRY_IMAGE/http:latest --build-arg BASE_IMAGE=$CI_REGISTRY_IMAGE/base:$tag --build-arg NGINX_VERSION=$NGINX_VERSION --build-arg REVISION=$CI_COMMIT_SHA --build-arg TIMESTAMP=$build_timestamp
only:
- master