Skip to content

Commit

Permalink
Merge pull request #99 from facchettos/update-pluginyaml
Browse files Browse the repository at this point in the history
Update pluginyaml and add release pipeline
  • Loading branch information
facchettos authored May 21, 2024
2 parents d954816 + 8710922 commit 1b45939
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- "!**_test.go" # exclude test files to ignore unit test changes
- "test/**" # include test files in e2e again
- "!**.md"
- "examples/**"
- ".github/workflows/e2e.yaml"

concurrency:
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Release

on:
release:
types: [created]

permissions:
contents: read

jobs:
publish-image:
if: startsWith(github.ref, 'refs/tags/v') == true
runs-on: ubuntu-22.04

permissions:
id-token: write # This is the key for OIDC cosign!
packages: write
contents: read

steps:
- uses: actions/checkout@v3
- uses: sigstore/cosign-installer@main
with:
cosign-release: "v2.0.2"
- id: get_version
run: |
RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p')
echo "::set-output name=release_version::$RELEASE_VERSION"
- name: Get Docker tags
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/loft-sh/rancher-nodeless-plugin
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: loft-sh
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the hooks
working-directory: ./examples/hooks
id: docker_build
uses: docker/build-push-action@v4
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: "ghcr.io/loft-sh/vcluster-example-hooks:${{steps.get_version.outputs.release_version}}"
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Images digests for
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Build and push the bootstrap
id: docker_build
working-directory: ./examples/bootstrap-with-deployment
uses: docker/build-push-action@v4
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: "ghcr.io/loft-sh/vcluster-example-bootstrap-bootstrap-with-deployment:${{steps.get_version.outputs.release_version}}"
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Images digests for bootstrap
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Build and push import secret
working-directory: ./examples/import-secrets
id: docker_build
uses: docker/build-push-action@v4
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: "ghcr.io/loft-sh/vcluster-example-import-secrets:${{steps.get_version.outputs.release_version}}"
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Images digests for import secret
run: echo ${{ steps.docker_build.outputs.digest }}
- name: Build and push crd sync
working-directory: ./examples/crd-sync
id: docker_build
uses: docker/build-push-action@v4
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: "ghcr.io/loft-sh/vcluster-example-crd-sync:${{steps.get_version.outputs.release_version}}"
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Images digests for crd sync
run: echo ${{ steps.docker_build.outputs.digest }}

2 changes: 1 addition & 1 deletion examples/bootstrap-with-deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21.5 as builder
FROM golang:1.22.2 as builder

# Make sure we use go modules
WORKDIR vcluster
Expand Down
3 changes: 1 addition & 2 deletions examples/bootstrap-with-deployment/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Plugin Definition below. This is essentially a valid helm values file that will be merged
# with the other vcluster values during vcluster create or helm install.
plugin:
plugins:
bootstrap-with-deployment:
version: v2
image: ghcr.io/loft-sh/vcluster-example-bootstrap-with-deployment:v4
imagePullPolicy: IfNotPresent
2 changes: 1 addition & 1 deletion examples/crd-sync/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21.5 as builder
FROM golang:1.22.2 as builder

# Make sure we use go modules
WORKDIR vcluster
Expand Down
5 changes: 2 additions & 3 deletions examples/crd-sync/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Plugin Definition below. This is essentially a valid helm values file that will be merged
# with the other vcluster values during vcluster create or helm install.
plugin:
plugins:
crd-sync:
version: v2
image: ghcr.io/loft-sh/vcluster-example-crd-sync:v3
imagePullPolicy: IfNotPresent
rbac:
Expand All @@ -21,4 +20,4 @@ plugin:
# resource definitions.
rbac:
clusterRole:
create: true
enabled: true
2 changes: 1 addition & 1 deletion examples/hooks/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21.5 as builder
FROM golang:1.22.2 as builder

# Make sure we use go modules
WORKDIR vcluster
Expand Down
5 changes: 2 additions & 3 deletions examples/hooks/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Plugin Definition below. This is essentially a valid helm values file that will be merged
# with the other vcluster values during vcluster create or helm install.
plugin:
plugins:
hooks:
version: v2
image: ghcr.io/loft-sh/vcluster-example-hooks:v1
imagePullPolicy: IfNotPresent
imagePullPolicy: IfNotPresent
2 changes: 1 addition & 1 deletion examples/import-secrets/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21.5 as builder
FROM golang:1.22.2 as builder

# Make sure we use go modules
WORKDIR vcluster
Expand Down
5 changes: 2 additions & 3 deletions examples/import-secrets/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Plugin Definition below. This is essentially a valid helm values file that will be merged
# with the other vcluster values during vcluster create or helm install.
plugin:
plugins:
import-secrets:
version: v2
image: ghcr.io/loft-sh/vcluster-example-import-secrets:v1
imagePullPolicy: IfNotPresent
imagePullPolicy: IfNotPresent

0 comments on commit 1b45939

Please sign in to comment.