Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Flask_App
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LAMRINI Houda
Flask_App
Commits
5f2e817a
Commit
5f2e817a
authored
5 months ago
by
LAMRINI Houda
Browse files
Options
Downloads
Patches
Plain Diff
gitlab-ci update
parent
77aff8a2
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#47241
failed
5 months ago
Stage: build_push
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+23
-5
23 additions, 5 deletions
.gitlab-ci.yml
with
23 additions
and
5 deletions
.gitlab-ci.yml
+
23
−
5
View file @
5f2e817a
image
:
docker:
19.03.1
image
:
docker:
20.10.16
# Version plus récente recommandée
services
:
services
:
-
name
:
docker:
19.03
.1-dind
-
name
:
docker:
20.10
.1
6
-dind
alias
:
docker
alias
:
docker
command
:
[
"
--tls=false"
]
# Désactiver TLS pour éviter les erreurs de connexion
variables
:
variables
:
DOCKER_DRIVER
:
overlay2
DOCKER_DRIVER
:
overlay2
DOCKER_TLS_CERTDIR
:
"
/certs"
DOCKER_TLS_CERTDIR
:
"
"
# Désactiver TLS
DOCKER_HOST
:
"
tcp://
d
oc
ker
:2375"
DOCKER_HOST
:
"
tcp://
l
oc
alhost
:2375"
stages
:
stages
:
-
build_push
-
build_push
before_script
:
before_script
:
-
docker login -u $CI_REGISTRY_USER -
p $CI_JOB_TOKEN
$CI_REGISTRY
-
echo $CI_JOB_TOKEN |
docker login -u $CI_REGISTRY_USER -
-password-stdin
$CI_REGISTRY
build-push-image
:
build-push-image
:
stage
:
build_push
stage
:
build_push
tags
:
-
docker
script
:
script
:
-
docker build . --tag $CI_REGISTRY/my-image:latest
-
docker build . --tag $CI_REGISTRY/my-image:latest
-
docker push $CI_REGISTRY/my-image:latest
-
docker push $CI_REGISTRY/my-image:latest
services
:
-
name
:
docker:20.10.16-dind
alias
:
docker
command
:
[
"
--tls=false"
]
variables
:
DOCKER_HOST
:
"
tcp://localhost:2375"
DOCKER_TLS_CERTDIR
:
"
"
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
==
"main"'
before_script
:
-
echo $CI_JOB_TOKEN | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
script
:
-
docker build . --tag $CI_REGISTRY/my-image:latest
-
docker push $CI_REGISTRY/my-image:latest
retry
:
2
# Réessaie deux fois en cas d'échec
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment