Skip to content

Commit

Permalink
Version is 0-SNAPSHOT since determined by release tag name
Browse files Browse the repository at this point in the history
Release is now better and uses cache
Dockerfile builds it all as required by GitHub Action
  • Loading branch information
asafm committed Jan 3, 2021
1 parent 2bcfe82 commit 1d063f7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- '*' # Push events to matching *, i.e. 1.0, 20.15.10

jobs:
build:
name: Release Binaries
release-github:
name: Publish Binaries to GitHub Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -37,10 +37,23 @@ jobs:
file_glob: true
tag: ${{ github.ref }}
overwrite: true

release-docker:
name: Release Docker image to DockerHub
runs-on: ubuntu-latest
needs: [release-github]
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand All @@ -51,6 +64,8 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: |
logzio/jmx2graphite:latest
logzio/jmx2graphite:${{ steps.determine-version.outputs.VERSION }}
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
jmx2graphite.iml
.idea/
/target/
.gradle/
gradlew
gradlew.bat
gradle/
/target/
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
FROM maven:3.6.3-jdk-8-slim AS build
RUN mkdir -p /workspace
WORKDIR /workspace
COPY pom.xml /workspace
COPY src /workspace/src
RUN mvn -B -f pom.xml clean package -DskipTests

FROM openjdk:8u121-alpine

MAINTAINER Asaf Mesika <[email protected]>

RUN apk add --no-cache --update bash curl vim

ADD target/jmx2graphite-*-javaagent.jar /jmx2graphite.jar
COPY --from=build /workspace/target/jmx2graphite-*-javaagent.jar /jmx2graphite.jar
ADD slf4j-simple-1.7.25.jar /slf4j-simple-1.7.25.jar
ADD application.conf /application.conf
# Default Start
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.logz</groupId>
<artifactId>jmx2graphite</artifactId>
<version>1.4.4</version>
<version>0-SNAPSHOT</version>

<build>
<plugins>
Expand Down

0 comments on commit 1d063f7

Please sign in to comment.