-
Notifications
You must be signed in to change notification settings - Fork 79
/
.gitlab-ci.yml
114 lines (104 loc) · 3.7 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
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.yml
rules:
- if: $RUN_TESTS_FULL_INTEGRATION == "true"
stages:
- 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"
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
MENDER_CLIENT_TAG:
description: "Mender Client Docker tag for running integration tests"
value: mender-master
# 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
# Artifacts from meta-mender
MENDER_GATEWAY_QEMU_REGISTRY:
description: "Mender Gateway (QEMU) Docker registry for running integration tests"
value: registry.mender.io
MENDER_GATEWAY_QEMU_REPOSITORY:
description: "Mender Gateway (QEMU) Docker repository for running integration tests"
value: mendersoftware
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 "[email protected]"
- 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