forked from mendersoftware/integration
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci-default-pipeline.yml
117 lines (100 loc) · 3.76 KB
/
.gitlab-ci-default-pipeline.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
include:
- project: 'Northern.tech/Mender/mendertesting'
file: '.gitlab-ci-check-commits.yml'
- project: 'Northern.tech/Mender/mendertesting'
file: '.gitlab-ci-check-license.yml'
- project: 'Northern.tech/Mender/mendertesting'
file: '.gitlab-ci-check-python3-format.yml'
- project: 'Northern.tech/Mender/mendertesting'
file: '.gitlab-ci-check-docker-build.yml'
variables:
LICENSE_HEADERS_IGNORE_FILES_REGEXP: '\./extra/gitdm.*'
test:extra-tools:
image: "python:3"
stage: test
before_script:
- pip install pytest pyyaml
# Rename the branch we're on, so that it's not in the way for the
# subsequent fetch. It's ok if this fails, it just means we're not on any
# branch.
- git branch -m temp-branch || true
# Set up git identity
- git config --global user.name "Northern.tech" && git config --global user.email "[email protected]"
# Needed for the statistics generator
- git config --global mailmap.file $(pwd)/extra/gitdm/mailmap
# Add github remote for tests using --integration-versions-including
- git remote add github https://github.com/mendersoftware/integration.git
- git fetch github
# Fetch master branch for tests using --in-integration-version
- git fetch origin master:master
- git fetch origin --tags
- git submodule update --init --recursive
# Fetch all Open Source release repositories for testing release_tool.
- for repo in $(env TEST_RELEASE_TOOL_LIST_OPEN_SOURCE_ONLY=1 extra/release_tool.py --list); do
- if [ $repo == integration ]; then
- continue
- fi
- git clone https://github.com/mendersoftware/$repo ../$repo
- done
script:
- ( cd extra/changelog-generator && ./test-changelog-generator )
- python3 -m pytest extra/test_release_tool.py
- python3 -m pytest extra/test_statistics_generator.py
test:docs:
image: tiangolo/docker-with-compose
services:
- docker:19.03.5-dind
before_script:
- apk add bash git openssl pwgen python3 jq
- git config --global user.name "user"
- git config --global user.email "[email protected]"
- git clone https://github.com/mendersoftware/mender-docs.git mender-docs
- MENDER_DOCS_BRANCH=$(
for i in $(
git for-each-ref
--format='%(refname:short)'
'refs/remotes/origin/[0-9].[0-9].x'
'refs/remotes/origin/staging'
'refs/remotes/origin/master'
); do
echo $(git log --oneline $(git merge-base $i HEAD)..HEAD | wc -l) $i;
done | sort -n | head -n1 | awk '{print $2}'
)
- if [[ $MENDER_DOCS_BRANCH == "origin/staging" ]]; then
- MENDER_DOCS_BRANCH="origin/hosted"
- fi
- cd mender-docs
- git checkout $MENDER_DOCS_BRANCH
script:
- ./run-tests.sh
# Smoke test to verify requirements.txt are sane
test:integration-tests:requirements:
stage: test
rules:
- changes:
- tests/requirements/apk-requirements.txt
- tests/requirements/python-requirements.txt
# Use same image as in mender-qa
image: docker:19.03-dind
script:
# Get and install the integration test requirements
- apk add $(cat tests/requirements/apk-requirements.txt)
- pip install -r tests/requirements/python-requirements.txt
build:docker:
variables:
DOCKER_REPOSITORY: mendersoftware/mender-client-docker-addons
DOCKER_DIR: extra/mender-client-docker-addons
publish:image:
variables:
DOCKER_REPOSITORY: mendersoftware/mender-client-docker-addons
DOCKER_DIR: extra/mender-client-docker-addons
publish:image:mender:
variables:
DOCKER_REPOSITORY: mendersoftware/mender-client-docker-addons
DOCKER_DIR: extra/mender-client-docker-addons
trigger:saas:sync-staging-component:
rules:
- when: never
publish:image:saas:
rules:
- when: never