Skip to content
Snippets Groups Projects

K8s deploy

Merged Remi PLANEL requested to merge k8s-deploy into dev
1 file
+ 46
20
Compare changes
  • Side-by-side
  • Inline
+ 46
20
# The Docker image that will be used to build your app
image: node:19.5-bullseye-slim
# Functions that should be executed before the build script is run
# Functions that should be executed before the build script is run
 
variables:
 
HELM_VERSION: "3.9.3"
 
IMAGE_NAME: "df-wiki"
 
cache:
cache:
paths:
paths:
- node_modules/
- node_modules/
@@ -10,7 +12,6 @@ stages:
@@ -10,7 +12,6 @@ stages:
- build
- build
- deploy
- deploy
.build:
.build:
stage: build
stage: build
image: docker:24
image: docker:24
@@ -24,7 +25,6 @@ stages:
@@ -24,7 +25,6 @@ stages:
- docker build --pull -t "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA" --build-arg="BUILD_OPTIONS=$OPTIONS" -f $DOCKERFILE $CONTEXT
- docker build --pull -t "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA" --build-arg="BUILD_OPTIONS=$OPTIONS" -f $DOCKERFILE $CONTEXT
- docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA"
- docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA"
# build:
# build:
# stage: build
# stage: build
# before_script:
# before_script:
@@ -38,23 +38,49 @@ stages:
@@ -38,23 +38,49 @@ stages:
# when: on_success
# when: on_success
# expire_in: "30 days"
# expire_in: "30 days"
build:dev:
build:dev:nuxt:
extends: .build
extends: .build
variables:
IMAGE_NAME: "df-wiki"
rules:
rules:
- if: $CI_COMMIT_BRANCH != "main"
- if: $CI_COMMIT_BRANCH != "main"
# pages:
.deploy:
# stage: deploy
stage: deploy
# only:
image: harbor.pasteur.fr/kube-system/helm-kubectl:$HELM_VERSION
# - main
variables:
# script:
CI_DEBUG_TRACE: "true"
# - NUXT_APP_BASE_URL=/wiki npm run generate
TEAM_ID: "df"
# - rm -rf public
script:
# - mv .output/public public
- >
# artifacts:
helm upgrade --install $CI_PROJECT_NAME-$CI_ENVIRONMENT_NAME ./deploy/ --namespace=${KUBE_NAMESPACE}
# paths:
--set registry.image=${CI_REGISTRY_IMAGE}
# # The folder that contains the files to be exposed at the Page URL
--set registry.username=${DEPLOY_USER}
# - public
--set registry.password=${DEPLOY_TOKEN}
 
--set registry.host=${CI_REGISTRY}
 
--set imagePullSecrets[0].name="registry-pull-secret-${CI_COMMIT_REF_SLUG}"
 
--set ingress.enabled="true"
 
--set ingress.hosts[0].host="${PUBLIC_URL}"
 
--set ingress.hosts[0].paths[0].path="/"
 
--set ingress.annotations."kubernetes\.io/ingress\.class"="$INGRESS_CLASS"
 
--set image.repository="$CI_REGISTRY_IMAGE/$IMAGE_NAME"
 
--set image.tag="$CI_COMMIT_SHORT_SHA"
 
--set image.pullPolicy='Always'
 
--set env="$ENV"
 
 
deploy:dev:
 
extends: .deploy
 
rules:
 
- if: $CI_COMMIT_BRANCH != "main"
 
needs:
 
- "build:dev"
 
variables:
 
NODE_ENV: "development"
 
KUBE_NAMESPACE: "defense-finder-dev"
 
PUBLIC_URL: "defense-finder.dev.pasteur.cloud"
 
INGRESS_CLASS: "internal"
 
AUTOSCALE: "true"
 
AUTSCALING_MIN_REPLICAS: "1"
 
AUTSCALING_MAX_REPLICAS: "4"
 
ENV: "development"
 
environment:
 
name: k8sdev-01
 
url: "https://defense-finder.dev.pasteur.cloud"
Loading