forked from NVIDIA/gpu-monitoring-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
68 lines (58 loc) · 1.85 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
image: docker:latest
services:
- docker:dind
stages:
- aws_kube_setup
- e2e_tests
- aws_kube_clean
variables:
GIT_SUBMODULE_STRATEGY: recursive
TF_VAR_FILE: "$CI_PROJECT_DIR/tests/variables.tfvars"
build:
stage: aws_kube_setup
script:
- apk add make
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- make REGISTRY="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHORT_SHA}" all
- make REGISTRY="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHORT_SHA}" push
- make REGISTRY="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHORT_SHA}" push-short
- make REGISTRY="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHORT_SHA}" push-latest
- make REGISTRY="${CI_REGISTRY_IMAGE}" VERSION="${CI_COMMIT_SHORT_SHA}" push-ci
aws_kube_setup:
extends: .aws_kube_setup
only:
- master
- tags
e2e:
stage: e2e_tests
only:
- master
script:
- source aws-kube-ci/hostname
- apk add --no-cache openssh-client rsync
- rsync -e "ssh -i aws-kube-ci/key -o StrictHostKeyChecking=no" -av --exclude="vendor/" "${CI_PROJECT_DIR}" "${instance_hostname}:~/"
- rc=0
- ssh -i aws-kube-ci/key ${instance_hostname} \
"export CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA} &&
export CI_REGISTRY_IMAGE=${CI_REGISTRY_IMAGE} &&
cd ~/gpu-monitoring-tools && sudo -E ./tests/ci-run-e2e.sh"
aws_kube_clean:
extends: .aws_kube_clean
only:
- master
- tags
release:
stage: aws_kube_clean
only:
- tags
script:
- apk add make
- docker login -u "${REGISTRY_USER}" -p "${REGISTRY_TOKEN}"
- make VERSION="${CI_COMMIT_TAG}" all
- make VERSION="${CI_COMMIT_TAG}" push
- make VERSION="${CI_COMMIT_TAG}" push-short
- make VERSION="${CI_COMMIT_TAG}" push-latest
include:
project: nvidia/container-infrastructure/aws-kube-ci
file: aws-kube-ci.yml
ref: 21.02.23