.gitlab-ci.yml 2.91 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# Defines stages each corresponding to a separate hamara-package

stages:
  - calamares-settings-hamara
  - grub-theme-hamara
  - hamara-keyring-2016.5
  - hamara-live
  - hamara-sugam-config
  - hamara-wallpapers
  - hamara-welcome
  - lightdm-webkit-greeter
  - lightdm-webkit-greeter-hamara
  - materia-gtk-theme
  - paper-icon-theme
  - plymouth-theme-hamara
  - source-sans-pro
Shivani Bhardwaj's avatar
Shivani Bhardwaj committed
17
  - trigger-watchdog
18 19 20 21 22 23 24 25

# These steps will run before each build.
# They are included here to avoid repetition of same code on later stages.
# similar to a macro

before_script:
  - export DEBIAN_FRONTEND=noninteractive
  - echo "Preparing the container for builds"
Shivani Bhardwaj's avatar
Shivani Bhardwaj committed
26 27 28 29
  - sudo apt update
  - sudo apt-get -y upgrade
  - sudo apt-get -y dist-upgrade
  - sudo apt-get -y install apt-utils figlet dpkg-dev fakeroot git-buildpackage lintian pristine-tar
30 31 32 33 34 35 36 37 38
  - figlet BUILD

.build_template: &build_definition
  allow_failure: true
  dependencies: []

  script:
    - cd packages/$CI_JOB_STAGE
    - export BUILD_DEPENDS=`perl -ne 'next if /^#/; $p=(s/^Build-Depends:\s*/ / or (/^ / and $p)); s/,|\n|\([^)]+\)//mg; print if $p' < debian/control`
Shivani Bhardwaj's avatar
Shivani Bhardwaj committed
39 40 41
    - sudo apt-get install -y --no-install-recommends $BUILD_DEPENDS
    - sudo apt-get -y autoremove --purge
    - sudo apt-get clean
Shivani Bhardwaj's avatar
Shivani Bhardwaj committed
42
    - sudo rm -rf /var/lib/apt/lists/*
43 44 45
    - dpkg-buildpackage -us -uc
    #copy the contents of the package to the incoming directory
    - echo "Deploying packages to repositories"
46 47
    - mkdir $CI_JOB_STAGE
    - cp -r ../*.deb ../*.dsc ../*.changes ../*.tar.* ../*.buildinfo $CI_JOB_STAGE
Shivani Bhardwaj's avatar
Shivani Bhardwaj committed
48
    - scp -r ./$CI_JOB_STAGE root@aptly:/opt/custom_packages/
49 50 51 52 53 54 55

  artifacts:
    paths:
        - packages/*.deb
        - packages/*.dsc
        - packages/*.buildinfo
        - packages/*.changes
56
        - packages/*.tar.*
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
    expire_in: 1 day

build-calamares-settings-hamara:
  stage: calamares-settings-hamara
  <<: *build_definition

build-grub-theme-hamara:
  stage: grub-theme-hamara
  <<: *build_definition

build-hamara-keyring-2016.5:
  stage: hamara-keyring-2016.5
  <<: *build_definition

build-hamara-live:
  stage: hamara-live
  <<: *build_definition

build-hamara-sugam-config:
  stage: hamara-sugam-config
  <<: *build_definition

build-hamara-wallpapers:
  stage: hamara-wallpapers
  <<: *build_definition

build-hamara-welcome:
  stage: hamara-welcome
  <<: *build_definition

build-lightdm-webkit-greeter:
  stage: lightdm-webkit-greeter
  <<: *build_definition

build-lightdm-webkit-greeter-hamara:
  stage: lightdm-webkit-greeter-hamara
  <<: *build_definition

build-materia-gtk-theme:
  stage: materia-gtk-theme
  <<: *build_definition

build-paper-icon-theme:
  stage: paper-icon-theme
  <<: *build_definition

build-plymouth-theme-hamara:
  stage: plymouth-theme-hamara
  <<: *build_definition

build-source-sans-pro:
  stage: source-sans-pro
  <<: *build_definition
Shivani Bhardwaj's avatar
Shivani Bhardwaj committed
110 111 112 113 114 115
  
execute-trigger-watchdog:
  stage: trigger-watchdog
  script:
  - date > .latestwatch
  - scp .latestwatch root@aptly:/opt/watchdog/watches/