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
823896e9
Commit
823896e9
authored
Nov 28, 2025
by
Benavides Ontiveros
Browse files
verify docker push and login
parent
f8fced6f
Pipeline
#12178
failed
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
823896e9
...
...
@@ -10,16 +10,6 @@ variables:
DOCKER_REGISTRY
:
"
docker.io"
DOCKERHUB_REPO
:
"
$DOCKER_USERNAME/reddit_data_fetcher"
# =====================================================================
# BASE JOB TEMPLATE
# =====================================================================
.build_template
:
tags
:
[
"
ubuntu"
,
"
vm"
]
# Must match your runner tags
image
:
docker:24.0.9
# Docker CLI available
before_script
:
-
echo "Checking Docker access..."
-
docker info ||
true
# just in case
# =====================================================================
# LINT
# =====================================================================
...
...
@@ -65,10 +55,14 @@ test:
# =====================================================================
diag
:
stage
:
diag
extends
:
.build_template
image
:
docker:24.0.9
tags
:
[
"
ubuntu"
,
"
vm"
]
before_script
:
-
echo "Checking Docker access..."
-
docker info ||
true
script
:
-
echo "Check Docker
access
:"
-
ls -l /var/run
-
echo "Check Docker
socket
:"
-
ls -l /var/run
||
true
-
stat /var/run/docker.sock ||
true
-
echo "Docker version:"
-
docker version ||
true
...
...
@@ -85,7 +79,11 @@ diag:
# =====================================================================
build
:
stage
:
build
extends
:
.build_template
image
:
docker:24.0.9
tags
:
[
"
ubuntu"
,
"
vm"
]
before_script
:
-
echo "Checking Docker access..."
-
docker info ||
true
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 .
...
...
@@ -104,7 +102,11 @@ build:
# =====================================================================
deploy
:
stage
:
deploy
extends
:
.build_template
image
:
docker:24.0.9
tags
:
[
"
ubuntu"
,
"
vm"
]
before_script
:
-
echo "Checking Docker access..."
-
docker info ||
true
script
:
-
echo "Logging in to Docker Hub..."
-
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
...
...
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