Compare commits

..

3 commits

Author SHA1 Message Date
92db958781 ci: Use build cache image
Some checks failed
ci/woodpecker/push/oci-image-build/5 Pipeline is pending
ci/woodpecker/push/java/1 Pipeline was successful
ci/woodpecker/push/java/2 Pipeline was successful
ci/woodpecker/push/java/3 Pipeline was successful
ci/woodpecker/push/java/4 Pipeline was successful
ci/woodpecker/push/java/5 Pipeline was successful
ci/woodpecker/push/nodejs Pipeline was successful
ci/woodpecker/push/oci-image-cache-build Pipeline was successful
ci/woodpecker/push/oci-image-build/1 Pipeline failed
ci/woodpecker/push/oci-image-build/2 Pipeline failed
ci/woodpecker/push/oci-image-build/3 Pipeline failed
ci/woodpecker/push/oci-image-build/4 Pipeline failed
2024-02-18 14:06:28 +01:00
c1af92e895 ci: Add step to build a cache image 2024-02-18 14:05:45 +01:00
1b07762974 build: Change to support build cache image 2024-02-18 14:05:32 +01:00
3 changed files with 38 additions and 3 deletions

View file

@ -13,8 +13,7 @@ labels:
platform: linux/amd64
depends_on:
- java
- nodejs
- oci-image-cache-build
steps:
build-only:
@ -32,6 +31,8 @@ steps:
pull_image: false
platforms: ${PLATFORM}
dry-run: true
build_args:
- SETUP_IMAGE=rg.fr-par.scw.cloud/hamburghammer/dchat/setup-image:${CI_PIPELINE_NUMBER}
when:
- event: [push, manual]
branch:
@ -52,5 +53,7 @@ steps:
pull_image: false
platforms: ${PLATFORM}
auto_tag: true
build_args:
- SETUP_IMAGE=rg.fr-par.scw.cloud/hamburghammer/dchat/setup-image:${CI_PIPELINE_NUMBER}
when:
- branch: main

View file

@ -0,0 +1,29 @@
matrix:
PLATFORM:
# - linux/amd64
- linux/arm64
labels:
platform: linux/amd64
depends_on:
- java
- nodejs
steps:
build:
image: woodpeckerci/plugin-docker-buildx:2.3.0
group: build
settings:
registry: rg.fr-par.scw.cloud/hamburghammer
username: nologin
password:
from_secret: docker_token
dockerfile: Dockerfile
target: setup-image
repo: rg.fr-par.scw.cloud/hamburghammer/dchat/setup-image
tag: ${CI_PIPELINE_NUMBER}
pull_image: false
platforms: ${PLATFORM}
when:
- branch: main

View file

@ -1,14 +1,17 @@
# syntax=docker/dockerfile:1.4.0
ARG MAVEN_CLI_OPTS="--batch-mode --no-transfer-progress -Dmaven.test.skip"
ARG SETUP_IMAGE=setup-image
# Copy all project files
FROM docker.io/maven:3.9-eclipse-temurin-21 AS setup
FROM docker.io/maven:3.9-eclipse-temurin-21 AS setup-image
WORKDIR /app
COPY . .
RUN --mount=type=cache,target=/root/.m2/ \
mvn ${MAVEN_CLI_OPTS} package
FROM ${SETUP_IMAGE} as setup
# Create final monolith
FROM docker.io/eclipse-temurin:21-jdk-jammy AS monolith
WORKDIR /app