-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
105 lines (97 loc) · 3.16 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
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- lint
- build
- test
- deploy
- deploy_tests
before_script:
- pip install xmlrunner
pep8:
stage: lint
image: pipelinecomponents/flake8
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == "jenkins"'
- if: $CI_COMMIT_BRANCH == 'master'
before_script:
- echo noop
script:
flake8 .
test:2.7:
stage: test
image: python:2.7
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == "jenkins"'
- if: $CI_COMMIT_BRANCH == 'master'
script:
- pip install enum34 xmlrunner
- make gensrc
- python tests.py
artifacts:
reports:
junit: test-reports/TEST-*.xml
test:3.5:
stage: test
image: python:3.5
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == "jenkins"'
- if: $CI_COMMIT_BRANCH == 'master'
script:
- make gensrc
- python tests.py
artifacts:
reports:
junit: test-reports/TEST-*.xml
test:3.10:
stage: test
image: python:3.10
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == "jenkins"'
- if: $CI_COMMIT_BRANCH == 'master'
script:
- make gensrc
- python tests.py
artifacts:
reports:
junit: test-reports/TEST-*.xml
build:
stage: deploy
image: $LINBIT_DOCKER_REGISTRY/build-helpers:latest
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: $CI_COMMIT_BRANCH == 'master'
before_script:
- curl -sSL $LINBIT_REGISTRY_URL/repository/lbbuild/lbbuildctl-latest -o /usr/local/bin/lbbuildctl
- chmod +x /usr/local/bin/lbbuildctl
script:
- |
case "$CI_COMMIT_REF_NAME" in
"master") VERSION_SUFFIX="" ;;
*) VERSION_SUFFIX=.dev$(echo -n $CI_COMMIT_REF_NAME | md5sum| sed -e 's/[^0-9]//g' | cut -c -9) ;;
esac
- PYTHON_LINSTOR_VERSION=1.99.0$VERSION_SUFFIX
- awk -f "/usr/local/bin/dch.awk" -v PROJECT_VERSION="$PYTHON_LINSTOR_VERSION" -v PROJECT_NAME="python-linstor" debian/changelog > debian/changelog.tmp
- mv debian/changelog{.tmp,}
- sed -i "s/VERSION = \"[0-9\.]*/VERSION = \"$PYTHON_LINSTOR_VERSION/g" linstor/version.py
# - dummy-release.sh python-linstor $PYTHON_LINSTOR_VERSION ignore
- make debrelease
- curl -isSf -u $LINBIT_REGISTRY_USER:$LINBIT_REGISTRY_PASSWORD --upload-file dist/python-linstor-*.tar.gz $LINBIT_REGISTRY_URL/repository/lbbuild-upstream/
- curl -X DELETE -u $LINBIT_REGISTRY_USER:$LINBIT_REGISTRY_PASSWORD $LINBIT_REGISTRY_URL/repository/rhel8/x86_64/python-linstor-$PYTHON_LINSTOR_VERSION-1.noarch.rpm
- lbbuildctl build python-linstor --arch amd64 --ci -v "$PYTHON_LINSTOR_VERSION"
-e LINBIT_REGISTRY_USER=$LINBIT_REGISTRY_USER
-e LINBIT_REGISTRY_PASSWORD=$LINBIT_REGISTRY_PASSWORD
-e LINBIT_REGISTRY_URL=$LINBIT_REGISTRY_URL
-d ubuntu-bionic,ubuntu-focal,ubuntu-noble,rhel7.0,rhel8.0
staging:
stage: deploy_tests
variables:
ARG_COMMIT_BRANCH: $CI_COMMIT_REF_NAME
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: $CI_COMMIT_BRANCH == 'master'
trigger: linstor/linstor-tests