Skip to content

Commit

Permalink
Fix deb package
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Aug 26, 2022
1 parent 7f3e01c commit c7ed194
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ BUILDIMG:=docker-credential-secretservice-$(VERSION)
deb:
mkdir -p release
docker build -f deb/Dockerfile \
--build-arg VERSION=$(VERSION) \
--build-arg DISTRO=xenial \
--build-arg VERSION=$(patsubst v%,%,$(VERSION)) \
--build-arg REVISION=$(REVISION) \
--tag $(BUILDIMG) \
.
docker run --rm --net=none $(BUILDIMG) tar cf - /release | tar xf -
Expand Down
28 changes: 22 additions & 6 deletions deb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
FROM ubuntu:xenial
ARG GO_VERSION=1.18.5
ARG DISTRO=ubuntu
ARG SUITE=focal

ARG VERSION
ARG DISTRO
FROM golang:${GO_VERSION}-buster AS golang

FROM ${DISTRO}:${SUITE}

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

WORKDIR /build
ENV GOPATH /build
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH=/build
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
COPY --from=golang /usr/local/go /usr/local/go

COPY Makefile .
COPY credentials credentials
Expand All @@ -16,4 +24,12 @@ COPY pass pass
COPY deb/debian ./debian
COPY deb/build-deb .

RUN /build/build-deb ${VERSION} ${DISTRO}
ARG VERSION
ENV VERSION=${VERSION}
ARG REVISION
ENV REVISION=${REVISION}
ARG DISTRO
ENV DISTRO=${DISTRO}
ARG SUITE
ENV SUITE=${SUITE}
RUN /build/build-deb
8 changes: 2 additions & 6 deletions deb/build-deb
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#!/usr/bin/env bash
set -x
set -e

version=$1
distro=$2
set -ex

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

cat > "debian/changelog" <<-EOF
docker-credential-helpers ($version) $DISTRO; urgency=low
docker-credential-helpers ($VERSION) $DISTRO-$SUITE; urgency=low
* New upstream version
Expand Down
3 changes: 2 additions & 1 deletion deb/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
DESTDIR := $(CURDIR)/debian/tmp

override_dh_auto_build:
make secretservice pass
make build-secretservice DESTDIR=bin
make build-pass DESTDIR=bin

override_dh_auto_install:
install -D bin/docker-credential-secretservice $(DESTDIR)/usr/bin/docker-credential-secretservice
Expand Down

0 comments on commit c7ed194

Please sign in to comment.