forked from OSC/ondemand
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
82 lines (74 loc) · 2.17 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
before_script:
- docker info
- '[ -d tmp ] || mkdir tmp'
- MAJOR_VERSION=$(echo "${CI_COMMIT_TAG#v}" | cut -d'.' -f1)
- MINOR_VERSION=$(echo "${CI_COMMIT_TAG#v}" | cut -d'.' -f2)
- '[ "x$CI_COMMIT_TAG" != "x" ] && RELEASE="${MAJOR_VERSION}.${MINOR_VERSION}" || RELEASE=master'
- git clone --single-branch --branch $RELEASE https://github.com/OSC/ondemand-packaging.git tmp/ondemand-packaging
- cp /systems/osc_certs/gpg/ondemand/.gpgpass $CI_PROJECT_DIR/tmp/ondemand-packaging/
- cp /systems/osc_certs/gpg/ondemand/ondemand.sec $CI_PROJECT_DIR/tmp/ondemand-packaging/
- bundle install --path vendor/bundle --without test
stages:
- build
- deploy
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
rpm-build-nightly-el7:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- bundle exec rake package:rpm:nightly[el7,'-u -v -C -s']
artifacts:
paths:
- dist
name: "$CI_PROJECT_NAME-$CI_COMMIT_SHORT_SHA"
rpm-build-nightly-el8:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- bundle exec rake package:rpm:nightly[el8,'-u -v -C -s']
artifacts:
paths:
- dist
name: "$CI_PROJECT_NAME-$CI_COMMIT_SHORT_SHA"
rpm-build-el7:
stage: build
only:
- tags
script:
- bundle exec rake package:rpm[el7,'-u -v -C -s']
artifacts:
paths:
- dist
name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
rpm-build-el8:
stage: build
only:
- tags
script:
- bundle exec rake package:rpm[el8,'-u -v -C -s']
artifacts:
paths:
- dist
name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
rpm-deploy-nightly:
stage: deploy
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- ./tmp/ondemand-packaging/release.py --debug --pkey /systems/osc_certs/ssh/ondemand-packaging/id_rsa -c nightly ./dist/*
rpm-deploy-build:
stage: deploy
only:
- tags
script:
- ./tmp/ondemand-packaging/release.py --debug --pkey /systems/osc_certs/ssh/ondemand-packaging/id_rsa -c build -r $CI_COMMIT_TAG ./dist/*
rpm-deploy:
stage: deploy
only:
- tags
script:
- ./tmp/ondemand-packaging/release.py --debug --pkey /systems/osc_certs/ssh/ondemand-packaging/id_rsa -c main ./dist/*