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
05a16de4
Commit
05a16de4
authored
Nov 28, 2025
by
Benavides Ontiveros
Browse files
change gitlab cicd yaml
parent
12d8cf27
Pipeline
#12163
failed with stages
in 16 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
05a16de4
...
...
@@ -24,25 +24,25 @@ lint:
extends
:
.build_template
before_script
:
-
pip install flake8
script
:
-
echo "Linting Python code..."
-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
-
echo "Done running Python lint stage"
script
:
|
echo "Linting Python code..."
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
echo "Done running Python lint stage"
rules
:
-
if
:
'
$CI_COMMIT_BRANCH'
# Run on any branch
-
if
:
'
$CI_COMMIT_BRANCH'
when
:
always
# ----------------- Diagnostics Stage -----------------
diag
:
stage
:
diag
extends
:
.build_template
script
:
-
echo "Check Docker socket and info..."
-
ls -l /var/run ||
true
-
stat /var/run/docker.sock ||
true
-
docker version ||
true
-
docker info ||
true
script
:
|
echo "Check Docker socket and info..."
ls -l /var/run || true
stat /var/run/docker.sock || true
docker version || true
docker info || true
rules
:
-
if
:
'
$CI_COMMIT_BRANCH'
when
:
always
...
...
@@ -54,33 +54,32 @@ build:
before_script
:
-
echo "Logging in to Docker registry..."
-
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
script
:
-
echo "Building Docker image for commit
:
${CI_COMMIT_SHORT_SHA}"
-
docker build \
--build-arg REDDIT_CLIENT_ID="$REDDIT_CLIENT_ID" \
--build-arg REDDIT_CLIENT_SECRET="$REDDIT_CLIENT_SECRET" \
-t $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA .
after_script
:
-
echo "Docker image built successfully!"
script
:
|
echo "Building Docker image for commit: ${CI_COMMIT_SHORT_SHA}"
docker build \
--build-arg REDDIT_CLIENT_ID="$REDDIT_CLIENT_ID" \
--build-arg REDDIT_CLIENT_SECRET="$REDDIT_CLIENT_SECRET" \
-t $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA .
echo "Docker image built successfully!"
rules
:
-
if
:
'
$CI_COMMIT_BRANCH'
# Run build on any branch
-
if
:
'
$CI_COMMIT_BRANCH'
when
:
always
# ----------------- Deploy Stage -----------------
deploy
:
stage
:
deploy
extends
:
.build_template
script
:
-
echo "Logging in to Docker registry..."
-
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
-
echo "Pushing Docker image to Docker Hub..."
-
docker push $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA
script
:
|
echo "Logging in to Docker registry..."
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
echo "Pushing Docker image to Docker Hub..."
docker push $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA
# Optional: push latest if on default branch
-
if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then
docker tag $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA $DOCKERHUB_REPO:latest
;
docker push $DOCKERHUB_REPO:latest
;
fi
# Optional: push latest
tag
if on default branch
if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then
docker tag $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA $DOCKERHUB_REPO:latest
docker push $DOCKERHUB_REPO:latest
fi
rules
:
-
if
:
'
$CI_COMMIT_BRANCH'
# Run deploy on any branch
-
if
:
'
$CI_COMMIT_BRANCH'
when
:
always
\ 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