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

ci: kaniko seems to work

parent e18eebe5
No related branches found
No related tags found
No related merge requests found
......@@ -148,33 +148,15 @@ stg-build-fe-node-job:
#--[ Backend ]------------------------------------------------------------------
# TODO: cache docker layers
build-be-job:
# image: docker:20.10.12
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
# tags:
# - commul # NOTE: we need commul (not shared) because of credentials in environment
# services:
# - docker:dind
tags:
- commul # NOTE: we need commul (not shared) because of credentials in environment
variables:
IMAGE_NAME: $CI_REGISTRY_IMAGE/backend
# before_script:
# - 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:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
......@@ -182,7 +164,12 @@ build-be-job:
/kaniko/executor
--context "${CI_PROJECT_DIR}/backend"
--dockerfile "${CI_PROJECT_DIR}/backend/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_TAG}"
--target production
--destination ${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_SHA}
--destination ${CI_REGISTRY_IMAGE}/backend:${CI_COMMIT_REF_NAME}
--destination ${CI_REGISTRY_IMAGE}/backend:${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
# only:
# - tags
# - development
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment