From 6d6e5f98aeedd5ce980ceb1a1fd7562f47b9f293 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Thu, 28 Mar 2019 18:22:45 -0400 Subject: [PATCH 1/4] [skyapi] [docker] refs #18 Added Dockerfile to wrapper --- lib/skyapi/Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 lib/skyapi/Dockerfile diff --git a/lib/skyapi/Dockerfile b/lib/skyapi/Dockerfile new file mode 100644 index 0000000..496c06a --- /dev/null +++ b/lib/skyapi/Dockerfile @@ -0,0 +1,9 @@ +FROM maven:latest + +RUN apt-get update && apt-get --assume-yes install openjdk-8-jdk-headless +RUN apt-get install --assume-yes openjdk-8-jdk +COPY . /usr/src/skyapi +WORKDIR /usr/src/skyapi + +RUN mvn clean install +CMD [] From d8a638a7f2b6e9372e5bca6cba408392036bf2b1 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Thu, 28 Mar 2019 18:49:15 -0400 Subject: [PATCH 2/4] [skyapi] [docker] refs #18 Updated dockerfile for wrapper, changed base image to maven:3-jdk-8 --- lib/skyapi/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/skyapi/Dockerfile b/lib/skyapi/Dockerfile index 496c06a..c76f3d7 100644 --- a/lib/skyapi/Dockerfile +++ b/lib/skyapi/Dockerfile @@ -1,9 +1,9 @@ -FROM maven:latest +FROM maven:3-jdk-8 -RUN apt-get update && apt-get --assume-yes install openjdk-8-jdk-headless -RUN apt-get install --assume-yes openjdk-8-jdk +#RUN apt-get update && apt-get --assume-yes install openjdk-8-jdk-headless +#RUN apt-get install --assume-yes openjdk-8-jdk COPY . /usr/src/skyapi WORKDIR /usr/src/skyapi -RUN mvn clean install +RUN mvn clean install -X CMD [] From d1d507947cc527a327ed440c5fb428c9b1acb624 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Wed, 3 Apr 2019 15:29:06 -0400 Subject: [PATCH 3/4] [skyapi] refs #18 Added Dockerfile with maven --- .../images/dev-cli}/Dockerfile | 7 +-- docker/images/dev-cli/README.md | 49 +++++++++++++++++++ docker/images/dev-cli/hooks/build | 43 ++++++++++++++++ docker/images/dev-cli/hooks/push | 9 ++++ 4 files changed, 103 insertions(+), 5 deletions(-) rename {lib/skyapi => docker/images/dev-cli}/Dockerfile (59%) create mode 100644 docker/images/dev-cli/README.md create mode 100755 docker/images/dev-cli/hooks/build create mode 100755 docker/images/dev-cli/hooks/push diff --git a/lib/skyapi/Dockerfile b/docker/images/dev-cli/Dockerfile similarity index 59% rename from lib/skyapi/Dockerfile rename to docker/images/dev-cli/Dockerfile index 496c06a..9307829 100644 --- a/lib/skyapi/Dockerfile +++ b/docker/images/dev-cli/Dockerfile @@ -1,9 +1,6 @@ FROM maven:latest -RUN apt-get update && apt-get --assume-yes install openjdk-8-jdk-headless -RUN apt-get install --assume-yes openjdk-8-jdk -COPY . /usr/src/skyapi +RUN apt-get update && apt-get --assume-yes install openjdk-8-jdk-headless && apt-get install --assume-yes openjdk-8-jdk WORKDIR /usr/src/skyapi - +COPY ./lib/skyapi . RUN mvn clean install -CMD [] diff --git a/docker/images/dev-cli/README.md b/docker/images/dev-cli/README.md new file mode 100644 index 0000000..010c033 --- /dev/null +++ b/docker/images/dev-cli/README.md @@ -0,0 +1,49 @@ +# Supported tags and respective `Dockerfile` links + +## Simple Tags + +- [`develop, dind, vscode, vscode-dind` (*docker/images/dev-cli/Dockerfile*)](https://github.com/simelo/libskycoin-dotnet/blob/develop/docker/images/dev-cli/Dockerfile) + +# LibJava-Skycoin .NET CLI development image + +This image has the necessary tools to build, test, edit, lint and version the Libskycoin .NET +source code. It comes with Vim editor installed, along with some plugins +to ease go development and version control with git. + +# How to use this image + +## Initialize your development environment. + +```sh +$ mkdir src +$ docker run --rm \ + -v ${PWD}/src:/usr/local/src skycoin/skycoindev-java:develop \ + git clone https://github.com/simelo/libjava-skycoin.git \ +$ sudo chown -R `whoami` src +``` + +This downloads the libjava source to src/libjav and changes the owner +to your user. This is necessary, because all processes inside the container run +as root and the files created by it are therefore owned by root. + +## Running commands inside the container + +You can run commands by just passing the them to the image. Everything is run +in a container and deleted when finished. + +### Running tests + +```sh +$ docker run --rm \ + -v ${PWD}/src:/usr/local/src simelotech/skycoindev-java:develop \ + sh -c "cd libskycoin-java; make test" +``` + +### Editing code + +```sh +$ docker run --rm \ + -v ${PWD}/src:/usr/local/src simelotech/skycoindev-java:develop \ + vim +``` + diff --git a/docker/images/dev-cli/hooks/build b/docker/images/dev-cli/hooks/build new file mode 100755 index 0000000..3413e18 --- /dev/null +++ b/docker/images/dev-cli/hooks/build @@ -0,0 +1,43 @@ +#!/bin/bash + +# This are the git ENV vars present at this point for the build process. +# more on that in https://docs.docker.com/docker-cloud/builds/advanced +# +# SOURCE_BRANCH: the name of the branch or the tag that is currently being tested. +# SOURCE_COMMIT: the SHA1 hash of the commit being tested. +# COMMIT_MSG: the message from the commit being tested and built. +# DOCKERFILE_PATH: the dockerfile currently being built. +# DOCKER_REPO: the name of the Docker repository being built. +# CACHE_TAG: the Docker repository tag being built. +# IMAGE_NAME: the name and tag of the Docker repository being built. +# (This variable is a combination of DOCKER_REPO:CACHE_TAG.) + +echo "Build hook running" + +# Build :develop tag +docker build --build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg SCOMMIT=$SOURCE_COMMIT \ + -f $DOCKERFILE_PATH \ + -t "$IMAGE_NAME" . + +# Build :dind, :vscode and :vscode-dind tag +# Only build if +if [ "$CACHE_TAG" -eq "develop" ]; then + docker build --build-arg IMAGE_FROM="skycoin/skycoindev-cli:dind" \ + --build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg SCOMMIT=$SOURCE_COMMIT \ + -f $DOCKERFILE_PATH \ + -t "$DOCKER_REPO:dind" . + + docker build --build-arg IMAGE_FROM="skycoin/skycoindev-vscode:develop" \ + --build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg SCOMMIT=$SOURCE_COMMIT \ + -f $DOCKERFILE_PATH \ + -t "$DOCKER_REPO:vscode" . + + docker build --build-arg IMAGE_FROM="skycoin/skycoindev-vscode:dind" \ + --build-arg BDATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg SCOMMIT=$SOURCE_COMMIT \ + -f $DOCKERFILE_PATH \ + -t "$DOCKER_REPO:vscode-dind" . +fi diff --git a/docker/images/dev-cli/hooks/push b/docker/images/dev-cli/hooks/push new file mode 100755 index 0000000..1d02a40 --- /dev/null +++ b/docker/images/dev-cli/hooks/push @@ -0,0 +1,9 @@ +#!/bin/bash + +docker push $IMAGE_NAME + +if [ "$CACHE_TAG" -eq "develop" ]; then + docker push $DOCKER_REPO:dind + docker push $DOCKER_REPO:vscode + docker push $DOCKER_REPO:vscode-dind +fi From e87adf85b4a67536616452f6c7174f8b678fbb35 Mon Sep 17 00:00:00 2001 From: Marcos Maceo Date: Wed, 10 Apr 2019 19:37:36 -0400 Subject: [PATCH 4/4] [skyapi] refs #18 Removed unused travis --- lib/skyapi/.travis.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 lib/skyapi/.travis.yml diff --git a/lib/skyapi/.travis.yml b/lib/skyapi/.travis.yml deleted file mode 100644 index 80a7f2f..0000000 --- a/lib/skyapi/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -# -# Generated by: https://openapi-generator.tech -# -language: java -jdk: - - oraclejdk8 - - oraclejdk7 -before_install: - # ensure gradlew has proper permission - - chmod a+x ./gradlew -script: - # test using maven - - mvn test - # uncomment below to test using gradle - # - gradle test - # uncomment below to test using sbt - # - sbt test