Skip to content
Snippets Groups Projects
Commit d378c486 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'f-trigger' into 'dev'

Use "trigger" keyword for pipeline

See merge request !7
parents c4b43e99 55bfa88e
No related branches found
No related tags found
1 merge request!7Use "trigger" keyword for pipeline
Pipeline #25604 failed
#
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2021 Indiscale GmbH <info@indiscale.com>
# Copyright (C) 2021 Daniel Hornung <d.hornung@indiscale.com>
# Copyright (C) 2021-2022 Indiscale GmbH <info@indiscale.com>
# Copyright (C) 2021-2022 Daniel Hornung <d.hornung@indiscale.com>
# Copyright (C) 2021 Timm Fitschen <d.hornung@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify
......@@ -23,14 +23,16 @@ variables:
# this is the image where cpplib repo is present (artifact from pipeline in
# caosdb-cpplib)
CPPLIB_REGISTRY_IMAGE: $CI_REGISTRY/caosdb/src/caosdb-cpplib/testenv
OCTAVE_REGISTRY_IMAGE: $CI_REGISTRY_IMAGE/testenv:$CI_COMMIT_REF_NAME
OCTAVELIB_REGISTRY_IMAGE: $CI_REGISTRY_IMAGE/testenv:$CI_COMMIT_REF_NAME
CPPLIB_BRANCH: dev
OCTAVEINTTEST_PIPELINE: https://gitlab.indiscale.com/api/v4/projects/121/trigger/pipeline
OCTAVEINTTEST_BRANCHES: https://gitlab.indiscale.com/api/v4/projects/121/repository/branches
# For storing cross-job values
DOTENV: custom.env
image: $OCTAVE_REGISTRY_IMAGE
image: $OCTAVELIB_REGISTRY_IMAGE
stages:
- setup
......@@ -50,14 +52,14 @@ build-testenv:
fi
- DOCKER_BASE_IMAGE="${CPPLIB_REGISTRY_IMAGE}:${CPPLIB_BRANCH}"
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull "$OCTAVE_REGISTRY_IMAGE" || true
- docker pull "$OCTAVELIB_REGISTRY_IMAGE" || true
- docker build
--build-arg DOCKER_BASE_IMAGE=$DOCKER_BASE_IMAGE
--file .docker/Dockerfile
--pull
--cache-from "$OCTAVE_REGISTRY_IMAGE"
--tag "$OCTAVE_REGISTRY_IMAGE" .
- docker push "$OCTAVE_REGISTRY_IMAGE"
--cache-from "$OCTAVELIB_REGISTRY_IMAGE"
--tag "$OCTAVELIB_REGISTRY_IMAGE" .
- docker push "$OCTAVELIB_REGISTRY_IMAGE"
# Formatting with miss_hit
......@@ -99,12 +101,11 @@ linting_cpp:
- make linting_cpp
allow_failure: true
# trigger the integration tests
trigger_inttest:
trigger_prepare:
# Calculate the branch name
tags: [ docker ]
stage: deploy
script:
## Determine the octaveinttest branch...
# ... sync'ed f-branch (f-bar on octavelib requires f-bar on octaveinttest)...
- if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
......@@ -122,18 +123,34 @@ trigger_inttest:
- OCTAVEINT_REF=${OCTAVEINT_REF:-dev}
- F_BRANCH=$CI_COMMIT_REF_NAME
- echo "Triggering caosdb-octaveinttest@${OCTAVEINT_REF} (F_BRANCH=$F_BRANCH)"
- curl -w "%{stderr}HTTPCODE=%{http_code}" -X POST
-F token=$CI_JOB_TOKEN
-F "variables[TRIGGERED_BY_REPO]=$TRIGGERED_BY_REPO"
-F "variables[TRIGGERED_BY_REF]=$TRIGGERED_BY_REF"
-F "variables[TRIGGERED_BY_HASH]=$TRIGGERED_BY_HASH"
-F "variables[OCTAVELIB_REGISTRY_IMAGE]=$OCTAVE_REGISTRY_IMAGE"
-F "variables[F_BRANCH]=${F_BRANCH}"
-F ref=${OCTAVEINT_REF} $OCTAVEINTTEST_PIPELINE 2>HTTPCODE
# fail if the request failed
- grep -c "HTTPCODE=2" HTTPCODE
# Write to dotenv
- echo "OCTAVEINT_REF=${OCTAVEINT_REF}" >> "$DOTENV"
- echo "F_BRANCH=${F_BRANCH}" >> "$DOTENV"
- cat "$DOTENV"
artifacts:
reports:
dotenv: "$DOTENV"
expire_in: 1 day
# trigger the integration tests
trigger_inttest:
stage: deploy
needs: [ trigger_prepare ]
inherit:
variables:
# List the variables that shall be inherited, which also means they will override any equally
# named varibles in child pipelines.
- TRIGGERED_BY_REPO
- TRIGGERED_BY_REF
- TRIGGERED_BY_HASH
- OCTAVELIB_REGISTRY_IMAGE
variables:
# dotenv variables must be set again here.
F_BRANCH: $F_BRANCH
trigger:
project: caosdb/src/caosdb-octaveinttest
branch: $OCTAVEINT_REF
strategy: depend
# Build the sphinx documentation and make it ready for deployment by Gitlab Pages
# Special job for serving a static website. See https://docs.gitlab.com/ee/ci/yaml/README.html#pages
......
......@@ -4,7 +4,7 @@ bottle==0.12.19
certifi==2021.5.30
charset-normalizer==2.0.1
colorama==0.4.4
conan==1.43.0
conan==1.48.0
deprecation==2.0.7
distro==1.5.0
docutils==0.16
......@@ -12,7 +12,7 @@ fasteners==0.16.3
future==0.18.2
idna==3.2
imagesize==1.2.0
Jinja2==2.11.3
Jinja2==3.1.1
MarkupSafe==2.0.1
miss-hit==0.9.24
miss-hit-core==0.9.24
......
......@@ -13,8 +13,8 @@ pyparsing==2.4.7
pytz==2021.1
requests==2.26.0
snowballstemmer==2.1.0
Sphinx==4.1.0
sphinx-rtd-theme==0.5.2
Sphinx==4.5.0
sphinx-rtd-theme==1.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment