File: .gitlab-ci.yml

package info (click to toggle)
python-cron-descriptor 1.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 520 kB
  • sloc: python: 1,222; sh: 14; makefile: 7
file content (108 lines) | stat: -rw-r--r-- 2,769 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
stages:
  - test
  - package
  - packagetest
  - deploy

test:debian:
  stage: test
  script:
    - apt-get update -qy
    - apt-get install python3-setuptools ca-certificates python3-pip python3-mock -qy
    - python3 setup.py test
  tags:
    - debian

test:archlinux:
  stage: test
  script:
    - pacman -Syu python-setuptools python-pip --noconfirm
    - python setup.py test
  tags:
    - archlinux

package:debian:
  stage: package
  script:
    - apt-get update -qy
    - apt-get install -y python3-stdeb dh-python
    - 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 --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-get update -qy
    - cd deb_dist
    - apt install ./*.deb -qy
  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-get update -y && apt-get install openssh-client -y )'
    - apt-get update -y
    - apt-get install twine python3-setuptools python3-wheel -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-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 setup.py sdist bdist_wheel
    - twine upload dist/*
  dependencies:
    - package:archlinux
    - package:debian
  tags:
    - debian
  only:
    - tags