Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
org.etsi.osl.main
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
OSL
code
org.etsi.osl.main
Commits
285c643d
Commit
285c643d
authored
7 months ago
by
Dimitrios Giannopoulos
Browse files
Options
Downloads
Patches
Plain Diff
feat: sanitize version naming
parent
f1444a8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!46
MR for Release 2024Q4
,
!42
Merge develop into side branch
,
!40
feat: sanitize version naming
Pipeline
#8239
passed
7 months ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci-templates/default.yml
+13
-1
13 additions, 1 deletion
ci-templates/default.yml
with
13 additions
and
1 deletion
ci-templates/default.yml
+
13
−
1
View file @
285c643d
...
...
@@ -7,11 +7,23 @@ stages:
.default
:
before_script
:
-
set -e
-
|
if [ "$CI_COMMIT_REF_PROTECTED" = true ] && [ -n "$CI_COMMIT_TAG" ]; then
export APP_VERSION=$CI_COMMIT_TAG
elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then
export APP_VERSION="develop"
else
export APP_VERSION=$CI_COMMIT_REF_NAME
# Replace '/' with '-' and check for any invalid characters
APP_VERSION=$(echo "$CI_COMMIT_REF_NAME" | sed 's|/|-|g')
# Check for invalid characters (only allow lowercase letters, digits, '_', '.', '-')
if echo "$APP_VERSION" | grep -q '[^a-zA-Z0-9._-]'; then
echo "Error: Branch name contains invalid characters for Docker tags. Only a-z, 0-9, '_', '.', and '-' are allowed."
exit 1
fi
# Convert to lowercase
export APP_VERSION=$(echo "$APP_VERSION" | tr 'A-Z' 'a-z')
fi
-
echo "APP_VERSION set to $APP_VERSION"
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