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
eb76aacb
Commit
eb76aacb
authored
Nov 28, 2025
by
Benavides Ontiveros
Browse files
modify .gitlab yaml for reddit
parent
84b2a741
Pipeline
#12168
failed with stages
in 26 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
eb76aacb
...
@@ -17,7 +17,7 @@ variables:
...
@@ -17,7 +17,7 @@ variables:
tags
:
[
"
ubuntu"
,
"
vm"
]
# MUST match your runner tags
tags
:
[
"
ubuntu"
,
"
vm"
]
# MUST match your runner tags
image
:
docker:24.0.9
# Contains Docker client
image
:
docker:24.0.9
# Contains Docker client
services
:
services
:
-
docker:dind
#
Start
Docker daemon
-
docker:dind
# Docker daemon
for building/pushing images
variables
:
variables
:
DOCKER_HOST
:
tcp://docker:2375
DOCKER_HOST
:
tcp://docker:2375
DOCKER_TLS_CERTDIR
:
"
"
DOCKER_TLS_CERTDIR
:
"
"
...
@@ -25,7 +25,6 @@ variables:
...
@@ -25,7 +25,6 @@ variables:
-
echo "Running inside Docker executor with Docker-in-Docker"
-
echo "Running inside Docker executor with Docker-in-Docker"
-
docker info ||
true
-
docker info ||
true
# =====================================================================
# =====================================================================
# LINT
# LINT
# =====================================================================
# =====================================================================
...
@@ -35,18 +34,17 @@ lint:
...
@@ -35,18 +34,17 @@ lint:
tags
:
[
"
ubuntu"
,
"
vm"
]
tags
:
[
"
ubuntu"
,
"
vm"
]
before_script
:
before_script
:
-
pip install flake8
-
pip install flake8
script
:
script
:
|
-
echo "Linting Python code.."
echo "Linting Python code..
.
"
-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
-
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 the Python Lint stage"
echo "Done running the Python Lint stage"
rules
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
-
if
:
'
$CI_COMMIT_BRANCH'
-
if
:
'
$CI_COMMIT_BRANCH'
-
if
:
'
$CI_COMMIT_TAG'
-
if
:
'
$CI_COMMIT_TAG'
when
:
never
when
:
never
# =====================================================================
# =====================================================================
# TEST
# TEST
# =====================================================================
# =====================================================================
...
@@ -57,47 +55,46 @@ test:
...
@@ -57,47 +55,46 @@ test:
before_script
:
before_script
:
-
pip install pytest
-
pip install pytest
-
echo "Running Tests"
-
echo "Running Tests"
script
:
script
:
|
-
pytest -q || echo "No tests found"
pytest -q || echo "No tests found"
after_script
:
-
echo "Tests completed successfully"
rules
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
-
if
:
'
$CI_COMMIT_BRANCH'
-
if
:
'
$CI_COMMIT_BRANCH'
-
if
:
'
$CI_COMMIT_TAG'
-
if
:
'
$CI_COMMIT_TAG'
when
:
never
when
:
never
# =====================================================================
# =====================================================================
# DIAGNOSTICS
# DIAGNOSTICS
# =====================================================================
# =====================================================================
diag
:
diag
:
stage
:
diag
stage
:
diag
extends
:
.build_template
extends
:
.build_template
script
:
script
:
|
-
echo "Check Docker access:"
echo "Check Docker access:"
-
ls -l /var/run
ls -l /var/run
-
stat /var/run/docker.sock ||
true
stat /var/run/docker.sock || true
-
docker version ||
true
docker version || true
-
docker info ||
true
docker info || true
rules
:
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
-
if
:
'
$CI_COMMIT_BRANCH'
-
if
:
'
$CI_COMMIT_BRANCH'
-
if
:
'
$CI_COMMIT_TAG'
-
if
:
'
$CI_COMMIT_TAG'
when
:
never
when
:
never
# =====================================================================
# =====================================================================
# BUILD
# BUILD
# =====================================================================
# =====================================================================
build
:
build
:
stage
:
build
stage
:
build
extends
:
.build_template
extends
:
.build_template
script
:
script
:
|
-
echo "Logging in to Docker registry..."
echo "Logging in to Docker registry..."
-
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
-
echo "Building Docker image for commit
:
${CI_COMMIT_SHORT_SHA}"
echo "Building Docker image for commit: ${CI_COMMIT_SHORT_SHA}"
docker build \
-
docker build \
--build-arg REDDIT_CLIENT_ID="$REDDIT_CLIENT_ID" \
--build-arg REDDIT_CLIENT_ID="$REDDIT_CLIENT_ID" \
--build-arg REDDIT_CLIENT_SECRET="$REDDIT_CLIENT_SECRET" \
--build-arg REDDIT_CLIENT_SECRET="$REDDIT_CLIENT_SECRET" \
-t $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA .
-t $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA .
...
@@ -111,24 +108,23 @@ build:
...
@@ -111,24 +108,23 @@ build:
-
if
:
'
$CI_COMMIT_TAG'
-
if
:
'
$CI_COMMIT_TAG'
when
:
never
when
:
never
# =====================================================================
# =====================================================================
# DEPLOY
# DEPLOY
# =====================================================================
# =====================================================================
deploy
:
deploy
:
stage
:
deploy
stage
:
deploy
extends
:
.build_template
extends
:
.build_template
script
:
script
:
|
-
echo "Logging in to Docker registry..."
echo "Logging in to Docker registry..."
-
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
-
echo "Pushing Docker image..."
echo "Pushing Docker image..."
-
docker push $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA
docker push $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA
-
if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then
if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then
echo "Tagging image as latest..."
;
echo "Tagging image as latest..."
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
:
...
...
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