File: .gitlab-ci.yml

package info (click to toggle)
python-cron-descriptor 2.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 756 kB
  • sloc: python: 1,641; makefile: 7; sh: 4
file content (116 lines) | stat: -rw-r--r-- 3,066 bytes parent folder | download
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
stages:
  - test
  - package
  - packagetest
  - deploy

test:debian:
  stage: test
  script:
    - apt update --yes
    - apt install ca-certificates python3-venv --yes
    - python3 -m venv venv
    - ./venv/bin/pip install mock ruff setuptools mypy pytest polib types-polib
    - ./venv/bin/ruff check .
    - ./venv/bin/mypy .
    - ./venv/bin/pytest .
  tags:
    - debian

test:archlinux:
  stage: test
  script:
    - pacman -Syu python-pip --noconfirm
    - python -m venv venv
    - ./venv/bin/pip install mock ruff setuptools mypy pytest polib types-polib
    - ./venv/bin/ruff check .
    - ./venv/bin/mypy .
    - ./venv/bin/pytest .
  tags:
    - archlinux

package:debian:
  stage: package
  script:
    - apt update --yes
    - apt install python3-stdeb dh-python --yes
    - rm -rf "./deb_dist"
    - 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:
    - pacman -Syu sudo fakeroot systemd binutils python-setuptools base-devel python-build python-installer --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-cron-descriptor*
    expire_in: 1d

packagetest:debian:
  stage: packagetest
  script:
    - apt update --yes
    - cd deb_dist
    - apt install ./*.deb --yes
  tags:
    - debian
  dependencies:
    - package:debian


packagetest:archlinux:
  stage: packagetest
  script:
    - pacman -Sy
    - cd archlinux
    - pacman -U python-cron-descriptor*.pkg.tar.zst --noconfirm
  tags:
    - archlinux
  dependencies:
    - package:archlinux

repoupdate:
  stage: deploy
  before_script:
    # SSH
    - 'which ssh-agent || ( apt update --yes && apt install openssh-client --yes )'
    - apt update --yes
    - apt install twine python3-setuptools python3-wheel python3-build python3-venv --yes
    - 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-cron-descriptor*.pkg.tar.zst'
    - ssh www-data@repository 'rm -rf /var/www/repository.salamek.cz/cache/deb/pub/all/python3-cron-descriptor*.deb'
    - scp archlinux/python-cron-descriptor*.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'
  
    # PyPi update
    - python3 -m build
    - twine upload dist/*
  dependencies:
    - package:archlinux
    - package:debian
  tags:
    - debian
  only:
    - tags