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
Telegram Team
Commits
c213bdb3
Commit
c213bdb3
authored
Nov 08, 2025
by
Gadhave
Browse files
Optimize .gitlab-ci.yml file test
parent
def9d6fa
Pipeline
#12120
passed with stage
in 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
c213bdb3
...
@@ -30,6 +30,10 @@ lint:
...
@@ -30,6 +30,10 @@ lint:
stage
:
lint
stage
:
lint
image
:
python:3.10
image
:
python:3.10
extends
:
.build_template
extends
:
.build_template
cache
:
key
:
"
pip-cache"
paths
:
-
.cache/pip
before_script
:
before_script
:
-
pip install flake8
-
pip install flake8
script
:
script
:
...
@@ -37,62 +41,6 @@ lint:
...
@@ -37,62 +41,6 @@ lint:
-
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
:
test
:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
stage
:
test
-
if
:
$CI_COMMIT_BRANCH
image
:
python:3.10
\ No newline at end of file
extends
:
.build_template
before_script
:
-
pip install pytest
-
echo "Running Tests"
-
echo "PYTHONPATH:" ${PYTHONPATH}
-
echo "PWD=$(pwd)"
script
:
-
echo "Running PyTests"
after_script
:
-
echo "Tests completed succesfully"
diag
:
stage
:
diag
image
:
docker:24.0.9
tags
:
[
"
windows"
,
"
docker"
,
"
ws12"
]
script
:
-
echo "Check socket:"
-
ls -l /var/run ||
true
-
stat /var/run/docker.sock ||
true
-
echo "Docker info:"
-
docker version ||
true
-
docker info ||
true
build
:
stage
:
build
image
:
docker:24.0.9
extends
:
.build_template
before_script
:
-
echo "Building Docker image for commit:" ${CI_COMMIT_SHORT_SHA}
-
echo "Logging in to Docker registry..."
-
echo "Docker Registry :" ${DOCKER_REGISTRY}
-
echo "Docker Username :" ${DOCKER_USERNAME}
-
echo "Docker Passowrd :" ${DOCKER_PASSWORD}
script
:
-
echo "Building image..."
-
cd Desktop/Telegram_Bot
-
docker build -t $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA .
after_script
:
-
echo "Docker image pushed successfully!"
deploy
:
stage
:
deploy
image
:
docker:24.0.9
tags
:
[
"
windows"
,
"
docker"
,
"
ws12"
]
script
:
-
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin
-
echo "Logged into dockerhub succesfully!!"
-
docker push $DOCKERHUB_REPO:$CI_COMMIT_SHORT_SHA
-
echo "Pushed the docker image to dockerhub succesfully!"
-
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
\ 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