Skip to content
Snippets Groups Projects
Commit 494acc84 authored by Konstantinos Samaras-Tsakiris's avatar Konstantinos Samaras-Tsakiris
Browse files

Merge branch 'add-openshift-cli-image' into 'master'

Add dockerfile and ci

See merge request !6
parents 5ee1add5 5f31e5e1
No related branches found
No related tags found
1 merge request!6Add dockerfile and ci
Pipeline #2521723 passed
stages:
- build
.build:
stage: build
image:
name: gitlab-registry.cern.ch/ci-tools/docker-image-builder
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $IMAGE_DESTINATION
- echo "Image pushed successfully to ${IMAGE_DESTINATION}"
#####################################################
################### Merge Requests ##################
build_mr:
extends: .build
variables:
IMAGE_DESTINATION: ${CI_REGISTRY_IMAGE}/openshift-cli:${CI_COMMIT_REF_SLUG}
rules:
- if: $CI_MERGE_REQUEST_ID
when: manual
allow_failure: true
- when: never
######################################################
#################### Master branch ###################
build_master:
extends: .build
variables:
IMAGE_DESTINATION: ${CI_REGISTRY_IMAGE}/openshift-cli:latest
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- when: never
# Base image: https://github.com/Docker-Hub-frolvlad/docker-alpine-glibc
# This image makes glibc work side by side with musl libc
FROM frolvlad/alpine-glibc:latest
LABEL maintainer="Drupal Admins <drupal-admins@cern.ch>"
ARG BUILD_DEPS='tar gzip'
ARG RUN_DEPS='curl ca-certificates gettext'
RUN apk --no-cache add $BUILD_DEPS $RUN_DEPS && \
curl -sLo /tmp/oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz && \
tar xzvf /tmp/oc.tar.gz -C /usr/local/bin/ && \
rm -rf /tmp/oc.tar.gz && \
apk del $BUILD_DEPS
CMD ["/usr/local/bin/oc"]
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