forked from Salamek/huawei-lte-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
117 lines (108 loc) · 3.44 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
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-dicttoxml python3-requests
- python3 setup.py test
tags:
- debian
test:archlinux:
stage: test
script:
- echo "[salamek]" >> /etc/pacman.conf
- echo "Server = https://arch.salamek.cz/any" >> /etc/pacman.conf
- echo "SigLevel = Optional" >> /etc/pacman.conf
- pacman -Sy python-pytest-runner python-pytest python-pylint python-pytest-cov python-xmltodict python-dicttoxml python-requests --noconfirm
- python setup.py test
tags:
- archlinux
package:debian:
stage: package
script:
- apt-get update -qy
- apt-get install -y python-all python3-pytest-runner python3-stdeb python3-pytest python3-pylint-common python3-pytest-cov python3-xmltodict python3-dicttoxml python3-requests
- 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:
- echo "[salamek]" >> /etc/pacman.conf
- echo "Server = https://arch.salamek.cz/any" >> /etc/pacman.conf
- echo "SigLevel = Optional" >> /etc/pacman.conf
- pacman -Sy python-pip sudo openssh binutils fakeroot python-xmltodict python-dicttoxml python-requests --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:
- virtualbox-debian
dependencies:
- package:debian
only:
- tags
packagetest:archlinux:
stage: packagetest
script:
- echo "[salamek]" >> /etc/pacman.conf
- echo "Server = https://arch.salamek.cz/any" >> /etc/pacman.conf
- echo "SigLevel = Optional" >> /etc/pacman.conf
- pacman -Sy --noconfirm
- cd archlinux
- pacman -U python-huawei-lte-api*.pkg.tar.xz --noconfirm
tags:
- virtualbox-archlinux
dependencies:
- package:archlinux
only:
- tags
repoupdate:
stage: deploy
variables:
TWINE_USERNAME: Salamek
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- apt-get update -y
- apt-get install twine python-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 [email protected] 'rm -rf /var/www/arch.salamek.cz/www/any/python-huawei-lte-api*.pkg.tar.xz'
- ssh [email protected] 'rm -rf /var/www/apt.salamek.cz/cache/python3-huawei-lte-api*.deb'
- scp archlinux/python-huawei-lte-api*.pkg.tar.xz [email protected]:/var/www/arch.salamek.cz/www/any
- scp deb_dist/*.deb [email protected]:/var/www/apt.salamek.cz/cache
- ssh [email protected] '/var/www/arch.salamek.cz/update_repo.sh'
- ssh [email protected] '/var/www/apt.salamek.cz/update_repo.sh'
- python3 setup.py sdist
- twine upload dist/*
dependencies:
- package:archlinux
- package:debian
tags:
- debian
only:
- tags