diff --git a/docker/Dockerfile.allvcs b/docker/Dockerfile.allvcs new file mode 100644 index 0000000..6765cc2 --- /dev/null +++ b/docker/Dockerfile.allvcs @@ -0,0 +1,4 @@ +FROM vladistan/autorevision:latest +RUN apk update && apk add subversion bzr mercurial +WORKDIR /app +ENTRYPOINT ["/usr/local/bin/autorevision"] diff --git a/docker/Dockerfile.git b/docker/Dockerfile.git new file mode 100644 index 0000000..6412592 --- /dev/null +++ b/docker/Dockerfile.git @@ -0,0 +1,14 @@ +FROM alpine:3.10 AS builder +RUN apk update && apk add git bash make asciidoc gzip sed +COPY . /build +RUN mkdir -p /build +WORKDIR /build +RUN ls +RUN make install + + + +FROM alpine:3.10 +RUN apk update && apk add git bash +COPY --from=builder /usr/local/bin/autorevision /usr/local/bin +ENTRYPOINT ["/usr/local/bin/autorevision"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..62a1a96 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,58 @@ +# Docker support + +Modern CI/CD practices discourage installing tools on build servers, even +even simple ones like 'AutoRevision'. The preferred method is to use +containers. Using containers have the following advantages: + + * Less things need to be installed on build boxes. + * Can use different versions of tools by different build jobs, without + worrying about version clashes + + +Autorevision containers are available on the docker hub in two flavors. + + 1. Git only container - this container supports only git as the + version control software. It's very lightweight only 26MB. This image + available from Dockerhub as 'vladistan/autorevision:git' + + + + 2. All VCS version - this container supports all version control + software that is supported by autorevision. It's slightly larger + 120MB image. This image available from Dockerhub as 'vladistan/autorevision:allvcs' + + +Here is the example of using AutoRevision containers in the build script: + +``` +$ docker run -w /app -v `pwd`:/app vladistan/autorevision:git -t sh +# Generated by autorevision - do not hand-hack! + +VCS_TYPE="git" +VCS_BASENAME="app" +VCS_UUID="aa7e8f8ee10bb859e4510f846d4d9e93c9977868" +VCS_NUM="734" +VCS_DATE="2019-10-13T20:52:02Z" +VCS_BRANCH="dev" +VCS_TAG="1.9.1" +VCS_TAG_OPENPGP="" +VCS_TICK="8" +VCS_EXTRA="" + +VCS_ACTION_STAMP="2019-10-13T20:52:02Z!vlad@v-lad.org" +VCS_FULL_HASH="3b3f44dc67e18ff9acc54e683895d9f143e48d0b" +VCS_COMMIT_OPENPGP="" +VCS_SHORT_HASH="3b3f44d" + +VCS_WC_MODIFIED="0" + +# end +``` + + +The example above uses GIT only version of the container, if you want to +use it with other type of VCS replace the first line without + +``` +docker run -w /app -v `pwd`:/app vladistan/autorevision:allvcs -t sh +```