This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM openjdk:8 AS build | ||
|
||
ARG CLI_VERSION="0.3.0" | ||
ARG RELEASE_TYPE="tag" | ||
|
||
COPY files /tmp | ||
RUN chmod +x /tmp/fetch-source.sh && \ | ||
/tmp/fetch-source.sh ${CLI_VERSION} ${RELEASE_TYPE} | ||
|
||
WORKDIR /tmp/apiman-cli | ||
RUN chmod +x /tmp/apiman-cli/gradlew && \ | ||
./gradlew shadowJar | ||
|
||
FROM openjdk:8-jre-alpine | ||
|
||
RUN mkdir -p /opt/apiman-cli/lib | ||
COPY --from=build /tmp/apiman-cli/build/libs/* /opt/apiman-cli/lib/ | ||
|
||
ENTRYPOINT [ "java", "-jar", "/opt/apiman-cli/lib/apiman-cli.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,26 @@ | ||
apiman cli | ||
========== | ||
|
||
## Usage | ||
|
||
To use apiman CLI | ||
|
||
docker run -it apiman/cli [args] | ||
|
||
For valid arguments, please see the documentation for [apiman CLI](https://github.com/apiman/apiman-cli) | ||
|
||
## Building the image | ||
|
||
docker build -t="apiman/cli" --rm . | ||
|
||
### Building from a branch | ||
|
||
If you're a developer working on this project, or you want the latest edge version, you can build from a branch of the apiman-cli repository. | ||
|
||
To do this, specify the RELEASE_TYPE as 'branch' and the CLI_VERSION as the branch name: | ||
|
||
docker build -t="apiman/cli:beta" --build-arg RELEASE_TYPE=branch --build-arg CLI_VERSION="develop" --rm . | ||
|
||
## Image accessible on Docker hub | ||
|
||
This image is automatically built and published into [Docker Hub](https://registry.hub.docker.com/u/apiman/cli/). |
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,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [[ $# -lt 2 ]]; then | ||
echo "Usage: $( basename $0 ) <CLI_VERSION> <RELEASE_TYPE>" | ||
exit 1 | ||
fi | ||
|
||
CLI_VERSION="$1" | ||
RELEASE_TYPE="$2" | ||
|
||
case "${RELEASE_TYPE}" in | ||
tag) | ||
SOURCE_URL="https://codeload.github.com/apiman/apiman-cli/zip/v${CLI_VERSION}" | ||
;; | ||
branch) | ||
SOURCE_URL="https://codeload.github.com/apiman/apiman-cli/zip/${CLI_VERSION}" | ||
;; | ||
*) | ||
echo "Release type must be branch or tag" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo -e "Downloading source from: ${SOURCE_URL}" | ||
curl -s ${SOURCE_URL} -o /tmp/apiman-cli.zip | ||
|
||
unzip /tmp/apiman-cli.zip -d /tmp | ||
mv /tmp/apiman-cli-* /tmp/apiman-cli |