build-debian-package.yml 1009 Bytes
Newer Older
1
2
3
4
5
6
7
---
variables:
  PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}"


build-debian:
  stage: build-debian-package
8
  image: logilab/infra/dockerfiles/buildpackage
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  rules:
    - if: '$CI_MERGE_REQUEST_ID'
      when: never
    - if: '$CI_COMMIT_TAG'
      when: on_success
    - when: manual
  script:
    - buildpackage -d `pwd`
    - cp -r /repo .
  artifacts:
    paths:
      - repo

upload-deb-to-heptapod:
  stage: upload-deb-to-heptapod
  image: curlimages/curl:latest
25
26
  # May be failling if the deb name is not ${CI_PROJECT_NAME}_${CI_COMMIT_TAG}-1_all.deb
  allow_failure: true
27
28
29
30
31
32
33
34
35
36
  rules:
    - if: '$CI_MERGE_REQUEST_ID'
      when: never
    - if: '$CI_COMMIT_TAG'
      when: on_success
  script:
    - |
      curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}"\
           --upload-file "repo/${CI_PROJECT_NAME}_${CI_COMMIT_TAG}-1_all.deb"\
                         "${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}_${CI_COMMIT_TAG}-1_all.deb"