@@ -7,6 +7,7 @@ ARG XX_VERSION=1.6.1
7
7
ARG OSXCROSS_VERSION=11.3-r7-debian
8
8
ARG GOLANGCI_LINT_VERSION=v1.64.5
9
9
ARG DEBIAN_FRONTEND=noninteractive
10
+ ARG GOPASS_VERSION=v1.15.5
10
11
11
12
ARG PACKAGE=github.com/docker/docker-credential-helpers
12
13
@@ -70,12 +71,19 @@ RUN xx-apt-get install -y binutils gcc libc6-dev libgcc-11-dev libsecret-1-dev p
70
71
71
72
FROM base AS test
72
73
ARG DEBIAN_FRONTEND
74
+ ARG GOPASS_VERSION
73
75
RUN xx-apt-get install -y dbus-x11 gnome-keyring gpg-agent gpgconf libsecret-1-dev pass
76
+ RUN --mount=type=bind,target=. \
77
+ --mount=type=cache,target=/root/.cache \
78
+ --mount=type=cache,target=/go/pkg/mod \
79
+ GOFLAGS='' go install github.com/gopasspw/gopass@${GOPASS_VERSION}
74
80
RUN --mount=type=bind,target=. \
75
81
--mount=type=cache,target=/root/.cache \
76
82
--mount=type=cache,target=/go/pkg/mod <<EOT
77
83
set -e
84
+
78
85
cp -r .github/workflows/fixtures /root/.gnupg
86
+ chmod 0400 /root/.gnupg
79
87
gpg-connect-agent "RELOADAGENT" /bye
80
88
gpg --import --batch --yes /root/.gnupg/7D851EB72D73BDA0.key
81
89
gpg --update-trustdb
@@ -84,7 +92,20 @@ RUN --mount=type=bind,target=. \
84
92
gpg-connect-agent "KEYINFO 3E2D1142AA59E08E16B7E2C64BA6DDC773B1A627" /bye
85
93
gpg-connect-agent "PRESET_PASSPHRASE BA83FC8947213477F28ADC019F6564A956456163 -1 77697468207374757069642070617373706872617365" /bye
86
94
gpg-connect-agent "KEYINFO BA83FC8947213477F28ADC019F6564A956456163" /bye
95
+
96
+ # initialize password store for `pass`
87
97
pass init 7D851EB72D73BDA0
98
+
99
+ # initialize password store for `gopass`
100
+ gopass config mounts.path /root/.gopass-password-store 1>/dev/null
101
+ gopass config core.autopush false 1>/dev/null
102
+ gopass config core.autosync false 1>/dev/null
103
+ gopass config core.exportkeys false 1>/dev/null
104
+ gopass config core.notifications false 1>/dev/null
105
+ gopass config core.color false 1>/dev/null
106
+ gopass config core.nopager true 1>/dev/null
107
+ gopass init --crypto gpgcli --storage fs 7D851EB72D73BDA0
108
+
88
109
gpg -k
89
110
90
111
mkdir /out
@@ -108,7 +129,8 @@ RUN --mount=type=bind,target=. \
108
129
--mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT
109
130
set -ex
110
131
xx-go --wrap
111
- make build-pass build-secretservice PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
132
+ make build-gopass build-pass build-secretservice PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
133
+ xx-verify /out/docker-credential-gopass
112
134
xx-verify /out/docker-credential-pass
113
135
xx-verify /out/docker-credential-secretservice
114
136
EOT
@@ -125,7 +147,8 @@ RUN --mount=type=bind,target=. \
125
147
export MACOSX_VERSION_MIN=$(make print-MACOSX_DEPLOYMENT_TARGET)
126
148
xx-go --wrap
127
149
go install std
128
- make build-osxkeychain build-pass PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
150
+ make build-gopass build-osxkeychain build-pass PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
151
+ xx-verify /out/docker-credential-gopass
129
152
xx-verify /out/docker-credential-osxkeychain
130
153
xx-verify /out/docker-credential-pass
131
154
EOT
@@ -139,7 +162,9 @@ RUN --mount=type=bind,target=. \
139
162
--mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT
140
163
set -ex
141
164
xx-go --wrap
142
- make build-wincred PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
165
+ make build-gopass build-wincred PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out
166
+ mv /out/docker-credential-gopass /out/docker-credential-gopass.exe
167
+ xx-verify /out/docker-credential-gopass.exe
143
168
mv /out/docker-credential-wincred /out/docker-credential-wincred.exe
144
169
xx-verify /out/docker-credential-wincred.exe
145
170
EOT
0 commit comments