Skip to content

Commit

Permalink
ready to release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tamada committed Dec 3, 2019
1 parent 20c494e commit f785f6c
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 38 deletions.
46 changes: 31 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,49 @@
FROM maven:3.6.3-jdk-11 AS maven
# building minimal jdk
FROM alpine:3.10.1 AS base

RUN git clone https://github.com/tamada/pochi.git \
&& cd pochi
&& mvn package
&& unzip distribution/target/pochi-1.0.0-dist.zip -d ../
&& /usr/local/openjdk-11/bin/jlink \
--module-path /usr/local/openjdk-11/jmods \
RUN apk --no-cache add openjdk11=11.0.4_p4-r1 \
&& rm -rf /var/cache/apk/* \
&& /usr/lib/jvm/java-11-openjdk/bin/jlink \
--module-path /usr/lib/jvm/java-11-openjdk/jmods \
--compress=2 \
--add-modules java.base,java.scripting.java.logging,java.xml,jdk.zipfs,jdk.scripting.nashorn,jdk.scripting.nashorn.shell \
--add-modules java.base,java.scripting,java.logging,java.xml,jdk.zipfs,jdk.scripting.nashorn,jdk.scripting.nashorn.shell \
--no-header-files \
--no-man-pages \
--output /usr/src/mymaven/openjdk-11-minimal
--output /opt/openjdk-11-minimal

# building pochi
FROM maven:3.6.3-jdk-11 AS maven

ARG pochi_version="1.0.0"

RUN git clone https://github.com/tamada/pochi.git /usr/src/mymaven/pochi \
&& cd /usr/src/mymaven/pochi \
&& git checkout -b v${pochi_version} refs/tags/v${pochi_version} \
&& mvn package \
&& unzip distribution/target/pochi-${pochi_version}-dist.zip -d /usr/src/mymaven

# building distributed docker image.
FROM alpine:3.10.1

## Is ARG binded to FROM?
ARG pochi_version="1.0.0"

LABEL maintainer="Haruaki Tamada" \
pochi-version="1.0.0" \
pochi-version="${pochi_version}" \
description="Java birthmarking toolkit."

COPY --from=maven /usr/src/mymaven/openjdk-11-minimal /opt/openjdk-11-minimal
COPY --from=maven /usr/src/mymaven/pochi-1.0.0 /home/pochi
COPY --from=base /opt/openjdk-11-minimal /opt/openjdk-11-minimal
COPY --from=maven /usr/src/mymaven/pochi-${pochi_version} /opt/pochi-${pochi_version}

RUN adduser -D pochi \
&& chmod 755 /home/pochi/bin/pochi
&& chmod 755 /opt/pochi-${pochi_version}/bin/pochi

ENV POCHI_HOME="/opt/pochi-${pochi_version}"
ENV JAVA_HOME="/opt/openjdk-11-minimal"
ENV PATH="$PATH:$JAVA_HOME/bin"
ENV PATH="$PATH:$JAVA_HOME/bin:/opt/pochi-${pochi_version}/bin"
ENV HOME="/home/pochi"

WORKDIR /home/pochi
USER pochi

ENTRYPOINT [ "9rules.sh" ]
ENTRYPOINT [ "pochi" ]
19 changes: 19 additions & 0 deletions Memorandum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Memorandum

## version up

update each `pom.xml`, and `bin/pochi`

we can update to development (`X.Y.Z**-SNAPSHOT**`) version, run `versions:set`, and `versions:commit` goals of maven like the following.
If we want to rollback after `versions:set`, we can revert with using `versions:revert` goal.

```sh
mvn versions:set -DnewVersion=1.1.0-SNAPSHOT
mvn versions:commit
```

## debugging docker

```sh
docker run -it --rm --entrypoint="/bin/ash" tamada/pochi:1.0.0
```
6 changes: 4 additions & 2 deletions bin/pochi
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#! /bin/sh

VERSION=1.0-SNAPSHOT
POCHI_HOME=/home/pochi
VERSION=1.0.0
if [ -z "$POCHI_HOME" ]; then
POCHI_HOME=/usr/local/Cellar/pochi/${VERSION}
fi

java -jar $POCHI_HOME/lib/pochi-${VERSION}-all.jar $@
12 changes: 6 additions & 6 deletions distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
</parent>

<groupId>jp.cafebabe.pochi</groupId>
Expand All @@ -17,31 +17,31 @@
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>kunai2</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>nasubi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>pochi-api</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>pochi-core</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>pochi-cli</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions izumo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -19,7 +19,7 @@
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>pochi-api</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions kunai2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -19,7 +19,7 @@
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>nasubi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion millstone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
</parent>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>millstone</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion nasubi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions pochi-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
</parent>

<groupId>jp.cafebabe.pochi</groupId>
Expand All @@ -33,7 +33,7 @@
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>kunai2</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions pochi-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -19,7 +19,7 @@
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>pochi-core</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
8 changes: 4 additions & 4 deletions pochi-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -20,19 +20,19 @@
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>kunai2</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>pochi-api</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jp.cafebabe.pochi</groupId>
<artifactId>izumo</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>jp.cafebabe</groupId>
<artifactId>pochi</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>
<packaging>pom</packaging>

<modules>
Expand Down

0 comments on commit f785f6c

Please sign in to comment.