Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PanGeTools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexis Mergez
PanGeTools
Commits
82ad87c9
Commit
82ad87c9
authored
1 year ago
by
Alexis Mergez
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml
Don't build if no changes Only stable runners
parent
7c754b2e
No related branches found
No related tags found
No related merge requests found
Pipeline
#172129
failed
1 year ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+61
-31
61 additions, 31 deletions
.gitlab-ci.yml
with
61 additions
and
31 deletions
.gitlab-ci.yml
+
61
−
31
View file @
82ad87c9
...
...
@@ -9,52 +9,82 @@ release_job:
tag_name
:
'
$CI_COMMIT_TAG'
description
:
'
$CI_COMMIT_TAG'
build-and-push pangetool
s
:
stage
:
build
im
ag
e
:
name
:
kaczmarj/apptainer:latest
entrypoint
:
[
"
"
]
test_for_change
s
:
stage
:
.pre
t
ag
s
:
-
stable
# Using Stable runners as test runners don't work properly
image
:
ubuntu:latest
rules
:
-
if
:
$CI_COMMIT_TAG
changes
:
-
PanGeTools.def
allow_failure
:
true
-
if
:
$CI_COMMIT_TAG
script
:
-
sed -i "s/VERSION_NUMBER/${CI_COMMIT_TAG#v}/" PanGeTools.def
-
apptainer build PanGeTools.sif PanGeTools.def
-
apptainer push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" PanGeTools.sif oras://"$CI_REGISTRY_IMAGE"/"$CI_PROJECT_NAME":"$CI_COMMIT_TAG"
-
apptainer push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" PanGeTools.sif oras://"$CI_REGISTRY_IMAGE"/"$CI_PROJECT_NAME":latest
-
apt update -y && apt install -y git
# Getting current and previous tags
-
curTag=$(git describe --abbrev=0 --tags)
-
prevTag=$(git describe --abbrev=0 --tags HEAD^)
build-and-push pytools
:
# Check block for PanGeTools.def
-
curMd5=$(git show ${curTag}:PanGeTools.def | md5sum | cut -d' ' -f1)
-
prevMd5=$(git show ${prevTag}:PanGeTools.def | md5sum | cut -d' ' -f1)
-
if [ $curMd5 != $prevMd5 ]; then
RUN_PanGeTools="1";
else
RUN_PanGeTools="0";
fi
# Check block for panache.def
-
curMd5=$(git show ${curTag}:panache.def | md5sum | cut -d' ' -f1)
-
prevMd5=$(git show ${prevTag}:panache.def | md5sum | cut -d' ' -f1)
-
if [ $curMd5 != $prevMd5 ]; then
RUN_panache="1";
else
RUN_panache="0";
fi
-
echo "RUN_PanGeTools=$RUN_PanGeTools" >> build.env
-
echo "RUN_panache=$RUN_panache" >> build.env
artifacts
:
reports
:
dotenv
:
build.env
build:PanGeTools
:
stage
:
build
tags
:
-
stable
# Using Stable runners as test runners don't work properly
needs
:
-
job
:
"
test_for_changes"
artifacts
:
true
image
:
name
:
kaczmarj/apptainer:latest
entrypoint
:
[
"
"
]
rules
:
-
if
:
$CI_COMMIT_TAG
changes
:
-
PyTools.def
allow_failure
:
true
-
if
:
$CI_COMMIT_TAG
# Run this job when a tag is created
script
:
-
sed -i "s/VERSION_NUMBER/${CI_COMMIT_TAG#v}/" PyTools.def
-
apptainer build PyTools.sif PyTools.def
-
apptainer push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" PyTools.sif oras://"$CI_REGISTRY_IMAGE"/pytools:"$CI_COMMIT_TAG"
-
apptainer push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" PyTools.sif oras://"$CI_REGISTRY_IMAGE"/pytools:latest
-
if [ $RUN_PanGeTools == "1" ]; then
sed -i "s/VERSION_NUMBER/${CI_COMMIT_TAG#v}/" PanGeTools.def;
apptainer build PanGeTools.sif PanGeTools.def;
apptainer push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" PanGeTools.sif oras://"$CI_REGISTRY_IMAGE"/pangetools:"$CI_COMMIT_TAG";
apptainer push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" PanGeTools.sif oras://"$CI_REGISTRY_IMAGE"/pangetools:latest;
fi
build
-and-push
panache
:
build
:
panache
:
stage
:
build
tags
:
-
stable
# Using Stable runners as test runners don't work properly
needs
:
-
job
:
"
test_for_changes"
artifacts
:
true
image
:
name
:
kaczmarj/apptainer:latest
entrypoint
:
[
"
"
]
rules
:
-
if
:
$CI_COMMIT_TAG
changes
:
-
Panache.def
allow_failure
:
true
-
if
:
$CI_COMMIT_TAG
# Run this job when a tag is created
script
:
-
sed -i "s/VERSION_NUMBER/${CI_COMMIT_TAG#v}/" Panache.def
-
apptainer build Panache.sif Panache.def
-
apptainer push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" Panache.sif oras://"$CI_REGISTRY_IMAGE"/panache:"$CI_COMMIT_TAG"
-
apptainer push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" Panache.sif oras://"$CI_REGISTRY_IMAGE"/panache:latest
-
if [ $RUN_panache == "1" ]; then
sed -i "s/VERSION_NUMBER/${CI_COMMIT_TAG#v}/" Panache.def;
apptainer build Panache.sif Panache.def;
apptainer push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" panache.sif oras://"$CI_REGISTRY_IMAGE"/panache:"$CI_COMMIT_TAG";
apptainer push --docker-username "${CI_REGISTRY_USER}" --docker-password "${CI_REGISTRY_PASSWORD}" panache.sif oras://"$CI_REGISTRY_IMAGE"/panache:latest;
fi
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