-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
125 lines (112 loc) · 3.81 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
115
116
117
118
119
120
121
122
123
124
125
stages:
- pre_test
- test
- deploy
lint:
image: frolvlad/alpine-python2
stage: pre_test
before_script:
- apk update && apk add make
- pip install flake8
script:
- make lint
test_26:
image: cern/slc6-base
stage: test
before_script:
- yum update -y
- yum install -y python2-devel python-setuptools python-requests python-requests-kerberos python-six pytest libxml2-devel python-lxml gcc make python-argparse
- bash -c "base64 -d <(echo \"$KRB_KEYTAB_CONTENTS\") > $KRB_USERNAME.keytab"
- kinit -k -t $KRB_USERNAME.keytab [email protected]
script:
- python -m pytest
- python setup.py install
- ./test_get_cookie.sh
test_27:
image: frolvlad/alpine-python2
stage: test
before_script:
# Authenticate using the keytab:
- apk update && apk add make krb5 bash krb5-conf krb5-libs krb5-dev gcc python2-dev musl-dev libxml2-dev py-lxml
- cp krb5.conf /etc/krb5.conf
- bash -c "base64 -d <(echo \"$KRB_KEYTAB_CONTENTS\") > $KRB_USERNAME.keytab"
- kinit -k -t $KRB_USERNAME.keytab [email protected]
script:
- pip install -r requirements.txt
- pip install -r ci-deps.txt
- pytest
- python setup.py install
- ./test_get_cookie.sh
test_3:
stage: test
image: frolvlad/alpine-python3
before_script:
- apk update && apk add make krb5 bash krb5-conf krb5-libs krb5-dev gcc python3-dev musl-dev libxml2-dev py-lxml
- cp krb5.conf /etc/krb5.conf
# Authenticate using the keytab:
- bash -c "base64 -d <(echo \"$KRB_KEYTAB_CONTENTS\") > $KRB_USERNAME.keytab"
- kinit -k -t $KRB_USERNAME.keytab [email protected]
script:
- pip3 install -r requirements.txt
- pip3 install -r ci-deps.txt
- pytest
- python3 setup.py install
- ./test_get_cookie.sh
deploy:
stage: deploy
image: gitlab-registry.cern.ch/ci-tools/ci-worker:cc7
only:
- tags
before_script:
- bash -c "base64 -d <(echo \"$KRB_KOJI_KEYTAB\") > $KRB_KOJI_USERNAME.keytab"
- ls -al
- yum install -y koji
script:
- >
koji --keytab=$KRB_KOJI_USERNAME.keytab
--authtype=kerberos
--server=http://koji.cern.ch/kojihub
--weburl=http://koji.cern.ch/koji
--topurl=http://koji.cern.ch/kojifiles
build db7 --wait git+ssh://[email protected]:7999/$CI_PROJECT_PATH\#$CI_BUILD_TAG
- >
koji --keytab=$KRB_KOJI_USERNAME.keytab
--authtype=kerberos
--server=http://koji.cern.ch/kojihub
--weburl=http://koji.cern.ch/koji
--topurl=http://koji.cern.ch/kojifiles
build db6 --wait git+ssh://[email protected]:7999/$CI_PROJECT_PATH\#$CI_BUILD_TAG
# - make build
# rpm:
# image: ubuntu:latest
# stage: build
# only:
# - tags
# artifacts:
# paths:
# - dist/*.rpm
# name: "dist-$CI_BUILD_REF_NAME"
# script:
# - apt-get update && apt-get install -y rpm libxslt-dev libxml2-dev python-pip libkrb5-dev
# - pip install -r requirements.txt
# - python setup.py bdist --format=rpm
# install_rpm:
# stage: deploy
# image: cern/cc7-base
# only:
# - tags
# before_script:
# - yum -y update
# - yum install -y krb5-workstation krb5-libs
# # Decode the base64-encoded keytab and store it in dbstoragemon.keytab.
# - base64 --decode <(echo "$KRB_KEYTAB_CONTENTS") > $KRB_USERNAME.keytab
# # Authenticate using the keytab:
# - yum install python-requests-kerberos python-requests python2-future
# - kinit [email protected] -k -t $KRB_USERNAME.keytab
# script:
# - rpm -i dist/python-cern-sso-$CI_BUILD_REF_NAME-1.noarch.rpm
# - cern-get-sso-cookie.py --help
# - cern-get-sso-cookie.py --kerberos --verbose --url https://dbnas-storage-docs.web.cern.ch
# - grep -q "dbnas-storage-docs.web.cern.ch" cookies.txt