Skip to content

Instantly share code, notes, and snippets.

@rottencandy
Last active July 13, 2023 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rottencandy/372135fbef5f8530f748eb3abedf8fe2 to your computer and use it in GitHub Desktop.
Save rottencandy/372135fbef5f8530f748eb3abedf8fe2 to your computer and use it in GitHub Desktop.
# All release objects required to set up automatic/manual releases
# NOTE: Replace instances of "src-ns", "target-ns", "my-app-name", "author-name" with correct values
# src & target can also be the same namespace
# Enterprise contract policy
apiVersion: appstudio.redhat.com/v1alpha1
kind: EnterpriseContractPolicy
metadata:
name: mvp-policy
namespace: target-ns
spec:
description: Red Hat's enterprise requirements
configuration:
exclude:
- attestation_task_bundle
- java
- tasks
- test
- hermetic_build_task.build_task_not_hermetic
- buildah_build_task.dockerfile_param_external_source
- step_image_registries.disallowed_task_step_image
- hermetic_build_task.build_task_hermetic
- buildah_build_task.buildah_uses_local_dockerfile
- kind.kind_not_found
- labels.build_task_no_labels
# This key might change in the future,
# to get latest key, create a default EC integration test
# and find the key in the test's pipelinerun logs
publicKey: |-
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWVUppvU1x8t866CQQSXbKpojoaTq
imMnVnZ31e2ubZHKL1LdfgPG2gHIPeSeouTa8upOz9W+xxBFnA0X515Nsw==
-----END PUBLIC KEY-----
sources:
- data:
- "git::https://github.com/hacbs-contract/ec-policies.git//data"
name: ec-policies
policy:
- "git::https://github.com/hacbs-contract/ec-policies.git//policy"
---
# Release Strategy
apiVersion: appstudio.redhat.com/v1alpha1
kind: ReleaseStrategy
metadata:
name: test-rs
namespace: target-ns
spec:
bundle: quay.io/hacbs-release/pipeline-deploy-release:main
pipeline: deploy-release
policy: mvp-policy
params:
- name: extraConfigGitUrl
value: https://github.com/scoheb/strategy-configs.git
- name: extraConfigPath
value: mvp.yaml
- name: extraConfigRevision # optional field, default is main
value: main
---
# Release Plan Admission
apiVersion: appstudio.redhat.com/v1alpha1
kind: ReleasePlanAdmission
metadata:
name: test-rpa
namespace: target-ns
spec:
application: my-app-name
displayName: My Release Plan Admission
origin: src-ns
releaseStrategy: test-rs
---
# Release Plan
apiVersion: appstudio.redhat.com/v1alpha1
kind: ReleasePlan
metadata:
name: test-plan
namespace: src-ns
labels:
release.appstudio.openshift.io/auto-release: 'true'
release.appstudio.openshift.io/standing-attribution: 'true'
# Needed for automated releases
# release.appstudio.openshift.io/author: author-name
spec:
application: my-app-name
displayName: My Release Plan
target: target-ns
---
# Release
apiVersion: appstudio.redhat.com/v1alpha1
kind: Release
metadata:
name: test-deploy-release
namespace: src-ns
labels:
release.appstudio.openshift.io/author: author-name
spec:
snapshot: node-sample-test
releasePlan: test-plan
---
# Snapshot
apiVersion: appstudio.redhat.com/v1alpha1
kind: Snapshot
metadata:
name: node-sample-test
namespace: src-ns
spec:
application: my-app-name
components:
- containerImage: quay.io/redhat-user-workloads/mdsaud-tenant/my-custom-app/express-hello-4wge@sha256:da14cf1bc9917f5d860a9add7d100c3d3ad9c64d3f56556bcb688114d371f181
name: express-hello-4wge
source:
git:
revision: 732afb6b9bd906438128bee50deb0052f6df8222
url: https://github.com/rottencandy/node-express-hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment