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

build-debian-stretch:
  cache: {}
  stage: build
  image: debian:stretch
  artifacts:
    expire_in: 1h
    paths:
      - build-stretch
  script:
    - apt-get update
15 16 17 18 19
    - apt-get install
        -q -y --no-install-recommends
        -o Dpkg::Options::="--force-confdef"
        -o Dpkg::Options::="--force-confold"
         build-essential autoconf ruby ruby-dev libpcap-dev
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    - gem install fpm
    - autoheader autoconf/configure.in
    - autoconf autoconf/configure.in > configure
    - chmod 755 configure
    - ./configure --enable-wall --with-debug-lvl=3 --prefix=/usr
    - make deb
    - rm -rf build-stretch
    - mkdir build-stretch
    - mv -v rude/rude*.deb crude/crude*.deb build-stretch/

deploy-apt:
  stage: deploy
  image: debian:stretch
  artifacts:
    paths:
      - build-stretch
  script:
37
    - apt-get update && apt-get install openssh-client -y
38 39 40 41 42 43
    - (
        umask 077;
        mkdir -p ~/.ssh;
        echo "${SSH_PRIVKEY}" > ~/.ssh/id_rsa;
        echo "${SSH_APT_HOSTKEY}" > ~/.ssh/known_hosts;
      )
44 45 46 47
    - ssh jenkins@apt.uninett.no
        mkdir -p
          /www/apt.uninett.no/htdocs/debian/pool/stretch/main/binary-amd64/r/rude
          /www/apt.uninett.no/htdocs/debian/pool/stretch/main/binary-amd64/c/crude
48 49 50
    - scp build-stretch/rude*.deb jenkins@apt.uninett.no:/www/apt.uninett.no/htdocs/debian/pool/stretch/main/binary-amd64/r/rude/
    - scp build-stretch/crude*.deb jenkins@apt.uninett.no:/www/apt.uninett.no/htdocs/debian/pool/stretch/main/binary-amd64/c/crude/
    - ssh jenkins@apt.uninett.no /www/apt.uninett.no/bin/mkrepo.debian