-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
65 lines (58 loc) · 1.35 KB
/
.gitlab-ci.yml
File metadata and controls
65 lines (58 loc) · 1.35 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
image: maven:3.8.6-openjdk-11-slim
variables:
MAVEN_OPTS: "-Dmaven.repo.local=${CI_PROJECT_DIR}/.m2/repository"
ENV_DEV: "dev"
GCLOUD_IMAGE_NAME: google/cloud-sdk:420.0.0
CI_SERVICE_NAME: gitlab-ci
cache:
key:
files:
- pom.xml
prefix: ${CI_PROJECT_ID}
paths:
- $CI_PROJECT_DIR/.m2/repository
stages:
- tests
- build_flex_template_image
- deploy_flex_template_spec_file
- run_dataflow_job
tests:
stage: tests
script:
- mvn test
artifacts:
expire_in: 4 hrs
paths:
- target
build_flex_template_image:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ '' ]
stage: build_flex_template_image
when: manual
before_script:
- . ./scripts/export_env_variables.sh
script:
- . ./scripts/build_image_kaniko.sh
environment:
name: $ENV_DEV
deploy_flex_template_spec_file:
image: $GCLOUD_IMAGE_NAME
stage: deploy_flex_template_spec_file
when: manual
before_script:
- . ./scripts/export_env_variables.sh
script:
- . ./scripts/gcp_authentication.sh
- . ./scripts/create_flex_template_spec_file_gcs.sh
environment:
name: $ENV_DEV
run_dataflow_job:
image: $GCLOUD_IMAGE_NAME
stage: run_dataflow_job
when: manual
before_script:
- . ./scripts/export_env_variables.sh
script:
- . ./scripts/gcp_authentication.sh
- . ./scripts/run_dataflow_job.sh