NoIssue: Fix for build, run and publish
This commit is contained in:
@@ -46,7 +46,7 @@ java {
|
||||
toolchain { languageVersion.set(JavaLanguageVersion.of(25)) }
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.release.set(25)
|
||||
options.compilerArgs.add("--enable-preview")
|
||||
}
|
||||
@@ -57,7 +57,7 @@ tasks.register<Sync>("prepareLibs") {
|
||||
group = "distribution"
|
||||
description = "Copies runtime deps to build/libs without deleting the app jar"
|
||||
|
||||
val jarTask = tasks.named<Jar>("jar")
|
||||
val jarTask = tasks.named<Jar>("jar")
|
||||
dependsOn(jarTask)
|
||||
|
||||
into(libsDir)
|
||||
|
||||
12
build.sh
12
build.sh
@@ -13,13 +13,14 @@ export VERSION_LONG=${VERSION}_${GITHASH}
|
||||
|
||||
# Build this artifact
|
||||
echo "Building 'NenjimKicker v${VERSION_LONG}'..."
|
||||
./gradlew -Pversion=$VERSION jar prepareDockerLibs
|
||||
./gradlew -Pversion=$VERSION jar prepareLibs
|
||||
|
||||
# Prepare container dependencies
|
||||
mkdir -p build/docker/conf
|
||||
mkdir -p build/docker/{conf,libs}
|
||||
cd build/docker
|
||||
cp ../../src/main/docker/start.sh start.sh
|
||||
cp ../libs/kicker-impl-ref-*.jar libs
|
||||
cp ../../conf/* conf
|
||||
cp ../../src/main/docker/run.sh run.sh
|
||||
cp ../libs/*.jar libs/
|
||||
cp ../../conf/* conf/
|
||||
sed -e "s|_VERSION_|${VERSION}|g" \
|
||||
-e "s|_JREVERSION_|${JREVERSION}|g" \
|
||||
../../src/main/docker/Dockerfile_template > Dockerfile
|
||||
@@ -32,7 +33,6 @@ HASHTAG=${BASETAG}:${GITHASH}_amd64
|
||||
VERSIONTAG=${BASETAG}:${VERSION}_amd64
|
||||
LATESTTAG=${BASETAG}:latest_amd64
|
||||
CANONICALNAME=${HASHTAG}
|
||||
|
||||
docker build -t ${CANONICALNAME} .
|
||||
docker tag ${CANONICALNAME} ${VERSIONTAG}
|
||||
docker tag ${CANONICALNAME} ${LATESTTAG}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
export VERSION=$(git describe --tags --exact-match 2>/dev/null \
|
||||
|| git symbolic-ref --short -q HEAD \
|
||||
|| git rev-parse --short HEAD)
|
||||
|
||||
echo "Building and publishing (CI/CD) $VERSION..."
|
||||
./gradlew -Pversion=$VERSION publish
|
||||
1
publishCICD.sh
Symbolic link
1
publishCICD.sh
Symbolic link
@@ -0,0 +1 @@
|
||||
publish.sh
|
||||
6
run.sh
6
run.sh
@@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
./gradlew run \
|
||||
-Dlog4j.configurationFile="$PWD/config/log4j2.xml" \
|
||||
--args="foo bar baz"
|
||||
@@ -13,7 +13,7 @@ WORKDIR nenjimkicker
|
||||
RUN mkdir libs
|
||||
|
||||
# These dirs are expected to be overshadowed by host mounts
|
||||
RUN mkdir conf logs
|
||||
RUN mkdir conf logs && chown user:user logs
|
||||
|
||||
# Set timezone
|
||||
ENV TZ=Europe/Copenhagen
|
||||
@@ -29,14 +29,14 @@ RUN apt-get autoremove -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install application and configuration (Do this as late as possible to be able to reuse layers between builds)
|
||||
COPY start.sh .
|
||||
COPY run.sh .
|
||||
COPY conf/* conf/
|
||||
COPY libs/*.jar libs/
|
||||
|
||||
RUN chmod 755 ./start.sh \
|
||||
RUN chmod 755 ./run.sh \
|
||||
&& chmod -R a+rX /usr/local/software/nenjimkicker-_VERSION_
|
||||
|
||||
USER user:user
|
||||
|
||||
CMD ["./start.sh"]
|
||||
CMD ["./run.sh"]
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ fi
|
||||
CLASSPATH=$(IFS=:; echo "${jars[*]}")
|
||||
|
||||
exec java \
|
||||
-Dlog4j.configurationFile=/usr/local/software/nenjimkicker/conf/log4j2.xml \
|
||||
-Dlog4j.configurationFile=conf/log4j2.xml \
|
||||
-cp "$CLASSPATH" \
|
||||
com.r35157.nenjim.kicker.impl.ref.Main
|
||||
Reference in New Issue
Block a user