-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
76 lines (69 loc) · 1.77 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
76 lines (69 loc) · 1.77 KB
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
image: node:10
variables:
DOCKER_HUB_IMAGE: satoshipay/multisig-coordinator
DOCKER_VERSION: 20.10.2
CI_APPLICATION_TAG: $CI_COMMIT_SHA
CI_APPLICATION_REPOSITORY: ${CONTAINER_REGISTRY_PREFIX}/${CI_PROJECT_NAME}/${CI_COMMIT_REF_SLUG}
INGRESS_CLASS: auxiliary
stages:
- setup
- test
- build
- publish
# We cannot easily deploy from GitLab right now. Go to Google Cloud Run, pick the staging or production
# project and deploy a new revision after manually selecting the docker image.
prepare:
stage: setup
variables:
npm_config_cache: $CI_PROJECT_DIR/cache
cache:
key: npm-${CI_COMMIT_REF_SLUG}
paths:
- cache/
script:
- npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
- npm ci
artifacts:
paths:
- node_modules
expire_in: 1 hour
lint:
stage: test
script:
- npm run prettier
- npm run lint
test:
stage: test
variables:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
before_script:
- apt update && apt install -y postgresql-client || true
- cp test.env .env
- cat migrations/*.sql | psql "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}"
services:
- name: postgres:11.0-alpine
script:
- npm run test:ci
artifacts:
reports:
junit: ava.xml
build:
stage: build
script:
- npm run build
artifacts:
paths:
- build
expire_in: 1 week
publish:
stage: publish
image:
name: gcr.io/kaniko-project/executor:debug-v0.13.0
entrypoint: [""]
script:
- |
/kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/docker/Dockerfile \
--destination ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} \
--destination ${CI_APPLICATION_REPOSITORY}:v1