Commit 23c96c32 authored by odatskov's avatar odatskov
Browse files

Testing on container

parent 7dac88b5
Pipeline #504974 passed with stages
in 2 minutes and 56 seconds
---
stages:
- test
- build
- deploy
#############################################
############# Test ##########################
sync_test:
stage: test
......@@ -13,3 +18,33 @@ sync_test:
- go test -v
environment:
name: test
#############################################
############# Build #########################
.job_template: &build_image
stage: build
image: docker:latest
tags:
- docker-privileged
environment:
name: build/${CI_COMMIT_REF_NAME}
before_script:
- apk add git
- docker info
.build:beego:
<<: *build_image
script:
- case "$(git diff HEAD~ --name-only)" in *"Dockerfile.beego"*|*"Dockerfile.beego$"*) echo "Dockerfile.beego changed" ;; *) echo "Dockefile.beego not changed. Skipping build..."; exit 0 ;; esac
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE/web-go:$CI_COMMIT_REF_NAME" -f Dockerfile.beego .
- docker push "$CI_REGISTRY_IMAGE/web-go:$CI_COMMIT_REF_NAME"
build:deploy:
<<: *build_image
script:
- case "$(git diff HEAD~ --name-only)" in *"Dockerfile.kube"*|*"Dockerfile.kube$"*) echo "Dockerfile.kube changed" ;; *) echo "Dockefile.kube not changed. Skipping build..."; exit 0 ;; esac
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE/kubectl:$CI_COMMIT_REF_NAME" -f Dockerfile.kube .
- docker push "$CI_REGISTRY_IMAGE/kubectl:$CI_COMMIT_REF_NAME"
# Builder image for fetching and unpacking binaries
FROM alpine:3.8 as build
ENV KUBE_LATEST="v1.10.7"
ENV HELM_LATEST="v2.10.0"
WORKDIR /
RUN apk add --update --no-cache ca-certificates && apk add --update -t deps curl tar \
&& curl -L https://storage.googleapis.com/kubernetes-release/release/${KUBE_LATEST}/bin/linux/amd64/kubectl -o /tmp/kubectl \
&& chmod +x /tmp/kubectl \
&& curl -L https://storage.googleapis.com/kubernetes-helm/helm-${HELM_LATEST}-linux-amd64.tar.gz | tar zxv -C /tmp
# Minimum image meant for execution
FROM alpine:3.8
RUN apk add --update --no-cache ca-certificates bash
COPY --from=build /tmp/linux-amd64/helm /bin/helm
COPY --from=build /tmp/kubectl /bin/kubectl
FROM golang:1.10
RUN apt-get update
/*
sync provides synchronisatoin of docker images with cvmfs based on provided repository lists.
sync provides synchronisation of docker images with cvmfs based on provided repository lists.
If no paths were specified, all yaml files (searched recursively) within current path will be used.
Usage: ./sync [file paths]
......
name: sync
description: synchronisation of Docker images in CVMFS
apiVersion: v1
appVersion: "1.0"
version: 0.1.0
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-cvmfs-cms
serviceAccount:
name: gitlab-sa
namespace: gitlab-ns
image:
repository: gitlab-registry.cern.ch/unpacked
name: sync
tag: master
secret: gitlab-sa-token-lgz86
pullPolicy: Always
restartPolicy: Never
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment