From 949628772f612c03ec5d00a31d47a60ebaadf961 Mon Sep 17 00:00:00 2001 From: Christian Bayle Date: Sat, 2 Jun 2018 01:54:40 +0200 Subject: [PATCH] build pages with packages --- .gitlab-ci.yml | 87 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab15d90f2..382a1167d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,27 +1,72 @@ -stages: - - build - -build-debian: +.build_job: &job_build stage: build - image: debian:stretch - script: | - echo "Installing build dependencies..." - apt-get update - apt-get install -y build-essential - apt-get build-dep -y . + script: + - apt-get update && apt-get -y dist-upgrade + - ci-build-pkg + artifacts: + expire_in: 1 day + paths: + - result/* - echo "Converting to native package..." - suffix="~$CI_COMMIT_SHA" - sed -i "1{s/-1) /$suffix) /}" debian/changelog - sed -i 's/3.0 (quilt)/3.0 (native)/' debian/source/format +stages: +- build +- sign +- deploy - echo "Building LemonLDAP..." - dpkg-buildpackage +before_script: + - env | grep ^CI_ + # Converting to native package... + - sed -i "1{s/-1) /$suffix) /}" debian/changelog + - sed -i 's/3.0 (quilt)/3.0 (native)/' debian/source/format - echo "Moving artifacts..." - mkdir artifacts - mv ../*.tar.xz ../*.dsc ../*.changes ../*.deb artifacts +build_stretch: + image: buildpkg/debian:stretch + <<: *job_build + +#build_xenial: +# image: buildpkg/ubuntu:xenial +# <<: *job_build + +build_bionic: + image: buildpkg/ubuntu:bionic + <<: *job_build + +sign: + image: buildpkg/debian:stretch + stage: sign +# variables: +# SIGN_USER: firstname.lastname@orange.com +# GPG_PRIVATE_KEY: + script: + - cd $CI_PROJECT_DIR + - ci-sign-pkg + dependencies: + - build_stretch +# - build_xenial + - build_bionic + artifacts: + expire_in: 1 day + paths: + - result/* + +pages: + image: buildpkg/debian:stretch + stage: deploy + variables: + DEPLOY_DOMAIN: ow2.io + environment: + name: PPA + url: http://${CI_PROJECT_NAMESPACE}.${DEPLOY_DOMAIN}/${CI_PROJECT_NAME} + script: + - cd $CI_PROJECT_DIR + - ci-pages-ppa + - ci-pages-home + - ci-pages-tree + dependencies: + - sign artifacts: paths: - - 'artifacts/*' - expire_in: 1 week + - public + only: + - master +