.gitlab-ci.yml 2.38 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
stages:
    - build
    - deploy

build-debian-buster:
    stage: build
    image: debian:buster
    artifacts:
        expire_in: 1d
        paths:
            - build-buster
    script:
        - apt-get update && apt-get upgrade -y
        - apt-get install -y debhelper git curl apt-utils locales
        - mkdir build-buster
Olav Kvittem's avatar
Olav Kvittem committed
16 17
        - echo "Building for MP-UNINETT"
        - ./build.sh mp-uninett
18 19 20 21
        - cp *.deb build-buster

        - echo "Building for MP-DRAGONLAB"
        - ./build.sh mp-dragonlab
22 23
        - cp *.deb build-buster

Runar Borge's avatar
Runar Borge committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
build-debian-stretch:
    stage: build
    image: debian:stretch
    artifacts:
        expire_in: 1d
        paths:
            - build-stretch
    script:
        - apt-get update && apt-get upgrade -y
        - apt-get install -y debhelper git curl apt-utils locales
        - mkdir build-stretch
        - echo "Building for MP-UNINETT"
        - ./build.sh mp-uninett
        - cp *.deb build-stretch

        - echo "Building for MP-DRAGONLAB"
        - ./build.sh mp-dragonlab
        - cp *.deb build-stretch

43 44 45 46 47 48 49 50 51
build-ubuntu-focal:
    stage: build
    image: ubuntu:focal
    artifacts:
        expire_in: 1d
        paths:
            - build-focal
    script:
        - apt-get update && apt-get upgrade -y
52
        - DEBIAN_FRONTEND=noninteractive apt-get install -y debhelper git curl apt-utils locales
53 54 55 56 57 58 59 60 61
        - mkdir build-focal
        - echo "Building for MP-UNINETT"
        - ./build.sh mp-uninett
        - cp *.deb build-focal

        - echo "Building for MP-DRAGONLAB"
        - ./build.sh mp-dragonlab
        - cp *.deb build-focal

62 63 64 65 66 67 68
deploy-apt:
    stage: deploy
    image: debian:buster
    when: manual
    artifacts:
        paths:
            - build-buster
69
            - build-focal
70 71 72 73 74 75 76 77 78 79
    script:
        - apt-get update && apt-get install openssh-client -y
        - (
          umask 077;
          mkdir -p ~/.ssh;
          echo "$SSH_PRIVKEY" > ~/.ssh/id_rsa;
          echo "$SSH_APT_HOSTKEY" > ~/.ssh/known_hosts;
          )
        - ls -l build-*/*.deb
        - scp build-buster/*.deb jenkins@apt.uninett.no:/www/apt.uninett.no/htdocs/debian/pool/buster/main/all/
Runar Borge's avatar
Runar Borge committed
80
        - scp build-stretch/*.deb jenkins@apt.uninett.no:/www/apt.uninett.no/htdocs/debian/pool/stretch/main/all/
81
        - scp build-focal/*.deb jenkins@apt.uninett.no:/www/apt.uninett.no/htdocs/ubuntu/pool/focal/main/all/
82
        - ssh jenkins@apt.uninett.no /www/apt.uninett.no/bin/mkrepo