Commit 3458b488 authored by Carsten Heidmann's avatar Carsten Heidmann
Browse files

remove dependency to ci_build as long as we don't have it in place

change version for Docker to 19.03.11
parent 0f7b4a46
name: Docker
on:
push:
branches: [ master ]
release:
types: [published]
jobs:
docker_build:
name: Create and push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: helmholtzcloud/marketplace
tag_with_ref: true
tags: latest
stages:
- build
- test
- pre_package
- package
- deploy
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
DOCKER_IMAGE_TAGGED: helmholtzcloud/marketplace:$CI_COMMIT_SHA
DOCKER_IMAGE_LATEST: helmholtzcloud/marketplace:latest
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- ".m2/repository"
include:
- local: .gitlab/ci/create-docker-image-ci.yml
\ No newline at end of file
maven_build:
only:
- master
- tags
- merge_requests
stage: pre_package
# dependencies:
# - ci_build
image: maven:3-jdk-11
script: "mvn install"
artifacts:
paths:
- "target/*.jar"
expire_in: 600 seconds
tags:
- "docker"
docker_push:
only:
- master
stage: package
image: docker:19.03.11
services:
- name: docker:19.03.11-dind
alias: docker
before_script:
- docker info
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker build -t $DOCKER_IMAGE_LATEST .
# - docker build -t $DOCKER_IMAGE_TAGGED .
# - docker push $DOCKER_IMAGE_TAGGED
# - docker tag $DOCKER_IMAGE_TAGGED $DOCKER_IMAGE_LATEST
- docker push $DOCKER_IMAGE_LATEST
dependencies:
- maven_build
tags:
- "docker"
Supports Markdown
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