-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path.gitlab-ci.yml
92 lines (84 loc) · 3.61 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
stages:
- test
- package
- deploy
test:debian:
stage: test
script:
- apt-get update -qy
- apt-get install -y python3-dev python3-pip
- pip3 install .
- python3 setup.py test
tags:
- debian
#test:archlinux:
# stage: test
# script:
# - pacman -Sy python-pip python-setuptools --noconfirm
# - pip install .
# - python setup.py test
# tags:
# - archlinux
package:debian:
stage: package
script:
- apt-get update -qy
- apt-get install -y curl gnupg apt-transport-https wget
- wget -O- https://repository.salamek.cz/deb/salamek.gpg | tee /usr/share/keyrings/salamek-archive-keyring.gpg
- echo "deb [signed-by=/usr/share/keyrings/salamek-archive-keyring.gpg] https://repository.salamek.cz/deb/pub all main" | tee /etc/apt/sources.list.d/salamek.cz.list
- apt-get update -qy
- apt-get install -y nodejs dh-python npm python3-dnspython python3-pygal python3-flask-script python3-flask-redis-helper xvfb wkhtmltopdf python3-tabula-py python3-pillow python3-pypdf2 python3-lxml python3-flask-celery-tools python3-flask-caching python3-dev redis-server python3-pip python3-stdeb python3-celery nodejs git python3-markupsafe python3-psycopg2 python3-dateutil python3-docopt python3-yaml python3-wtforms python3-raven python3-flask-migrate python3-flask-babel python3-flask-navigation python3-flask-login
- rm -rf "./deb_dist"
- cd blacklist/static
- npm install
- cd -
- export DEB_BUILD_OPTIONS=nocheck
- 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://repository.salamek.cz/arch/pub/any" >> /etc/pacman.conf
# - echo "SigLevel = Optional" >> /etc/pacman.conf
# - pacman -Sy python-pip python-dnspython python-pygal python-flask-script gcc nodejs wkhtmltopdf xorg-server-xvfb python-tabula python-lxml sudo git redis openssh python-flask-caching postgresql python-flask-celery-tools python-flask-redis-helper python-celery python-flask python-babel python-yaml python-flask-login python-flask-migrate python-flask-wtf python-raven python-docopt python-eventlet python-psycopg2 python-flask-babel python-flask-navigation fakeroot systemd python-pypdf2 --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/blacklist*.pkg.tar.zst
# expire_in: 1d
repoupdate:
stage: deploy
variables:
GIT_STRATEGY: none
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -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/blacklist*.pkg.tar.zst'
- ssh www-data@repository 'rm -rf /var/www/repository.salamek.cz/cache/deb/pub/all/blacklist*.deb'
#- scp archlinux/blacklist*.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'
dependencies:
#- package:archlinux
- package:debian
tags:
- docker
only:
- tags