-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.gitlab-ci.yml
60 lines (54 loc) · 2.07 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:
# - test
- package
- deploy
#test:debian:
# stage: test
# script:
# - apt-get update -qy
# - apt-get install -y python3-dev python3-pip tox
# - pip3 install .
# - tox -e py39
# tags:
# - debian
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-python-gitlab python3-paramiko python3-git python3-flask-celery-tools 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-cron-descriptor python3-flask-login python3-kombu rabbitmq-server
- rm -rf "./deb_dist"
- cd gitlab_tools/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
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/cache/deb/pub/all/gitlab-tools*.deb'
- 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'
dependencies:
- package:debian
tags:
- docker
only:
- tags