Skip to content

Commit 6275b15

Browse files
authored
Merge pull request #29 from fluxcd/release-manifests
Add Kubernetes deployment to the release assets
2 parents 2ddc11e + 1bb3715 commit 6275b15

File tree

9 files changed

+51
-7
lines changed

9 files changed

+51
-7
lines changed

.github/workflows/release.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- uses: docker/setup-buildx-action@v1
3434
- uses: sigstore/cosign-installer@main
3535
- uses: anchore/sbom-action/download-syft@v0
36+
- uses: fluxcd/pkg/actions/kustomize@main
3637
- name: Docker login ghcr.io
3738
uses: docker/login-action@v1
3839
with:
@@ -68,6 +69,9 @@ jobs:
6869
COSIGN_EXPERIMENTAL: 1
6970
run: |
7071
cosign sign --recursive ghcr.io/fluxcd/${{ env.CONTROLLER }}:${GITHUB_REF/refs\/tags\//}
72+
- name: Generate deployment manifest
73+
run: |
74+
IMG=ghcr.io/fluxcd/${{ env.CONTROLLER }}:${GITHUB_REF/refs\/tags\//} make manifests-release
7175
- name: GoReleaser publish signed SBOM
7276
uses: goreleaser/goreleaser-action@v2
7377
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
# Local build output dir
1515
bin/
1616
testbin/
17+
build/

.goreleaser.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ release:
1616
```
1717
1818
Supported architectures: `linux/amd64`, `linux/arm64` and `linux/arm/v7`.
19+
extra_files:
20+
- glob: build/source-watcher.deployment.yaml
1921

2022
changelog:
2123
use: github-native

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ docker-build:
7878
docker-push:
7979
docker push ${IMG}
8080

81+
manifests-release:
82+
mkdir -p ./build
83+
mkdir -p config/release-tmp && cp config/release/* config/release-tmp
84+
cd config/release-tmp && kustomize edit set image fluxcd/source-watcher=${IMG}
85+
kustomize build config/release-tmp > ./build/source-watcher.deployment.yaml
86+
rm -rf config/release-tmp
87+
8188
# Find or download controller-gen
8289
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
8390
.PHONY: controller-gen

config/default/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ namespace: source-system
44
resources:
55
- ../rbac
66
- ../manager
7-
- github.com/fluxcd/source-controller/config//crd?ref=v0.2.0
8-
- github.com/fluxcd/source-controller/config//manager?ref=v0.2.0
7+
- github.com/fluxcd/source-controller/config//crd?ref=main
8+
- github.com/fluxcd/source-controller/config//manager?ref=main
99
- namespace.yaml

config/manager/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
terminationGracePeriodSeconds: 10
2121
containers:
2222
- name: manager
23-
image: ghcr.io/fluxcd/source-watcher
23+
image: fluxcd/source-watcher
2424
imagePullPolicy: IfNotPresent
2525
securityContext:
2626
allowPrivilegeEscalation: false

config/manager/kustomization.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
44
- deployment.yaml
5-
images:
6-
- name: ghcr.io/fluxcd/source-watcher
7-
newName: ghcr.io/fluxcd/source-watcher
8-
newTag: v0.10.0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: flux-system
4+
resources:
5+
- ../manager
6+
patchesStrategicMerge:
7+
- |-
8+
apiVersion: apps/v1
9+
kind: Deployment
10+
metadata:
11+
name: source-watcher
12+
spec:
13+
template:
14+
spec:
15+
serviceAccountName: source-controller
16+
images:
17+
- name: fluxcd/source-watcher
18+
newName: ghcr.io/fluxcd/source-watcher
19+
newTag: v0.10.0

config/release/kustomization.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: flux-system
4+
resources:
5+
- ../manager
6+
patchesStrategicMerge:
7+
- |-
8+
apiVersion: apps/v1
9+
kind: Deployment
10+
metadata:
11+
name: source-watcher
12+
spec:
13+
template:
14+
spec:
15+
serviceAccountName: source-controller

0 commit comments

Comments
 (0)