diff --git a/docker/images/dev-cli/Dockerfile b/docker/images/dev-cli/Dockerfile new file mode 100644 index 0000000..6af6e8d --- /dev/null +++ b/docker/images/dev-cli/Dockerfile @@ -0,0 +1,6 @@ +FROM maven:3-jdk-8 + +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 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 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