Skip to content

Commit 1af6e4e

Browse files
committed
Initial commit
0 parents  commit 1af6e4e

File tree

7 files changed

+266
-0
lines changed

7 files changed

+266
-0
lines changed

.gitignore

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
### Node ###
2+
# Logs
3+
logs
4+
*.log
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
*.pid.lock
14+
15+
# Directory for instrumented libs generated by jscoverage/JSCover
16+
lib-cov
17+
18+
# Coverage directory used by tools like istanbul
19+
coverage
20+
21+
# nyc test coverage
22+
.nyc_output
23+
24+
# node-waf configuration
25+
.lock-wscript
26+
27+
# Compiled binary addons (http://nodejs.org/api/addons.html)
28+
build/Release
29+
30+
# Dependency directories
31+
node_modules
32+
jspm_packages/
33+
34+
# Typescript v1 declaration files
35+
typings/
36+
37+
# Optional npm cache directory
38+
.npm
39+
40+
# Optional eslint cache
41+
.eslintcache
42+
43+
# Optional REPL history
44+
.node_repl_history
45+
46+
# Output of 'npm pack'
47+
*.tgz
48+
49+
# Yarn Integrity file
50+
.yarn-integrity
51+
52+
# dotenv environment variables file
53+
.env
54+
55+
### SublimeText ###
56+
# cache files for sublime text
57+
*.tmlanguage.cache
58+
*.tmPreferences.cache
59+
*.stTheme.cache
60+
61+
# workspace files are user-specific
62+
*.sublime-workspace
63+
64+
# project files should be checked into the repository, unless a significant
65+
# proportion of contributors will probably not be using SublimeText
66+
# *.sublime-project
67+
68+
# sftp configuration file
69+
sftp-config.json
70+
71+
# Package control specific files
72+
Package Control.last-run
73+
Package Control.ca-list
74+
Package Control.ca-bundle
75+
Package Control.system-ca-bundle
76+
Package Control.cache/
77+
Package Control.ca-certs/
78+
Package Control.merged-ca-bundle
79+
Package Control.user-ca-bundle
80+
oscrypto-ca-bundle.crt
81+
bh_unicode_properties.cache
82+
83+
# Sublime-github package stores a github token in this file
84+
# https://packagecontrol.io/packages/sublime-github
85+
GitHub.sublime-settings
86+
87+
### Vim ###
88+
# swap
89+
.sw[a-p]
90+
.*.sw[a-p]
91+
# session
92+
Session.vim
93+
# temporary
94+
.netrwhist
95+
*~
96+
# auto-generated tag files
97+
tags

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM alpine:3.10@sha256:6a92cd1fcdc8d8cdec60f33dda4db2cb1fcdcacf3410a8e05b3741f44a9b5998 AS builder
2+
3+
ENV GIT_CRYPT_VERSION 0.6.0
4+
ENV GIT_CRYPT_CHECKSUM 777c0c7aadbbc758b69aff1339ca61697011ef7b92f1d1ee9518a8ee7702bb78
5+
6+
RUN apk --update --no-cache add \
7+
curl \
8+
g++ \
9+
make \
10+
openssl-dev
11+
12+
RUN curl -fSsL https://github.com/AGWA/git-crypt/archive/$GIT_CRYPT_VERSION.tar.gz \
13+
-o git-crypt.tar.gz \
14+
&& echo "$GIT_CRYPT_CHECKSUM git-crypt.tar.gz" | sha256sum -c - \
15+
&& tar xzf git-crypt.tar.gz \
16+
&& cd git-crypt-$GIT_CRYPT_VERSION \
17+
&& make \
18+
&& make install PREFIX=/usr
19+
20+
FROM alpine:3.10@sha256:6a92cd1fcdc8d8cdec60f33dda4db2cb1fcdcacf3410a8e05b3741f44a9b5998
21+
22+
RUN apk --update --no-cache add \
23+
git \
24+
gnupg \
25+
libgcc \
26+
libstdc++
27+
28+
COPY --from=builder /usr/bin/git-crypt /usr/bin/git-crypt
29+
30+
COPY entrypoint.sh /entrypoint.sh
31+
32+
WORKDIR /repo
33+
ENTRYPOINT ["/entrypoint.sh"]

LICENSE

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Copyright 2019 reelport GmbH
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4+
associated documentation files (the "Software"), to deal in the Software without restriction,
5+
including without limitation the rights to use, copy, modify, merge, publish, distribute,
6+
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7+
furnished to do so, subject to the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included in all copies or
10+
substantial portions of the Software.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
13+
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
16+
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Docker Image with git-crypt
2+
3+
[![CircleCI Build](https://circleci.com/gh/PicturePipe/docker-git-crypt.svg?style=shield)](https://circleci.com/gh/PicturePipe/workflows/docker-git-crypt "CircleCI Build")
4+
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovateapp.com/ "Renovate enabled")
5+
6+
[Docker](https://www.docker.com) image with [git-crypt](https://github.com/AGWA/git-crypt).
7+
8+
## Repository
9+
10+
The docker images are available in our [repository](https://quay.io/repository/picturepipe/git-crypt):
11+
12+
```console
13+
docker pull quay.io/picturepipe/git-crypt
14+
```
15+
16+
## Usage
17+
18+
This image can be used directly if you need to decrypt repositories in CI.
19+
20+
There is also wrapper script which allows you to use this docker image to run `git-crypt` as if
21+
it was installed on your machine.
22+
23+
To use that script, install it somewhere into your `PATH`:
24+
25+
```console
26+
sudo cp wrapper.sh /usr/local/bin/git-crypt
27+
```
28+
29+
## Tags
30+
31+
The latest released version is tagged as `latest`.
32+
33+
The releases will follow the upstream version, with an optional dash and number appended, if there
34+
are multiple releases per upstream version.
35+
36+
So for example, the first release for upstream version `0.6.0` will be tagged `0.6.0`. If there
37+
is a second release for this upstream version, it will be tagged `0.6.0-1`.
38+
39+
## Preparing a release
40+
41+
This project uses gitflow. To create a release, first start the release branch for the version
42+
which you want to release:
43+
44+
```console
45+
git flow release start 0.6.0
46+
```
47+
48+
Perform any release related changes. At the very least, this means updating the current tag given in
49+
`README.md`.
50+
51+
Now, publish the release:
52+
53+
```console
54+
git flow release publish
55+
```
56+
57+
This will push the branch to GitHub and trigger a run of CI. Once CI is complete and all tests have
58+
passed, finish the release and push the tag to GitHub:
59+
60+
```console
61+
git flow release finish --push --tag
62+
```
63+
64+
## License
65+
66+
Distributed under the MIT license.
67+
68+
Copyright 2019 reelport GmbH

entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
#
4+
# Execute git-crypt with argv[0] set to "git-crypt". Otherwise it will
5+
# show /usr/bin/git-crypt in usage and also install this full path into
6+
# the host's git-config, which is not necessarily the location where the
7+
# wrapper script is installed.
8+
#
9+
exec -a "git-crypt" /usr/bin/git-crypt "$@"

renovate.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["github>PicturePipe/renovate-config"]
3+
}

wrapper.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
#
3+
# This wrapper is intended to be installed in PATH e.g. as /usr/local/bin/git-crypt
4+
#
5+
# It allows to use git-crypt using the docker image.
6+
#
7+
8+
set -e
9+
10+
#
11+
# On some calls, git will pass along a temporary file to git-crypt.
12+
# For this to work, we need to mount this file into the container.
13+
#
14+
if [ -n "$2" ] && [ "${2:0:1}" = "/" ]; then
15+
DOCKER_OPTS="--volume=$2:$2"
16+
fi
17+
18+
#
19+
# If the current user has GnuPG configured, pass the GnuPG directory
20+
# into the container so that the keyring and/or agent can be accessed.
21+
#
22+
if [ -d "$HOME/.gnupg" ]; then
23+
DOCKER_OPTS="$DOCKER_OPTS --volume=$HOME/.gnupg:/.gnupg"
24+
fi
25+
26+
#
27+
# Unlocking the repository might require usage of pinentry which fails
28+
# if is not run with a terminal.
29+
#
30+
if [ x"$1" = x"unlock" ]; then
31+
DOCKER_OPTS="$DOCKER_OPTS -t"
32+
fi
33+
34+
exec docker run \
35+
--rm \
36+
--interactive \
37+
--user=$(id -u):$(id -g) \
38+
--volume="$(pwd)":/repo \
39+
${DOCKER_OPTS} \
40+
quay.io/picturepipe/git-crypt "$@"

0 commit comments

Comments
 (0)