Commit 2f8bfabf authored by Manuel Christlieb's avatar Manuel Christlieb
Browse files

create team23/cypress image

parents
Pipeline #35322 passed with stage
in 50 seconds
image: docker:latest
services:
- name: docker:dind
stages:
- build
build10:
stage: build
only:
refs:
- master
script:
- /bin/sh build.sh 10
FROM cypress/browsers:node10.16.0-chrome77
# Supported tags and respective Dockerfile links
* `10`: [Dockerfile](10/Dockerfile)
#!/bin/bash
VERSION="${1:-}"
ADDITIONAL="${2:-}"
if [ -z "$VERSION" ]
then
echo "Error: No version supplied"
echo "Usage: $0 <version> [additional]"
exit 1
fi
set -o errexit
set -o pipefail
if [ -z "$CI_REGISTRY" ]
then # outside gitlab ci runner
docker login docker.team23.de
BUILD_PROJECT_NAME=$( basename $( pwd ) )
BUILD_IMAGE_BASE="docker.team23.de/docker/$BUILD_PROJECT_NAME"
else # inside gitlab ci runner
docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
BUILD_IMAGE_BASE="$CI_REGISTRY/$CI_PROJECT_PATH"
fi
# Build Image
docker build --pull -t "$BUILD_IMAGE_BASE:$VERSION" "$VERSION"
# only CI should be allowed push images
[ -n "$CI_REGISTRY" ] && docker push "$BUILD_IMAGE_BASE:$VERSION"
if [ ! -z "$ADDITIONAL" ]
then
# Build additional image (usually latest)
docker build --pull -t "$BUILD_IMAGE_BASE:$ADDITIONAL" "$VERSION"
[ -n "$CI_REGISTRY" ] && docker push "$BUILD_IMAGE_BASE:$ADDITIONAL"
fi
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