Compare commits

...

8 Commits
6.0.1 ... 6.0.3

Author SHA1 Message Date
Stefan Prodan
ea292aa958 Merge pull request #160 from stefanprodan/release-6.0.3
Release v6.0.3
2021-10-21 17:50:42 +03:00
Stefan Prodan
33fa856b63 Release v6.0.3
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-21 17:45:33 +03:00
Stefan Prodan
6065c5aa79 Merge pull request #159 from stefanprodan/tonistiigi/xx
Use tonistiigi/xx for multi-arch builds
2021-10-21 17:44:21 +03:00
Stefan Prodan
0771a597e6 Use tonistiigi/xx for multi-arch builds
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-21 17:35:43 +03:00
Stefan Prodan
693ffa9d28 Merge pull request #158 from stefanprodan/release-6.0.2
Release v6.0.2
2021-10-21 16:40:23 +03:00
Stefan Prodan
1c39c04ac9 Release v6.0.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-21 16:35:25 +03:00
Stefan Prodan
a27ef20cb7 Merge pull request #157 from stefanprodan/pub-config-to-ghcr
Publish the deploy manifests to GHCR
2021-10-21 16:31:26 +03:00
Stefan Prodan
5e2089eafb Publish the deploy manifests to GHCR
- bundle the kustomize overlay as an OCI artifact
- push the artifact to `ghcr.io/stefanprodan/podinfo-config` with crane
- sign the artifact with cosign

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-21 16:26:10 +03:00
14 changed files with 130 additions and 11 deletions

39
.cosign/README.md Normal file
View File

@@ -0,0 +1,39 @@
# Podinfo signed releases
Podinfo deployment manifests are published to GitHub Container Registry as OCI artifacts
and are signed using [cosign](https://github.com/sigstore/cosign).
## Verify the artifacts with cosign
Install the [cosign](https://github.com/sigstore/cosign) CLI:
```sh
brew install sigstore/tap/cosign
```
Verify a podinfo release with cosign CLI:
```sh
cosign verify -key https://raw.githubusercontent.com/stefanprodan/podinfo/master/cosign/cosign.pub \
ghcr.io/stefanprodan/podinfo-deploy:latest
```
## Download the artifacts with crane
Install the [crane](https://github.com/google/go-containerregistry/tree/main/cmd/crane) CLI:
```sh
brew install crane
```
Download the podinfo deployment manifests with crane CLI:
```console
$ crane export ghcr.io/stefanprodan/podinfo-deploy:latest -| tar -xf -
$ ls -1
deployment.yaml
hpa.yaml
kustomization.yaml
service.yaml
```

4
.cosign/cosign.pub Normal file
View File

@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEST+BqQ1XZhhVYx0YWQjdUJYIG5Lt
iz2+UxRIqmKBqNmce2T+l45qyqOs99qfD7gLNGmkVZ4vtJ9bM7FxChFczg==
-----END PUBLIC KEY-----

View File

@@ -9,6 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: imjasonh/setup-crane@v0.1
- uses: sigstore/cosign-installer@main
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
@@ -44,7 +46,7 @@ jobs:
push: true
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
file: ./Dockerfile.xx
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: |
docker.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }}
@@ -71,6 +73,21 @@ jobs:
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish config artifact
run: |
cd kustomize
tar -cf config.tar * --numeric-owner --owner=0 --group=0
crane append -f config.tar -t ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }}
crane tag ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }} latest
rm config.tar
- name: Sign config artifact
run: |
echo "$COSIGN_KEY" > /tmp/cosign.key
cosign sign -key /tmp/cosign.key ghcr.io/stefanprodan/podinfo-deploy:${{ steps.prep.outputs.VERSION }}
cosign sign -key /tmp/cosign.key ghcr.io/stefanprodan/podinfo-deploy:latest
env:
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
COSIGN_KEY: ${{secrets.COSIGN_KEY}}
- uses: ./.github/actions/release-notes
- name: Generate release notes
run: |

52
Dockerfile.xx Normal file
View File

@@ -0,0 +1,52 @@
ARG XX_VERSION=1.0.0-rc.2
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
FROM --platform=$BUILDPLATFORM golang:1.16-alpine as builder
# Copy the build utilities.
COPY --from=xx / /
ARG TARGETPLATFORM
ARG REVISION
RUN mkdir -p /podinfo/
WORKDIR /podinfo
COPY . .
RUN go mod download
ENV CGO_ENABLED=0
RUN xx-go build -ldflags "-s -w \
-X github.com/stefanprodan/podinfo/pkg/version.REVISION=${REVISION}" \
-a -o bin/podinfo cmd/podinfo/*
RUN xx-go build -ldflags "-s -w \
-X github.com/stefanprodan/podinfo/pkg/version.REVISION=${REVISION}" \
-a -o bin/podcli cmd/podcli/*
FROM alpine:3.14
ARG BUILD_DATE
ARG VERSION
ARG REVISION
LABEL maintainer="stefanprodan"
RUN addgroup -S app \
&& adduser -S -G app app \
&& apk --no-cache add \
ca-certificates curl netcat-openbsd
WORKDIR /home/app
COPY --from=builder /podinfo/bin/podinfo .
COPY --from=builder /podinfo/bin/podcli /usr/local/bin/podcli
COPY ./ui ./ui
RUN chown -R app:app ./
USER app
CMD ["./podinfo"]

View File

@@ -34,6 +34,13 @@ build-charts:
build-container:
docker build -t $(DOCKER_IMAGE_NAME):$(VERSION) .
build-xx:
docker buildx build \
--platform=linux/amd64 \
-t $(DOCKER_IMAGE_NAME):$(VERSION) \
--load \
-f Dockerfile.xx .
build-base:
docker build -f Dockerfile.base -t $(DOCKER_REPOSITORY)/podinfo-base:latest .

View File

@@ -1,6 +1,6 @@
apiVersion: v1
version: 6.0.1
appVersion: 6.0.1
version: 6.0.3
appVersion: 6.0.3
name: podinfo
engine: gotpl
description: Podinfo Helm chart for Kubernetes

View File

@@ -8,7 +8,7 @@ backends: []
image:
repository: ghcr.io/stefanprodan/podinfo
tag: 6.0.1
tag: 6.0.3
pullPolicy: IfNotPresent
ui:

View File

@@ -8,7 +8,7 @@ backends: []
image:
repository: ghcr.io/stefanprodan/podinfo
tag: 6.0.1
tag: 6.0.3
pullPolicy: IfNotPresent
ui:

View File

@@ -23,7 +23,7 @@ spec:
spec:
containers:
- name: backend
image: ghcr.io/stefanprodan/podinfo:6.0.1
image: ghcr.io/stefanprodan/podinfo:6.0.3
imagePullPolicy: IfNotPresent
ports:
- name: http

View File

@@ -23,7 +23,7 @@ spec:
spec:
containers:
- name: frontend
image: ghcr.io/stefanprodan/podinfo:6.0.1
image: ghcr.io/stefanprodan/podinfo:6.0.3
imagePullPolicy: IfNotPresent
ports:
- name: http

View File

@@ -25,7 +25,7 @@ spec:
serviceAccountName: webapp
containers:
- name: backend
image: ghcr.io/stefanprodan/podinfo:6.0.1
image: ghcr.io/stefanprodan/podinfo:6.0.3
imagePullPolicy: IfNotPresent
ports:
- name: http

View File

@@ -25,7 +25,7 @@ spec:
serviceAccountName: webapp
containers:
- name: frontend
image: ghcr.io/stefanprodan/podinfo:6.0.1
image: ghcr.io/stefanprodan/podinfo:6.0.3
imagePullPolicy: IfNotPresent
ports:
- name: http

View File

@@ -23,7 +23,7 @@ spec:
spec:
containers:
- name: podinfod
image: ghcr.io/stefanprodan/podinfo:6.0.1
image: ghcr.io/stefanprodan/podinfo:6.0.3
imagePullPolicy: IfNotPresent
ports:
- name: http

View File

@@ -1,4 +1,4 @@
package version
var VERSION = "6.0.1"
var VERSION = "6.0.3"
var REVISION = "unknown"