-
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 example and more README contents
- Loading branch information
1 parent
6fdd61c
commit 4ffa1aa
Showing
4 changed files
with
42 additions
and
6 deletions.
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
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,15 @@ | ||
# Build the service executable in a "development" container | ||
FROM alpine:3.18 as build | ||
|
||
RUN apk add --no-cache openjdk11 | ||
COPY Version.java /Version.java | ||
RUN javac Version.java | ||
|
||
# Create a new image with microwrap as the base to serve as our runtime image | ||
FROM michionlion/microwrap:0.1 | ||
# Install runtime dependency | ||
RUN apk add --no-cache openjre11 | ||
# Configure microwrap | ||
COPY microwrap.json /microwrap.json | ||
# Copy the executable from the build image | ||
COPY --from=build /Version.class /Version.class |
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 @@ | ||
package example; | ||
|
||
public class Version { | ||
public static void main(String[] args) { | ||
var VERSION = "1.0.0"; | ||
if (String.join(" ", args).contains("--include-build")) { | ||
VERSION += "-b4"; | ||
} | ||
System.out.println(VERSION); | ||
} | ||
} |
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,9 +1,15 @@ | ||
#!/bin/sh | ||
|
||
VERSION="1.0.0" | ||
USE_JAVA=true | ||
|
||
if [ "$1" == "--include-build" ]; then | ||
VERSION="$VERSION-b4" | ||
fi | ||
if [ "$USE_JAVA" == "true" ]; then | ||
java Version.class | ||
else | ||
VERSION="1.0.0" | ||
|
||
if [ "$1" == "--include-build" ]; then | ||
VERSION="$VERSION-b4" | ||
fi | ||
|
||
echo "$VERSION" | ||
echo "$VERSION" | ||
fi |