Skip to content

Commit

Permalink
Add vpa release pipeline (#258)
Browse files Browse the repository at this point in the history
* Add pipeline for releasing VPA

* Add scripts for reading/writing VPA version to go file

* Fix yaml indentation

* Add boilerplate header to scripts

* Add new ci scripts to boilerplate ignore list

* Make sure VPA release tags don't conflict with CA
  • Loading branch information
voelzmo authored Nov 28, 2023
1 parent c7e66c9 commit 150c384
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 1 deletion.
85 changes: 85 additions & 0 deletions .ci/pipeline_definitions
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,88 @@ autoscaler:
slack_cfg_name: 'scp_workspace'
component_descriptor:
snapshot_ctx_repository: gardener-public
vertical-pod-autoscaler:
template: 'default'
base_definition:
repo:
source_labels:
- name: 'cloud.gardener.cnudie/dso/scanning-hints/source_analysis/v1'
value:
policy: 'scan'
path_config:
exclude_paths:
- '^vendor/.*'
- '.*/vendor/.*'
- '^addon-resizer/.*'
- '^balancer/.*'
- '^cluster-autoscaler/.*'
traits:
version:
inject_effective_version: true
read_callback: .ci/read-vpa-version.sh
write_callback: .ci/write-vpa-version.sh
publish:
oci-builder: docker-buildx
platforms:
- linux/amd64
- linux/arm64
dockerimages:
vpa-recommender:
inputs:
repos:
source: ~ # default
steps:
build: ~
registry: 'gcr-readwrite'
image: 'eu.gcr.io/gardener-project/gardener/autoscaler/vertical-pod-autoscaler/vpa-recommender'
dockerfile: './vertical-pod-autoscaler/pkg/recommender/Dockerfile'
vpa-updater:
inputs:
repos:
source: ~ # default
steps:
build: ~
registry: 'gcr-readwrite'
image: 'eu.gcr.io/gardener-project/gardener/autoscaler/vertical-pod-autoscaler/vpa-updater'
dockerfile: './vertical-pod-autoscaler/pkg/updater/Dockerfile'
vpa-admission-controller:
inputs:
repos:
source: ~ # default
steps:
build: ~
registry: 'gcr-readwrite'
image: 'eu.gcr.io/gardener-project/gardener/autoscaler/vertical-pod-autoscaler/vpa-admission-controller'
dockerfile: './vertical-pod-autoscaler/pkg/admission-controller/Dockerfile'
steps:
test:
image: 'golang:1.20.5'
build:
image: 'golang:1.20.5'
output_dir: 'binary'
jobs:
head-update:
traits:
component_descriptor:
snapshot_ctx_repository: gardener-public
draft_release: ~
pull-request:
traits:
pull-request: ~
release:
traits:
version:
preprocess: 'finalize'
release:
nextversion: 'bump_minor'
git_tags:
- ref_template: refs/tags/vpa-{VERSION}
on_tag_conflict: 'fail'
slack:
default_channel: 'internal_scp_workspace'
channel_cfgs:
internal_scp_workspace:
channel_name: 'C017KSLTF4H' # gardener-autoscaling
slack_cfg_name: 'scp_workspace'
component_descriptor:
snapshot_ctx_repository: gardener-public
17 changes: 17 additions & 0 deletions .ci/read-vpa-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env sh

# Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cat ../vertical-pod-autoscaler/common/version.go | grep 'const VerticalPodAutoscalerVersion' | cut -d " " -f 4 | tr -d '"'
17 changes: 17 additions & 0 deletions .ci/write-vpa-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env sh

# Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

sed -i s/'^\(const VerticalPodAutoscalerVersion = "\).*"'/\\1$1'"'/ vertical-pod-autoscaler/common/version.go
4 changes: 3 additions & 1 deletion hack/boilerplate/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ def file_extension(filename):
"cluster-autoscaler/cloudprovider/mcm",
"cluster-autoscaler/integration",
"cluster-autoscaler/hack",
"cluster-autoscaler/cloudprovider/builder/builder_all.go"
"cluster-autoscaler/cloudprovider/builder/builder_all.go",
".ci/read-vpa-version.sh",
".ci/write-vpa-version.sh"
]

# list all the files contain 'DO NOT EDIT', but are not generated
Expand Down

0 comments on commit 150c384

Please sign in to comment.