Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
software-project-WS25
Reddit Team
Commits
12d8cf27
Commit
12d8cf27
authored
Nov 28, 2025
by
Benavides Ontiveros
Browse files
run pipeline on any branch
parent
46915442
Pipeline
#12161
failed
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
12d8cf27
...
@@ -23,8 +23,6 @@ lint:
...
@@ -23,8 +23,6 @@ lint:
image
:
python:3.10
image
:
python:3.10
extends
:
.build_template
extends
:
.build_template
before_script
:
before_script
:
-
echo "Docker CLI info:"
-
docker version
-
pip install flake8
-
pip install flake8
script
:
script
:
-
echo "Linting Python code..."
-
echo "Linting Python code..."
...
@@ -32,10 +30,8 @@ lint:
...
@@ -32,10 +30,8 @@ lint:
-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
-
echo "Done running Python lint stage"
-
echo "Done running Python lint stage"
rules
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
-
if
:
'
$CI_COMMIT_BRANCH'
# Run on any branch
-
if
:
'
$CI_COMMIT_BRANCH'
when
:
always
-
if
:
'
$CI_COMMIT_TAG'
when
:
never
# ----------------- Diagnostics Stage -----------------
# ----------------- Diagnostics Stage -----------------
diag
:
diag
:
...
@@ -48,10 +44,8 @@ diag:
...
@@ -48,10 +44,8 @@ diag:
-
docker version ||
true
-
docker version ||
true
-
docker info ||
true
-
docker info ||
true
rules
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
-
if
:
'
$CI_COMMIT_BRANCH'
-
if
:
'
$CI_COMMIT_BRANCH'
-
if
:
'
$CI_COMMIT_TAG'
when
:
always
when
:
never
# ----------------- Build Stage -----------------
# ----------------- Build Stage -----------------
build
:
build
:
...
@@ -69,11 +63,8 @@ build:
...
@@ -69,11 +63,8 @@ build:
after_script
:
after_script
:
-
echo "Docker image built successfully!"
-
echo "Docker image built successfully!"
rules
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
-
if
:
'
$CI_COMMIT_BRANCH'
# Run build on any branch
when
:
never
when
:
always
-
if
:
'
$CI_COMMIT_BRANCH'
-
if
:
'
$CI_COMMIT_TAG'
when
:
never
# ----------------- Deploy Stage -----------------
# ----------------- Deploy Stage -----------------
deploy
:
deploy
:
...
@@ -85,14 +76,11 @@ deploy:
...
@@ -85,14 +76,11 @@ deploy:
-
echo "Pushing Docker image to Docker Hub..."
-
echo "Pushing Docker image to Docker Hub..."
-
docker push $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA
-
docker push $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA
#
P
ush latest
tag
if on default branch
#
Optional: p
ush latest if on default branch
-
if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then
-
if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then
docker tag $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA $DOCKERHUB_REPO:latest;
docker tag $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA $DOCKERHUB_REPO:latest;
docker push $DOCKERHUB_REPO:latest;
docker push $DOCKERHUB_REPO:latest;
fi
fi
rules
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
-
if
:
'
$CI_COMMIT_BRANCH'
# Run deploy on any branch
when
:
never
when
:
always
-
if
:
'
$CI_COMMIT_TAG'
\ No newline at end of file
when
:
never
-
if
:
'
$CI_COMMIT_BRANCH
==
$CI_DEFAULT_BRANCH'
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment