Add a deploy job
This commit is contained in:
+55
-13
@@ -3,12 +3,11 @@ stages:
|
|||||||
- test # Use the build artifacts to run the tests
|
- test # Use the build artifacts to run the tests
|
||||||
- packaging # Publish some packages (rpm, deb…)
|
- packaging # Publish some packages (rpm, deb…)
|
||||||
- external # Interact with some external service (codecov, coverity…)
|
- external # Interact with some external service (codecov, coverity…)
|
||||||
|
- deploy
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- uname -a
|
- uname -a
|
||||||
- whoami
|
- whoami
|
||||||
- mkdir -p build/
|
|
||||||
- cd build/
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
COMPILER: "g++"
|
COMPILER: "g++"
|
||||||
@@ -29,6 +28,8 @@ variables:
|
|||||||
- docker
|
- docker
|
||||||
script:
|
script:
|
||||||
- "echo Running cmake with the following parameters: -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3}"
|
- "echo Running cmake with the following parameters: -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3}"
|
||||||
|
- mkdir build/
|
||||||
|
- cd build/
|
||||||
- cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3}
|
- cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3}
|
||||||
- make everything -j$(nproc || echo 1)
|
- make everything -j$(nproc || echo 1)
|
||||||
- make coverage_check -j$(nproc || echo 1)
|
- make coverage_check -j$(nproc || echo 1)
|
||||||
@@ -39,17 +40,17 @@ variables:
|
|||||||
|
|
||||||
.template:fedora_build: &fedora_build
|
.template:fedora_build: &fedora_build
|
||||||
<<: *basic_build
|
<<: *basic_build
|
||||||
image: docker.louiz.org/biboumi-test-fedora:latest
|
image: docker.louiz.org/louiz/biboumi/test-fedora:latest
|
||||||
|
|
||||||
.template:debian_build: &debian_build
|
.template:debian_build: &debian_build
|
||||||
<<: *basic_build
|
<<: *basic_build
|
||||||
image: docker.louiz.org/biboumi-test-debian:latest
|
image: docker.louiz.org/louiz/biboumi/test-debian:latest
|
||||||
|
|
||||||
.template:alpine_build: &alpine_build
|
.template:alpine_build: &alpine_build
|
||||||
variables:
|
variables:
|
||||||
SYSTEMD: "-DWITHOUT_SYSTEMD=1"
|
SYSTEMD: "-DWITHOUT_SYSTEMD=1"
|
||||||
<<: *basic_build
|
<<: *basic_build
|
||||||
image: docker.louiz.org/biboumi-test-alpine:latest
|
image: docker.louiz.org/louiz/biboumi/test-alpine:latest
|
||||||
|
|
||||||
build:fedora:
|
build:fedora:
|
||||||
<<: *fedora_build
|
<<: *fedora_build
|
||||||
@@ -109,6 +110,7 @@ build:7:
|
|||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
script:
|
script:
|
||||||
|
- cd build/
|
||||||
- make coverage_e2e -j$(nproc || echo 1)
|
- make coverage_e2e -j$(nproc || echo 1)
|
||||||
- make coverage
|
- make coverage
|
||||||
artifacts:
|
artifacts:
|
||||||
@@ -122,29 +124,30 @@ build:7:
|
|||||||
name: $CI_PROJECT_NAME-test-$CI_JOB_ID
|
name: $CI_PROJECT_NAME-test-$CI_JOB_ID
|
||||||
|
|
||||||
test:debian:
|
test:debian:
|
||||||
image: docker.louiz.org/biboumi-test-debian:latest
|
image: docker.louiz.org/louiz/biboumi/test-debian:latest
|
||||||
<<: *basic_test
|
<<: *basic_test
|
||||||
dependencies:
|
dependencies:
|
||||||
- build:debian
|
- build:debian
|
||||||
|
|
||||||
test:fedora:
|
test:fedora:
|
||||||
image: docker.louiz.org/biboumi-test-fedora:latest
|
image: docker.louiz.org/louiz/biboumi/test-fedora:latest
|
||||||
<<: *basic_test
|
<<: *basic_test
|
||||||
dependencies:
|
dependencies:
|
||||||
- build:fedora
|
- build:fedora
|
||||||
|
|
||||||
test:without_udns:
|
test:without_udns:
|
||||||
image: docker.louiz.org/biboumi-test-fedora:latest
|
image: docker.louiz.org/louiz/biboumi/test-fedora:latest
|
||||||
<<: *basic_test
|
<<: *basic_test
|
||||||
dependencies:
|
dependencies:
|
||||||
- build:7
|
- build:7
|
||||||
|
|
||||||
test:alpine:
|
test:alpine:
|
||||||
image: docker.louiz.org/biboumi-test-alpine:latest
|
image: docker.louiz.org/louiz/biboumi/test-alpine:latest
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
script:
|
script:
|
||||||
|
- cd build/
|
||||||
- make e2e
|
- make e2e
|
||||||
dependencies:
|
dependencies:
|
||||||
- build:alpine
|
- build:alpine
|
||||||
@@ -158,6 +161,8 @@ test:freebsd:
|
|||||||
SYSTEMD: "-DWITHOUT_SYSTEMD=1"
|
SYSTEMD: "-DWITHOUT_SYSTEMD=1"
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
|
- mkdir build/
|
||||||
|
- cd build/
|
||||||
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3}
|
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3}
|
||||||
- make check
|
- make check
|
||||||
- make e2e
|
- make e2e
|
||||||
@@ -170,7 +175,7 @@ test:freebsd:
|
|||||||
stage: external
|
stage: external
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
image: docker.louiz.org/biboumi-test-fedora:latest
|
image: docker.louiz.org/louiz/biboumi/test-fedora:latest
|
||||||
|
|
||||||
.template:codecov_unittests: &codecov_unittests
|
.template:codecov_unittests: &codecov_unittests
|
||||||
<<: *codecov
|
<<: *codecov
|
||||||
@@ -238,25 +243,32 @@ coverity:
|
|||||||
- branches@louiz/biboumi
|
- branches@louiz/biboumi
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
image: docker.louiz.org/biboumi-test-fedora:latest
|
image: docker.louiz.org/louiz/biboumi/test-fedora:latest
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
when: manual
|
when: manual
|
||||||
script:
|
script:
|
||||||
- export PATH=$PATH:~/coverity/bin
|
- export PATH=$PATH:~/coverity/bin
|
||||||
|
- mkdir build/
|
||||||
|
- cd build/
|
||||||
- cmake .. -DWITHOUT_SYSTEMD=1
|
- cmake .. -DWITHOUT_SYSTEMD=1
|
||||||
- cov-build --dir cov-int make everything -j$(nproc || echo 1)
|
- cov-build --dir cov-int make everything -j$(nproc || echo 1)
|
||||||
- tar czvf biboumi_coverity.tgz cov-int
|
- tar czvf biboumi_coverity.tgz cov-int
|
||||||
- curl --form token=$COVERITY_TOKEN --form email=louiz@louiz.org --form file=@biboumi_coverity.tgz --form version="$(git rev-parse --short HEAD)" --form description="Automatic submission by gitlab-ci" https://scan.coverity.com/builds?project=louiz%2Fbiboumi
|
- curl --form token=$COVERITY_TOKEN --form email=louiz@louiz.org --form file=@biboumi_coverity.tgz --form version="$(git rev-parse --short HEAD)" --form description="Automatic submission by gitlab-ci" https://scan.coverity.com/builds?project=louiz%2Fbiboumi
|
||||||
dependencies: []
|
dependencies: []
|
||||||
|
|
||||||
|
#
|
||||||
|
## Packaging jobs
|
||||||
|
#
|
||||||
|
|
||||||
packaging:rpm:
|
packaging:rpm:
|
||||||
stage: packaging
|
stage: packaging
|
||||||
only:
|
only:
|
||||||
- master@louiz/biboumi
|
- master@louiz/biboumi
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
image: docker.louiz.org/biboumi-test-fedora:latest
|
image: docker.louiz.org/louiz/biboumi/test-fedora:latest
|
||||||
script:
|
script:
|
||||||
|
- cd build/
|
||||||
- make rpm -j$(nproc || echo 1)
|
- make rpm -j$(nproc || echo 1)
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
@@ -297,7 +309,7 @@ packaging:archlinux:
|
|||||||
- master@louiz/biboumi
|
- master@louiz/biboumi
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
image: docker.louiz.org/biboumi-test-archlinux:latest
|
image: docker.louiz.org/louiz/biboumi/test-archlinux:latest
|
||||||
before_script: []
|
before_script: []
|
||||||
script:
|
script:
|
||||||
- sudo pacman -Syuu --noconfirm
|
- sudo pacman -Syuu --noconfirm
|
||||||
@@ -306,3 +318,33 @@ packaging:archlinux:
|
|||||||
- makepkg -si --noconfirm
|
- makepkg -si --noconfirm
|
||||||
- test -e /usr/bin/biboumi
|
- test -e /usr/bin/biboumi
|
||||||
dependencies: []
|
dependencies: []
|
||||||
|
|
||||||
|
#
|
||||||
|
## Deploy jobs
|
||||||
|
#
|
||||||
|
|
||||||
|
deploy:docker:
|
||||||
|
stage: deploy
|
||||||
|
tags:
|
||||||
|
- docker-in-docker
|
||||||
|
only:
|
||||||
|
- master@louiz/biboumi
|
||||||
|
variables:
|
||||||
|
DOCKER_HOST: tcp://docker.louiz.org:2376
|
||||||
|
DOCKER_TLS_VERIFY: 1
|
||||||
|
SERVICE_NAME: biboumi
|
||||||
|
BIBOUMI_HOSTNAME: test.biboumi.louiz.org
|
||||||
|
script:
|
||||||
|
- mkdir -p ~/.docker
|
||||||
|
- echo "$TLSCACERT" > ~/.docker/ca.pem
|
||||||
|
- echo "$TLSCERT" > ~/.docker/cert.pem
|
||||||
|
- echo "$TLSKEY" > ~/.docker/key.pem
|
||||||
|
- docker version
|
||||||
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN docker.louiz.org
|
||||||
|
- docker build -t docker.louiz.org/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME docker/biboumi/alpine
|
||||||
|
- docker push docker.louiz.org/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME
|
||||||
|
- docker service create --with-registry-auth --detach=false --name $CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME -e BIBOUMI_PASSWORD=password -e BIBOUMI_XMPP_SERVER_IP=prosody -e BIBOUMI_HOSTNAME=$BIBOUMI_HOSTNAME --network xmpp docker.louiz.org/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME || docker service update $CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME
|
||||||
|
environment:
|
||||||
|
name: master
|
||||||
|
url: https://biboumi.louiz.org
|
||||||
|
dependencies: []
|
||||||
|
|||||||
Reference in New Issue
Block a user