-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.gitlab-ci.yml
60 lines (57 loc) · 2.23 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
stages:
- deploy
- deploy-to-aur
deploy-to-github:
stage: deploy
image: iffregistry.fz-juelich.de/docker-images/gr-build-images/deploy
variables:
GIT_STRATEGY: none
only:
- master@Scientific-IT-Systems/administration/gitlab-registry-usage
- develop@Scientific-IT-Systems/administration/gitlab-registry-usage
- tags@Scientific-IT-Systems/administration/gitlab-registry-usage
script:
- mkdir --mode=700 ~/.ssh/
- (umask 0377 && echo "${GITHUB_DEPLOY_KEY}" > ~/.ssh/id_rsa
&& echo "github.com ${GITHUB_HOST_KEY}" >> ~/.ssh/known_hosts)
- git clone --mirror "${CI_REPOSITORY_URL}" "${CI_PROJECT_NAME}_mirror"
- cd "${CI_PROJECT_NAME}_mirror";
git push --mirror "[email protected]:sciapp/${CI_PROJECT_NAME}.git";
cd ..
deploy-to-pypi:
stage: deploy
image: python:3-slim
only:
- tags@Scientific-IT-Systems/administration/gitlab-registry-usage
script:
- pip install twine
- echo "[distutils]" > ~/.pypirc;
echo "index-servers =" >> ~/.pypirc;
echo " pypi" >> ~/.pypirc;
echo "[pypi]" >> ~/.pypirc;
echo "username = __token__" >> ~/.pypirc;
echo "password = ${PYPI_DEPLOY_KEY}" >> ~/.pypirc;
- python setup.py sdist
- python setup.py bdist_wheel
- twine upload dist/*
deploy-to-aur:
stage: deploy-to-aur
image: iffregistry.fz-juelich.de/docker-images/gr-build-images/$CI_JOB_NAME
only:
- tags@Scientific-IT-Systems/administration/gitlab-registry-usage
script:
- mkdir --mode=700 ~/.ssh/
- (umask 0377 && echo "$AUR_PRIVATE_KEY" > ~/.ssh/id_rsa
&& echo "aur.archlinux.org $AUR_HOST_KEY" >> ~/.ssh/known_hosts)
- git clone "ssh://[email protected]/python-gitlab-registry-usage.git" "python-gitlab-registry-usage-aur"
- cd "python-gitlab-registry-usage-aur"
- sed -i -e "/^pkgver=/c\pkgver=\"${CI_COMMIT_TAG#v}\"" -e "/^pkgrel=/c\pkgrel=\"1\"" PKGBUILD
- (
source PKGBUILD;
curl -o source -L "${source[0]}";
SHA256SUM="$(sha256sum source | awk '{ print $1 }')";
sed -i "/^sha256sums=/c\sha256sums=(\"${SHA256SUM}\")" PKGBUILD;
)
- makepkg --printsrcinfo > .SRCINFO
- git commit -a -m "Update to version ${CI_COMMIT_TAG#v}"
- git push