Skip to content

Commit

Permalink
feat: Add .gitlab-ci.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
mecampbellsoup committed Jul 25, 2022
1 parent 5018454 commit 895e429
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .gitlab-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
default:
image:
name: $KANIKO_IMAGE
entrypoint: [ "" ]
tags:
- ord1-tenant

stages:
- build

variables:
REF_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
FIXED_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
DOCKERFILE: $CI_PROJECT_DIR/Dockerfile

KANIKO_IMAGE: gcr.io/kaniko-project/executor:debug

# cache
CACHE_REGISTRY_HOST: 'kaniko-cache-docker-registry.kaniko.svc'
CACHE_REGISTRY_PORT: '5000'
CACHE_REGISTRY_REPO: "${CACHE_REGISTRY_HOST}:${CACHE_REGISTRY_PORT}/${CI_PROJECT_NAME}/${CI_JOB_NAME}/cache"
CACHE_PROXY: 'http://193.25.126.17:3128'
KANIKO_ADDTL_ARGS: "--cache=true --cache-copy-layers=true --cache-repo=${CACHE_REGISTRY_REPO} --skip-tls-verify --insecure"

build-image:
stage: build
before_script:
- export HTTP_PROXY=${CACHE_PROXY}
- export NO_PROXY=${CACHE_REGISTRY_HOST}
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script: |-
/kaniko/executor \
$KANIKO_ADDTL_ARGS \
--context $CI_PROJECT_DIR \
--dockerfile $CI_PROJECT_DIR/Dockerfile \
--destination $REF_IMAGE \
--destination $FIXED_IMAGE

0 comments on commit 895e429

Please sign in to comment.