Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docker/Dockerfile.allvcs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM vladistan/autorevision:latest
RUN apk update && apk add subversion bzr mercurial
WORKDIR /app
ENTRYPOINT ["/usr/local/bin/autorevision"]
14 changes: 14 additions & 0 deletions docker/Dockerfile.git
Original file line number Diff line number Diff line change
@@ -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"]
58 changes: 58 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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:[email protected]"
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
```