Commit 4a47c883 authored by Gadhave's avatar Gadhave
Browse files

Update .gitlab-ci.yml file

parent 8408accf
Pipeline #12057 failed with stages
in 1 minute and 21 seconds
......@@ -8,6 +8,9 @@ variables:
PYTHONPATH: "${CI_PROJECT_DIR}"
DOCKER_DRIVER: overlay2
DOCKER_REGISTRY: "docker.io"
DOCKER_IMAGE_NAME: telegram-bot
DOCKER_TAG: $CI_COMMIT_SHORT_SHA
before_script:
......@@ -41,24 +44,19 @@ test:
after_script:
- echo "Tests completed succesfully"
build:
build_docker_image:
stage: build
image: alpine:latest
variables:
DOCKER_REGISTRY: docker.io
DOCKER_CONFIG: /kaniko/.docker/
IMAGE_NAME: "${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${CI_PROJECT_NAME}"
IMAGE_TAG: "${CI_COMMIT_SHORT_SHA}"
image: docker:latest
services:
- name: docker:dind
alias: docker
script:
- apk add --no-cache curl
- curl -sSLO https://storage.googleapis.com/kaniko-project/executor
- chmod +x executor && mv executor /usr/local/bin/kaniko
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${DOCKER_REGISTRY}\":{\"username\":\"${DOCKER_USERNAME}\",\"password\":\"${DOCKER_PASSWORD}\"}}}" > /kaniko/.docker/config.json
# Run Kaniko build and push in one clean command (no backslashes)
- /usr/local/bin/kaniko --context "${CI_PROJECT_DIR}/Desktop/Telegram_Bot" --dockerfile "${CI_PROJECT_DIR}/Desktop/Telegram_Bot/Dockerfile" --destination "${IMAGE_NAME}:${IMAGE_TAG}" --cleanup
after_script:
- echo "Docker image pushed successfully!"
- echo "=== Starting Docker Build for commit" $CI_COMMIT_SHA
- echo "Project structure:"
- ls -R
- echo "Navigating to Desktop/Telegram_Bot directory..."
- cd Desktop/Telegram_Bot
- echo "Building Docker image" $DOCKER_IMAGE_NAME ":" $DOCKER_TAG
- docker build -t "$DOCKER_IMAGE_NAME:$DOCKER_TAG" .
- echo "Docker image built successfully:"" $DOCKER_IMAGE_NAME":"$DOCKER_TAG
- docker images | grep "$DOCKER_IMAGE_NAME"
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment