Skip to content

Commit 5e9096b

Browse files
authored
Merge pull request #237 from controlplaneio/fix_container_builds
2 parents 6fe348d + efd7cea commit 5e9096b

7 files changed

Lines changed: 98 additions & 172 deletions

File tree

.github/workflows/move_issues_to_board.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
name: Move new issues into To do
1+
---
2+
name: Move new issues into To Do
23

34
on:
45
issues:
5-
types: [ opened ]
6+
types: [opened]
67

78
jobs:
89
automate-project-columns:

.github/workflows/release.yml

Lines changed: 5 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
---
12
name: Release
23
on:
3-
create:
4+
# https://github.com/actions/runner/issues/1007
5+
push:
46
tags:
5-
- v*.*.*
7+
- "v[0-9]+.[0-9]+.[0-9]+"
68

79
jobs:
810
release:
@@ -13,7 +15,7 @@ jobs:
1315
uses: actions/setup-go@v2.1.4
1416
id: go
1517
with:
16-
go-version: ^1.15
18+
go-version: ^1.17
1719

1820
- name: Check out code
1921
uses: actions/checkout@v2.3.4
@@ -24,65 +26,3 @@ jobs:
2426
args: release
2527
env:
2628
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
28-
release-containers:
29-
name: Build and Push container - ${{ matrix.containers.name }}
30-
runs-on: ubuntu-latest
31-
strategy:
32-
matrix:
33-
containers:
34-
- name: kubesec
35-
file: ./Dockerfile
36-
suffix: ""
37-
- name: kubesec scratch
38-
file: ./Dockerfile.scratch
39-
suffix: -scratch
40-
41-
steps:
42-
- name: Cache container layers
43-
uses: actions/cache@v2.1.6
44-
with:
45-
path: /tmp/.buildx-cache
46-
key: ${{ runner.os }}${{ matrix.containers.suffix }}-buildx-${{ github.sha }}
47-
restore-keys: |
48-
${{ runner.os }}${{ matrix.containers.suffix }}-buildx-
49-
50-
- name: Generate container tags and labels
51-
id: docker_meta
52-
uses: crazy-max/ghaction-docker-meta@v3.4.1
53-
with:
54-
# images: kubesec/kubesec,ghcr.io/controlplaneio/kubesec
55-
images: kubesec/kubesec
56-
tag-latest: ${{ matrix.containers.suffix == '' }}
57-
tag-semver: |
58-
{{version}}${{ matrix.containers.suffix }}
59-
label-custom: |
60-
org.opencontainers.image.vendor=controlplane
61-
org.opencontainers.image.url=https://kubesec.io/
62-
63-
- name: Login to Docker Hub Registry
64-
uses: docker/login-action@v1.10.0
65-
with:
66-
registry: docker.io
67-
username: ${{ secrets.DOCKERHUB_USERNAME }}
68-
password: ${{ secrets.DOCKERHUB_TOKEN }}
69-
70-
# - name: Login to GitHub Container Registry
71-
# uses: docker/login-action@v1.10.0
72-
# with:
73-
# registry: ghcr.io
74-
# username: ${{ github.repository_owner }}
75-
# password: ${{ secrets.CR_PAT }}
76-
77-
- name: Set up Docker Buildx
78-
uses: docker/setup-buildx-action@v1.6.0
79-
80-
- name: Build container and push tags
81-
uses: docker/build-push-action@v2.7.0
82-
with:
83-
push: true
84-
file: ${{ matrix.containers.file }}
85-
cache-from: type=local,src=/tmp/.buildx-cache
86-
cache-to: mode=max,type=local,dest=/tmp/.buildx-cache
87-
tags: ${{ steps.docker_meta.outputs.tags }}
88-
labels: ${{ steps.docker_meta.outputs.labels }}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: Release Containers
3+
on:
4+
# https://github.com/actions/runner/issues/1007
5+
push:
6+
tags:
7+
- "v[0-9]+.[0-9]+.[0-9]+"
8+
9+
jobs:
10+
release-containers:
11+
name: Build and Push container - ${{ matrix.containers.name }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
containers:
16+
- name: kubesec
17+
file: ./Dockerfile
18+
suffix: ""
19+
- name: kubesec scratch
20+
file: ./Dockerfile.scratch
21+
suffix: -scratch
22+
23+
steps:
24+
- name: Cache container layers
25+
uses: actions/cache@v2.1.6
26+
with:
27+
path: /tmp/.buildx-cache
28+
key: ${{ runner.os }}${{ matrix.containers.suffix }}-buildx-${{ github.sha }}
29+
restore-keys: |
30+
${{ runner.os }}${{ matrix.containers.suffix }}-buildx-
31+
32+
- name: Checkout
33+
uses: actions/checkout@v2.3.4
34+
35+
- name: Generate container tags and labels
36+
id: docker_meta
37+
uses: docker/metadata-action@v3.4.1
38+
with:
39+
# images: kubesec/kubesec,ghcr.io/controlplaneio/kubesec
40+
images: kubesec/kubesec
41+
tags: |
42+
type=semver,pattern=v{{version}}
43+
type=semver,pattern=v{{major}}
44+
flavor: |
45+
latest=${{ matrix.containers.suffix == '' }}
46+
suffix=${{ matrix.containers.suffix }}
47+
labels: |
48+
org.opencontainers.image.vendor=controlplane
49+
org.opencontainers.image.url=https://kubesec.io/
50+
51+
- name: Login to Docker Hub Registry
52+
uses: docker/login-action@v1.10.0
53+
with:
54+
registry: docker.io
55+
username: ${{ secrets.DOCKERHUB_USERNAME }}
56+
password: ${{ secrets.DOCKERHUB_TOKEN }}
57+
58+
# - name: Login to GitHub Container Registry
59+
# uses: docker/login-action@v1.10.0
60+
# with:
61+
# registry: ghcr.io
62+
# username: ${{ github.repository_owner }}
63+
# password: ${{ secrets.CR_PAT }}
64+
65+
- name: Set up Docker Buildx
66+
uses: docker/setup-buildx-action@v1.6.0
67+
68+
- name: Build container and push tags
69+
uses: docker/build-push-action@v2.7.0
70+
with:
71+
context: .
72+
push: ${{ github.event_name != 'pull_request' }}
73+
file: ${{ matrix.containers.file }}
74+
cache-from: type=local,src=/tmp/.buildx-cache
75+
cache-to: mode=max,type=local,dest=/tmp/.buildx-cache
76+
tags: ${{ steps.docker_meta.outputs.tags }}
77+
labels: ${{ steps.docker_meta.outputs.labels }}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
44

55
## Table of Contents
66

7+
- [2.11.4](#2114)
78
- [2.11.3](#2113)
89
- [2.11.2](#2112)
910
- [2.11.1](#2111)
@@ -28,6 +29,12 @@ All notable changes to this project will be documented in this file.
2829

2930
---
3031

32+
## `2.11.4`
33+
34+
- Fix container builds so all tags are correctly built
35+
- Split release and container release so they can be re-ran separately
36+
- Bump dependencies
37+
3138
## `2.11.3`
3239

3340
- Bump dependencies

Jenkinsfile

Lines changed: 0 additions & 100 deletions
This file was deleted.

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/inconshreveable/mousetrap v1.0.0 // indirect
1616
github.com/instrumenta/kubeval v0.16.1
1717
github.com/kr/text v0.2.0 // indirect
18-
github.com/mattn/go-colorable v0.1.8 // indirect
18+
github.com/mattn/go-colorable v0.1.9 // indirect
1919
github.com/mattn/go-isatty v0.0.14 // indirect
2020
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
2121
github.com/prometheus/client_golang v1.11.0
@@ -32,7 +32,7 @@ require (
3232
go.uber.org/atomic v1.9.0 // indirect
3333
go.uber.org/multierr v1.7.0 // indirect
3434
go.uber.org/zap v1.19.1
35-
golang.org/x/sys v0.0.0-20210915083310-ed5796bab164 // indirect
35+
golang.org/x/sys v0.0.0-20210921065528-437939a70204 // indirect
3636
google.golang.org/protobuf v1.27.1 // indirect
3737
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
3838
gopkg.in/yaml.v2 v2.4.0 // indirect

go.sum

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
245245
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
246246
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
247247
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
248-
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
249248
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
249+
github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
250+
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
250251
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
251252
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
252253
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
@@ -549,8 +550,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc
549550
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
550551
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
551552
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
552-
golang.org/x/sys v0.0.0-20210915083310-ed5796bab164 h1:7ZDGnxgHAMw7thfC5bEos0RDAccZKxioiWBhfIe+tvw=
553-
golang.org/x/sys v0.0.0-20210915083310-ed5796bab164/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
553+
golang.org/x/sys v0.0.0-20210921065528-437939a70204 h1:JJhkWtBuTQKyz2bd5WG9H8iUsJRU3En/KRfN8B2RnDs=
554+
golang.org/x/sys v0.0.0-20210921065528-437939a70204/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
554555
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
555556
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
556557
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

0 commit comments

Comments
 (0)