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
6fc74588
Commit
6fc74588
authored
1 month ago
by
lucas.landrecy
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml file
parent
c3fe0921
No related branches found
No related tags found
No related merge requests found
Pipeline
#40542
failed
1 month ago
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+49
-59
49 additions, 59 deletions
.gitlab-ci.yml
with
49 additions
and
59 deletions
.gitlab-ci.yml
+
49
−
59
View file @
6fc74588
stages
:
name
:
CI/CD - Build & Deploy
-
build
-
push
on
:
-
deploy
push
:
branches
:
variables
:
-
main
DOCKER_DRIVER
:
overlay2
workflow_dispatch
:
CLIENT_IMAGE
:
$CI_REGISTRY_IMAGE/client:$CI_COMMIT_SHORT_SHA
NEO4J_IMAGE
:
$CI_REGISTRY_IMAGE/neo4j:$CI_COMMIT_SHORT_SHA
jobs
:
build-and-deploy
:
.default-docker-job
:
runs-on
:
ubuntu-latest
image
:
docker:24.0
services
:
env
:
-
docker:24.0-dind
DOCKER_IMAGE
:
${{ secrets.DOCKER_USERNAME }}/neo4j-populator
before_script
:
KUBE_NAMESPACE
:
${{ secrets.KUBE_NAMESPACE }}
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
steps
:
# Build both images
-
name
:
Checkout repository
build_client
:
uses
:
actions/checkout@v4
extends
:
.default-docker-job
stage
:
build
-
name
:
Set up Docker Buildx
script
:
uses
:
docker/setup-buildx-action@v3
-
docker build -t $CLIENT_IMAGE ./client
-
name
:
Login to Docker Hub
build_neo4j
:
uses
:
docker/login-action@v3
extends
:
.default-docker-job
with
:
stage
:
build
username
:
${{ secrets.DOCKER_USERNAME }}
script
:
password
:
${{ secrets.DOCKER_PASSWORD }}
-
docker build -t $NEO4J_IMAGE ./neo4j
-
name
:
Build and push image to Docker Hub
# Push both images
uses
:
docker/build-push-action@v5
push_client
:
with
:
extends
:
.default-docker-job
context
:
.
stage
:
push
file
:
./Dockerfile
script
:
push
:
true
-
docker push $CLIENT_IMAGE
tags
:
${{ env.DOCKER_IMAGE }}:latest
needs
:
[
build_client
]
-
name
:
Delete old resources
push_neo4j
:
run
:
|
extends
:
.default-docker-job
kubectl -n $KUBE_NAMESPACE delete -f ./deployment-neo4j.yml --kubeconfig=.kube/config.yml --ignore-not-found
stage
:
push
kubectl -n $KUBE_NAMESPACE delete -f ./neo4j-service.yml --kubeconfig=.kube/config.yml --ignore-not-found
script
:
kubectl -n $KUBE_NAMESPACE delete -f ./job-db-populator.yml --kubeconfig=.kube/config.yml --ignore-not-found
-
docker push $NEO4J_IMAGE
needs
:
[
build_neo4j
]
-
name
:
Deploy to Kubernetes
# Optional deployment (e.g., via kubectl or Helm)
run
:
|
# deploy:
kubectl -n $KUBE_NAMESPACE apply -f ./deployment-neo4j.yml --kubeconfig=.kube/config.yml
# stage: deploy
kubectl -n $KUBE_NAMESPACE apply -f ./neo4j-service.yml --kubeconfig=.kube/config.yml
# image:
kubectl -n $KUBE_NAMESPACE apply -f ./job-db-populator.yml --kubeconfig=.kube/config.yml
# name: bitnami/kubectl:latest
\ No newline at end of file
# entrypoint: [""]
# script:
# - echo "$KUBECONFIG" > kubeconfig.yaml
# - export KUBECONFIG=$CI_PROJECT_DIR/kubeconfig.yaml
# - kubectl set image deployment/client client-container=$CLIENT_IMAGE --namespace=mon-namespace
# - kubectl set image deployment/neo4j neo4j-container=$NEO4J_IMAGE --namespace=mon-namespace
# only:
# - main
# 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