Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advDaba_labo2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
lucas.landrecy
advDaba_labo2
Commits
98811db5
Commit
98811db5
authored
1 month ago
by
lucas.landrecy
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml file
parent
2b5a72d8
No related branches found
No related tags found
No related merge requests found
Pipeline
#40539
failed
1 month ago
Stage: build
Stage: push
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+34
-22
34 additions, 22 deletions
.gitlab-ci.yml
with
34 additions
and
22 deletions
.gitlab-ci.yml
+
34
−
22
View file @
98811db5
...
@@ -4,34 +4,46 @@ stages:
...
@@ -4,34 +4,46 @@ stages:
-
deploy
-
deploy
variables
:
variables
:
IMAGE_TAG
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
DOCKER_DRIVER
:
overlay2
CLIENT_IMAGE
:
$CI_REGISTRY_IMAGE/client:$CI_COMMIT_SHORT_SHA
NEO4J_IMAGE
:
$CI_REGISTRY_IMAGE/neo4j:$CI_COMMIT_SHORT_SHA
# Docker build
.default-docker-job
:
build_image
:
stage
:
build
image
:
docker:24.0
image
:
docker:24.0
services
:
services
:
-
docker:24.0-dind
-
docker:24.0-dind
script
:
before_
script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-
docker build -t $IMAGE_TAG .
only
:
-
main
# Push to registry
# Build both images
push_image
:
build_client
:
extends
:
.default-docker-job
stage
:
build
script
:
-
docker build -t $CLIENT_IMAGE ./client
build_neo4j
:
extends
:
.default-docker-job
stage
:
build
script
:
-
docker build -t $NEO4J_IMAGE ./neo4j
# Push both images
push_client
:
extends
:
.default-docker-job
stage
:
push
stage
:
push
image
:
docker:24.0
services
:
-
docker:24.0-dind
script
:
script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-
docker push $CLIENT_IMAGE
-
docker push $IMAGE_TAG
needs
:
[
build_client
]
only
:
-
main
push_neo4j
:
needs
:
[
build_image
]
extends
:
.default-docker-job
stage
:
push
script
:
-
docker push $NEO4J_IMAGE
needs
:
[
build_neo4j
]
#
Deploy to Kubernetes (optional, requires
kubectl
config
)
#
Optional deployment (e.g., via
kubectl
or Helm
)
# deploy:
# deploy:
# stage: deploy
# stage: deploy
# image:
# image:
...
@@ -40,8 +52,8 @@ push_image:
...
@@ -40,8 +52,8 @@ push_image:
# script:
# script:
# - echo "$KUBECONFIG" > kubeconfig.yaml
# - echo "$KUBECONFIG" > kubeconfig.yaml
# - export KUBECONFIG=$CI_PROJECT_DIR/kubeconfig.yaml
# - export KUBECONFIG=$CI_PROJECT_DIR/kubeconfig.yaml
# - kubectl
config get-contexts
# - kubectl
set image deployment/client client-container=$CLIENT_IMAGE --namespace=mon-namespace
# - kubectl set image deployment/
mon-deploiement mon
-container=$IMAGE
_TAG
--namespace=mon-namespace
# - kubectl set image deployment/
neo4j neo4j
-container=$
NEO4J_
IMAGE --namespace=mon-namespace
# only:
# only:
# - main
# - main
# needs: [push_
image
]
# needs: [push_
client, push_neo4j
]
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