Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-julialib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-julialib
Commits
73fd9e02
Commit
73fd9e02
authored
2 years ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: Switching CI pipeline triggering to the "trigger" keyword.
parent
4f9a1222
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!14
Use "trigger" keyword for pipeline.
Pipeline
#24372
passed
2 years ago
Stage: info
Stage: code-style
Stage: setup
Stage: test
Stage: deploy
Pipeline: CaosDB Julia Integration Tests
#24373
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+39
-18
39 additions, 18 deletions
.gitlab-ci.yml
with
39 additions
and
18 deletions
.gitlab-ci.yml
+
39
−
18
View file @
73fd9e02
...
...
@@ -16,7 +16,7 @@
variables
:
JULIALIB_REGISTRY_IMAGE
:
$CI_REGISTRY/caosdb/src/caosdb-julialib/testenv:$CI_COMMIT_REF_NAME
JULIAINTTEST_PIPELINE
:
https://gitlab.indiscale.com/api/v4/projects/120/trigger/pipeline
#
JULIAINTTEST_PIPELINE: https://gitlab.indiscale.com/api/v4/projects/120/trigger/pipeline
JULIAINTTEST_BRANCHES
:
https://gitlab.indiscale.com/api/v4/projects/120/repository/branches
GIT_SUBMODULE_STRATEGY
:
normal
...
...
@@ -25,9 +25,11 @@ variables:
TRIGGERED_BY_HASH
:
$CI_COMMIT_SHORT_SHA
# The defalt branch to use with caosdb-cpplib
# TODO: Change back to dev once f-consolidate-c has been merged.
CPP_DEFAULT_BRANCH
:
dev
# For storing cross-job values
DOTENV
:
custom.env
image
:
$JULIALIB_REGISTRY_IMAGE
stages
:
...
...
@@ -153,13 +155,14 @@ test_pages:
refs
:
-
main
#
trigger
the integration tests
trigger_inttest
:
trigger
_prepare
:
# Calculate the branch name
tags
:
[
docker
]
stage
:
deploy
script
:
## Determine the juliainttest branch...
# ... use an f-branch if posible...
-
F_BRANCH=dev
-
if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
if curl -o /dev/null -s -w "%{http_code}" $JULIAINTTEST_BRANCHES/$CI_COMMIT_REF_NAME | grep "404"; then
JULIAINT_REF=dev ;
...
...
@@ -175,22 +178,40 @@ trigger_inttest:
-
JULIAINT_REF=${JULIAINT_REF:-dev}
-
F_BRANCH=$CI_COMMIT_REF_NAME
-
echo "Triggering caosdb-juliainttest@${JULIAINT_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[JULIALIB_REGISTRY_IMAGE]=$JULIALIB_REGISTRY_IMAGE"
-F "variables[CPPLIB_REF]=${CPP_DEFAULT_BRANCH}"
-F "variables[F_BRANCH]=${F_BRANCH}"
-F ref=${JULIAINT_REF} $JULIAINTTEST_PIPELINE 2>HTTPCODE
# fail if the request failed
-
grep -c "HTTPCODE=2" HTTPCODE
# Write to dotenv
-
echo "JULIAINT_REF=${JULIAINT_REF}" >> "$DOTENV"
-
echo "F_BRANCH=${F_BRANCH}" >> "$DOTENV"
-
echo "CPPLIB_REF={$CPP_DEFAULT_BRANCH}"
-
cat "$DOTENV"
artifacts
:
reports
:
dotenv
:
"
$DOTENV"
expire_in
:
1 day
# WARNING: This template is using the `julia` images from [Docker
# 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
-
JULIALIB_REGISTRY_IMAGE
variables
:
# dotenv variables must be set again here.
F_BRANCH
:
$F_BRANCH
CPPLIB_REF
:
$CPPLIB_REF
trigger
:
project
:
caosdb/src/caosdb-juliainttest
branch
:
$JULIAINT_REF
strategy
:
depend
# WARNING: This template uses the `julia` images from [Docker
# Hub][3]. One can use custom Julia images and/or the official ones
# found in the same place. However, care must be taken to correctly
# locate the binary file (`/opt/julia/bin/julia` above), which is
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment