Commit ad991cea authored by René Link's avatar René Link
Browse files

Added docker build pipeline

parent 66d3c044
Pipeline #751 passed with stage
in 43 seconds
# This file is a template, and might need editing before it works on your project.
# Build a Docker image with CI/CD and push to the GitLab registry.
# Docker-in-Docker documentation: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
#
# This template uses one generic job with conditional builds
# for the default branch and all other (MR) branches.
docker-build:
# Use the official docker image.
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug)
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
- docker push "$CI_REGISTRY_IMAGE${tag}"
# Run this job in a branch where a Dockerfile exists
rules:
- if: $CI_COMMIT_BRANCH
exists:
- Dockerfile
FROM maven:3-jdk-11
RUN apt-get -y update
RUN apt-get -y install libswt-gtk-4-jni
RUN apt-get -y install xdg-utils
\ No newline at end of file
FROM maven:3-jdk-11
RUN apt-get -y update
RUN apt-get -y install xvfb.
RUN apt-get -y install libswt-gtk-4-jni
RUN apt-get -y install xdg-utils
# maven3-jdk-11-swt
Extends the default maven:3-jdk-11 docker image to add support for SWT related tests in a gitlab pipeline.
\ No newline at end of file
Extends the default maven:3-jdk-11 docker image to add support for SWT related tests in a gitlab pipeline.
## Usage
Use the image in the gitlab-ci.yml
image: gitlab.link-intersystems.com:5050/open-source/docker/maven3-jdk-11-swt:latest
Start the build process using `xvfb-run`. E.g. for maven
xvfb-run mvn $MAVEN_CLI_OPTS install -s ci_settings.xml
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