Skip to content

Commit 48ab0d8

Browse files
committed
Fix deb package
Signed-off-by: CrazyMax <[email protected]>
1 parent e50298d commit 48ab0d8

File tree

4 files changed

+28
-15
lines changed

4 files changed

+28
-15
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ BUILDIMG:=docker-credential-secretservice-$(VERSION)
7979
deb:
8080
mkdir -p release
8181
docker build -f deb/Dockerfile \
82-
--build-arg VERSION=$(VERSION) \
83-
--build-arg DISTRO=xenial \
82+
--build-arg VERSION=$(patsubst v%,%,$(VERSION)) \
83+
--build-arg REVISION=$(REVISION) \
8484
--tag $(BUILDIMG) \
8585
.
8686
docker run --rm --net=none $(BUILDIMG) tar cf - /release | tar xf -

deb/Dockerfile

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
FROM ubuntu:xenial
1+
ARG GO_VERSION=1.18.5
2+
ARG DISTRO=ubuntu
3+
ARG SUITE=focal
24

3-
ARG VERSION
4-
ARG DISTRO
5+
FROM golang:${GO_VERSION}-buster AS golang
6+
7+
FROM ${DISTRO}:${SUITE}
58

6-
RUN apt-get update && apt-get install -yy debhelper dh-make golang-go libsecret-1-dev
9+
ARG DEBIAN_FRONTEND=noninteractive
10+
RUN apt-get update && apt-get install -yy debhelper dh-make libsecret-1-dev
711
RUN mkdir -p /build
812

913
WORKDIR /build
10-
ENV GOPATH /build
14+
ENV GOPROXY=https://proxy.golang.org|direct
15+
ENV GO111MODULE=off
16+
ENV GOPATH=/build
17+
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
18+
COPY --from=golang /usr/local/go /usr/local/go
1119

1220
COPY Makefile .
1321
COPY credentials credentials
@@ -16,4 +24,12 @@ COPY pass pass
1624
COPY deb/debian ./debian
1725
COPY deb/build-deb .
1826

19-
RUN /build/build-deb ${VERSION} ${DISTRO}
27+
ARG VERSION
28+
ENV VERSION=${VERSION}
29+
ARG REVISION
30+
ENV REVISION=${REVISION}
31+
ARG DISTRO
32+
ENV DISTRO=${DISTRO}
33+
ARG SUITE
34+
ENV SUITE=${SUITE}
35+
RUN /build/build-deb

deb/build-deb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
#!/usr/bin/env bash
2-
set -x
3-
set -e
4-
5-
version=$1
6-
distro=$2
2+
set -ex
73

84
maintainer=$(awk -F ': ' '$1 == "Maintainer" { print $2; exit }' debian/control)
95

106
cat > "debian/changelog" <<-EOF
11-
docker-credential-helpers ($version) $DISTRO; urgency=low
7+
docker-credential-helpers ($VERSION) $DISTRO-$SUITE; urgency=low
128
139
* New upstream version
1410

deb/debian/rules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
DESTDIR := $(CURDIR)/debian/tmp
44

55
override_dh_auto_build:
6-
make secretservice pass
6+
make build-secretservice DESTDIR=bin
7+
make build-pass DESTDIR=bin
78

89
override_dh_auto_install:
910
install -D bin/docker-credential-secretservice $(DESTDIR)/usr/bin/docker-credential-secretservice

0 commit comments

Comments
 (0)