-
Notifications
You must be signed in to change notification settings - Fork 78
/
.gitlab-ci.yml
121 lines (109 loc) · 3.89 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
include:
- project: "Northern.tech/Mender/mendertesting"
file: ".gitlab-ci-github-status-updates.yml"
- local: .gitlab-ci-staging-tests.yml
rules:
- if: $RUN_TESTS_STAGING == "true"
- local: .gitlab-ci-default-pipeline.yml
rules:
- if: $RUN_TESTS_STAGING == "true"
when: never
- if: $RUN_TESTS_FULL_INTEGRATION == "true"
when: never
- when: always
- local: .gitlab-ci-full-integration-generator.yml
rules:
- if: $RUN_TESTS_FULL_INTEGRATION == "true"
stages:
- test-gen
- test
- build
- publish
variables:
RUN_TESTS_STAGING:
description: "Run staging integration tests"
value: "false"
RUN_TESTS_FULL_INTEGRATION:
description: |
Run full integration tests.
NOTE: Can only run on protected branches
value: "false"
options:
- "false"
- "true"
CI_JOBS_IN_PARALLEL_INTEGRATION:
description: |
Number of parallel CI jobs for integration tests.
Tests in parallel = CI_JOBS_IN_PARALLEL_INTEGRATION x XDIST_JOBS_IN_PARALLEL_INTEGRATION
value: 4
XDIST_JOBS_IN_PARALLEL_INTEGRATION:
description: |
Number of parallel xdist jobs per CI job for integration tests.
Tests in parallel = CI_JOBS_IN_PARALLEL_INTEGRATION x XDIST_JOBS_IN_PARALLEL_INTEGRATION
value: 4
DOCKER_VERSION:
description: "Docker version to use in jobs"
value: "27"
MENDER_SERVER_TAG:
description: "Mender Server Docker tag for running integration tests"
value: main
# Artifacts from mender-gateway
MENDER_GATEWAY_REGISTRY:
description: "Mender Gateway Docker registry for running integration tests"
value: registry.mender.io
MENDER_GATEWAY_REPOSITORY:
description: "Mender Gateway Docker repository for running integration tests"
value: mendersoftware
MENDER_GATEWAY_TAG:
description: "Mender Gateway Docker tag for running integration tests"
value: master
# Virtual devices, built from mender-qa
MENDER_CLIENT_TAG:
description: "Mender Client (all) Docker tag for running integration tests"
value: mender-master
MENDER_GATEWAY_QEMU_TAG:
description: "Mender Gateway (QEMU) Docker tag for running integration tests"
value: mender-master
.publish:versions:
stage: publish
image: python:slim
before_script:
- apt-get update && apt-get install -qqy curl hub unzip
- export GITHUB_TOKEN="$GITHUB_BOT_TOKEN_REPO_FULL"
- pip3 install pyyaml
- curl -fsSL https://deno.land/x/install/install.sh | sh
- curl -sLO https://docs.mender.io/releases/versions.json
# Prepare SSH key
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan github.com >> ~/.ssh/known_hosts
# Configure git
- git config --global user.email "mender@northern.tech"
- git config --global user.name "Mender Test Bot"
script:
- git for-each-ref --shell --format="tag:%(refname:short) datetime:%(creatordate:format:%s)" "refs/tags/*" | sort -V -r > tags
- python extra/release_info_generator.py
- /root/.deno/bin/deno fmt versions.json
- hub clone mendersoftware/mender-docs-site && mv versions.json mender-docs-site/releases/versions.json && cd mender-docs-site
- git checkout -b update-versions-$(date +%s)
- "git add releases/versions.json && git commit --signoff -m 'chore: Version information update'"
- hub pull-request --push --base mendersoftware:master --message "Version information update" --message "keeping up with the versions"
artifacts:
expire_in: 2w
paths:
- mender-docs-site/releases/versions.json
when: always
publish:versions:tags:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_COMMIT_TAG
extends: .publish:versions
publish:versions:manual:
when: manual
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
extends: .publish:versions