forked from OSC/ondemand
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
78 lines (72 loc) · 2.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
before_script:
- docker info
- 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" ] && OOD_PACKAGING_RELEASE="${MAJOR_VERSION}.${MINOR_VERSION}" || OOD_PACKAGING_RELEASE=main'
- bundle install --path vendor/bundle --without test
stages:
- build
- deploy
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
OOD_PACKAGING_DEBUG: 'true'
OOD_PACKAGING_GPG_PRIVATE_KEY: /systems/osc_certs/gpg/ondemand/ondemand-sha512.sec
OOD_PACKAGING_GPG_PASSPHRASE: /systems/osc_certs/gpg/ondemand/.gpgpass
build-nightly:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- bundle exec rake package:build[$OOD_PACKAGING_DIST,true]
parallel:
matrix:
- OOD_PACKAGING_DIST: [el7, el8]
OOD_PACKAGING_GPG_PRIVATE_KEY: /systems/osc_certs/gpg/ondemand/ondemand.sec
- OOD_PACKAGING_DIST: [el9, ubuntu-20.04, ubuntu-22.04]
artifacts:
paths:
- dist
name: "$CI_PROJECT_NAME-$CI_COMMIT_SHORT_SHA"
build:
stage: build
rules:
- if: $CI_COMMIT_TAG
script:
- bundle exec rake package:build[$OOD_PACKAGING_DIST]
parallel:
matrix:
- OOD_PACKAGING_DIST: [el7, el8]
OOD_PACKAGING_GPG_PRIVATE_KEY: /systems/osc_certs/gpg/ondemand/ondemand.sec
- OOD_PACKAGING_DIST: [el9, ubuntu-20.04, ubuntu-22.04]
artifacts:
paths:
- dist
name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
deploy-nightly:
stage: deploy
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- mkdir tmp
- echo "Clone ondemand-packaging branch ${OOD_PACKAGING_RELEASE}"
- git clone --single-branch --branch $OOD_PACKAGING_RELEASE https://github.com/OSC/ondemand-packaging.git tmp/ondemand-packaging
- ./tmp/ondemand-packaging/release.py --debug --pkey /systems/osc_certs/ssh/ondemand-packaging/id_rsa -c nightly ./dist/*
deploy-build:
stage: deploy
rules:
- if: $CI_COMMIT_TAG
script:
- mkdir tmp
- echo "Clone ondemand-packaging branch ${OOD_PACKAGING_RELEASE}"
- git clone --single-branch --branch $OOD_PACKAGING_RELEASE https://github.com/OSC/ondemand-packaging.git tmp/ondemand-packaging
- ./tmp/ondemand-packaging/release.py --debug --pkey /systems/osc_certs/ssh/ondemand-packaging/id_rsa -c build -r $CI_COMMIT_TAG ./dist/*
deploy:
stage: deploy
rules:
- if: $CI_COMMIT_TAG
script:
- mkdir tmp
- echo "Clone ondemand-packaging branch ${OOD_PACKAGING_RELEASE}"
- git clone --single-branch --branch $OOD_PACKAGING_RELEASE https://github.com/OSC/ondemand-packaging.git tmp/ondemand-packaging
- ./tmp/ondemand-packaging/release.py --debug --pkey /systems/osc_certs/ssh/ondemand-packaging/id_rsa -c main ./dist/*