-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial Dockerfile and CI workflow
- Loading branch information
Showing
6 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.git/ | ||
.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: build | ||
|
||
on: | ||
workflow_dispatch: {} # allow workflow to be run manually | ||
push: | ||
branches: [ main ] | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
name: Build Image | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
# - run: echo ::set-env name=IMAGE_TAG::${GITHUB_REF:10} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build | ||
id: build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: ${{ github.event_name == 'release' }} | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/mapi:latest | ||
- name: Image digest | ||
run: echo ${{ steps.build.outputs.digest }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM maven:3-openjdk-11-slim | ||
|
||
ENV DEPENDENCY="org.apache.maven.plugins:maven-dependency-plugin:3.1.2" | ||
|
||
ADD . / | ||
|
||
# try to download as much dependencies as possible during build | ||
|
||
RUN mvn package -B | ||
RUN mvn ${DEPENDENCY}:go-offline -B | ||
RUN mvn ${DEPENDENCY}:get -Dartifact=${DEPENDENCY}:jar -B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
# docker-mapi | ||
Maven Atlassian Plugin Installer | ||
================================ | ||
|
||
Usage: Start the Docker container and run the `./download.sh` script as follows: | ||
|
||
``` | ||
./download.sh <MAVEN_ARTIFACT_ID> <OUTPUT_DIRECTORY> | ||
``` | ||
|
||
The script will download the artifact without version to the output directory. E.g.: | ||
|
||
``` | ||
./download.sh de.aservo:confapi-crowd-plugin:0.0.8:jar ./plugins | ||
``` | ||
|
||
This will result in: | ||
|
||
``` | ||
$ ls ./plugins | ||
confapi-crowd-plugin.jar | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
ARTIFACT=$1 | ||
OUTPUT=$2 | ||
|
||
DEPENDENCY="org.apache.maven.plugins:maven-dependency-plugin:3.1.2" | ||
|
||
mvn $DEPENDENCY:get -Dartifact=$ARTIFACT -Dtransitive=false -B | ||
mvn $DEPENDENCY:copy -Dartifact=$ARTIFACT -DoutputDirectory=$OUTPUT -Dmdep.stripVersion=true -B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>de.aservo</groupId> | ||
<artifactId>stub</artifactId> | ||
<version>0.0.0</version> | ||
|
||
</project> |