Skip to content
Snippets Groups Projects
Commit f187701c authored by Paolo Brasolin's avatar Paolo Brasolin
Browse files

chore: test kaniko for be build

parent 1004b967
No related branches found
No related tags found
No related merge requests found
Pipeline #25024 failed
...@@ -150,31 +150,42 @@ stg-build-fe-node-job: ...@@ -150,31 +150,42 @@ stg-build-fe-node-job:
# TODO: cache docker layers # TODO: cache docker layers
build-be-job: build-be-job:
image: docker:20.10.12 # image: docker:20.10.12
stage: build stage: build
tags: image:
- commul # NOTE: we need commul (not shared) because of credentials in environment name: gcr.io/kaniko-project/executor:debug
services: entrypoint: [""]
- docker:dind # tags:
# - commul # NOTE: we need commul (not shared) because of credentials in environment
# services:
# - docker:dind
variables: variables:
IMAGE_NAME: $CI_REGISTRY_IMAGE/backend IMAGE_NAME: $CI_REGISTRY_IMAGE/backend
before_script: # before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN https://$CI_REGISTRY # - docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN https://$CI_REGISTRY
# script:
# - >
# docker build
# --rm --no-cache
# --target production
# --tag=$IMAGE_NAME:${CI_COMMIT_SHA}
# --tag=$IMAGE_NAME:${CI_COMMIT_REF_NAME}
# --tag=$IMAGE_NAME:${CI_COMMIT_TAG:-latest}
# --build-arg APP_VERSION=${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}
# --build-arg ROLLBAR_ACCESS_TOKEN=$POST_SERVER_ITEM_ROLLBAR_ACCESS_TOKEN
# backend
# - docker image push --all-tags $IMAGE_NAME
script: script:
- > - mkdir -p /kaniko/.docker
docker build - echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
--rm --no-cache - >-
--target production /kaniko/executor
--tag=$IMAGE_NAME:${CI_COMMIT_SHA} --context "${CI_PROJECT_DIR}"
--tag=$IMAGE_NAME:${CI_COMMIT_REF_NAME} --dockerfile "${CI_PROJECT_DIR}/backend/Dockerfile"
--tag=$IMAGE_NAME:${CI_COMMIT_TAG:-latest} --destination "${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_TAG}"
--build-arg APP_VERSION=${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA} # only:
--build-arg ROLLBAR_ACCESS_TOKEN=$POST_SERVER_ITEM_ROLLBAR_ACCESS_TOKEN # - tags
backend # - development
- docker image push --all-tags $IMAGE_NAME
only:
- tags
- development
#==[ DEPLOY STAGE ]============================================================= #==[ DEPLOY STAGE ]=============================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment