Skip to content
Snippets Groups Projects

Ajout d'une étape de build d'image docker à la pipeline

Merged MARTIN Pierre-Alexandre requested to merge ci/cd into dev
1 file
+ 25
2
Compare changes
  • Side-by-side
  • Inline
+ 25
2
@@ -4,6 +4,7 @@ image: node:22
stages:
- build
- test
- docker
cache:
- &global_cache_node_mods
@@ -34,7 +35,6 @@ install:
build:
stage: build
script:
- npm ci
- npm run build
artifacts:
paths:
@@ -59,6 +59,29 @@ lint:
stage: test
needs:
- job: build
artifacts: true
artifacts: true
script:
- npm run lint
build-image:
stage: docker
rules:
- if: $CI_COMMIT_BRANCH == "main" ||
$CI_COMMIT_BRANCH == "dev"
image:
name: gcr.io/kaniko-project/executor:v1.23.2-debug
entrypoint: [""]
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "main" ]]; then
TAG="latest"
else
TAG="dev"
fi
echo "Branch: $CI_COMMIT_BRANCH"
echo "Tag to be used: ${CI_REGISTRY_IMAGE}:$TAG"
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${TAG}"
Loading