-
-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy path.gitlab-ci.yml
102 lines (93 loc) · 2.96 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
stages:
- test
- package
- packagetest
- deploy
test:debian:
stage: test
script:
- apt-get update -qy
- apt-get install -y python3-setuptools python3-pytest-runner python3-pytest python3-pylint-common python3-pytest-cov python3-xmltodict python3-requests tox python3-pycryptodome
- tox -e py311
tags:
- debian
test:archlinux:
stage: test
script:
- pacman -Sy python-pytest python-pylint python-pytest-cov python-xmltodict python-requests python-tox python-pycryptodomex --noconfirm
- tox -e py312
tags:
- archlinux
package:debian:
stage: package
script:
- apt-get update -qy
- apt-get install -y python3-pytest-runner python3-stdeb python3-pytest python3-pylint-common python3-pytest-cov python3-xmltodict python3-requests tox dh-python python3-pycryptodome
- rm -rf "./deb_dist"
- python3 setup.py --command-packages=stdeb.command bdist_deb
tags:
- debian
artifacts:
paths:
- deb_dist/*.deb
expire_in: 1d
package:archlinux:
stage: package
script:
- pacman -Sy python-pip sudo openssh binutils fakeroot python-xmltodict python-requests python-pycryptodomex python-setuptools base-devel --noconfirm
- useradd -m -G users -s /bin/bash package
- chown -R package:users archlinux
- cd archlinux
- sudo -H -u package makepkg -f
tags:
- archlinux
artifacts:
paths:
- archlinux/python-huawei-lte-api*
expire_in: 1d
packagetest:debian:
stage: packagetest
script:
- apt-get update -qy
- cd deb_dist
- apt install ./*.deb -qy
tags:
- debian
dependencies:
- package:debian
packagetest:archlinux:
stage: packagetest
script:
- cd archlinux
- pacman -Sy
- pacman -U python-huawei-lte-api*.pkg.tar.zst --noconfirm
tags:
- archlinux
dependencies:
- package:archlinux
repoupdate:
stage: deploy
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- apt-get update -y
- apt-get install twine python3-setuptools -y
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- ssh www-data@repository 'rm -rf /var/www/repository.salamek.cz/www/arch/pub/any/python-huawei-lte-api*.pkg.tar.zst'
- ssh www-data@repository 'rm -rf /var/www/repository.salamek.cz/cache/deb/pub/all/python3-huawei-lte-api*.deb'
- scp archlinux/python-huawei-lte-api*.pkg.tar.zst www-data@repository:/var/www/repository.salamek.cz/www/arch/pub/any
- scp deb_dist/*.deb www-data@repository:/var/www/repository.salamek.cz/cache/deb/pub/all
- ssh www-data@repository '/var/www/repository.salamek.cz/deb-pub-update.sh'
- ssh www-data@repository '/var/www/repository.salamek.cz/arch-pub-update.sh'
- python3 setup.py sdist
- twine upload dist/*
dependencies:
- package:archlinux
- package:debian
tags:
- debian
only:
- tags