Skip to content

Commit 1a066c1

Browse files
authored
migrate CICD-Pipeline to GitHub-Actions (gardener#280)
see: https://gardener.github.io/cc-utils/github_actions.html
1 parent ff2723c commit 1a066c1

9 files changed

Lines changed: 147 additions & 82 deletions

File tree

.ci/component_descriptor

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

.ci/pipeline_definitions

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

.ci/set_dependency_version

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ fi
2222

2323
# for now, we only know how to upgrade github.com/gardener/machine-controller-manager, as checked above
2424

25-
MCM_FILEPATH="${REPO_DIR}/MCM_VERSION"
26-
27-
if [ ! -f "${MCM_FILEPATH}" ]; then
28-
echo "error no such file: ${MCM_FILEPATH}"
29-
exit 1
30-
fi
31-
32-
echo -n "${DEPENDENCY_VERSION}" > "${MCM_FILEPATH}"
3325
echo "set dependency-version of ${DEPENDENCY_NAME} to ${DEPENDENCY_VERSION}"
3426

3527
cd ${REPO_DIR}

.github/workflows/build.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
mode:
7+
required: true
8+
type: string
9+
default: snapshot
10+
description: |
11+
the mode to use. either `snapshot` or `release`. Will affect effective version, as well
12+
as target-oci-registry.
13+
14+
jobs:
15+
prepare:
16+
uses: gardener/cc-utils/.github/workflows/prepare.yaml@master
17+
with:
18+
mode: ${{ inputs.mode }}
19+
version-commit-callback-action-path:
20+
permissions:
21+
contents: read
22+
23+
oci-images:
24+
name: Build OCI-Images
25+
needs:
26+
- prepare
27+
permissions:
28+
contents: read
29+
packages: write
30+
id-token: write
31+
secrets: inherit
32+
uses: gardener/cc-utils/.github/workflows/oci-ocm.yaml@master
33+
strategy:
34+
matrix:
35+
args:
36+
- name: machine-controller-manager-provider-openstack
37+
target:
38+
oci-repository: gardener/machine-controller-manager-provider-openstack
39+
ocm-labels:
40+
name: gardener.cloud/cve-categorisation
41+
value:
42+
network_exposure: protected
43+
authentication_enforced: false
44+
user_interaction: gardener-operator
45+
confidentiality_requirement: high
46+
integrity_requirement: high
47+
availability_requirement: low
48+
with:
49+
name: ${{ matrix.args.name }}
50+
version: ${{ needs.prepare.outputs.version }}
51+
target: ${{ matrix.args.target }}
52+
oci-registry: ${{ needs.prepare.outputs.oci-registry }}
53+
oci-repository: ${{ matrix.args.oci-repository }}
54+
oci-platforms: linux/amd64,linux/arm64
55+
ocm-labels: ${{ toJSON(matrix.args.ocm-labels) }}
56+
extra-tags: latest
57+
58+
sast-lint:
59+
uses: gardener/cc-utils/.github/workflows/sastlint-ocm.yaml@master
60+
permissions:
61+
contents: read
62+
with:
63+
linter: gosec
64+
run: .ci/verify

.github/workflows/non-release.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build
2+
on:
3+
push:
4+
pull_request_target:
5+
6+
jobs:
7+
build:
8+
uses: ./.github/workflows/build.yaml
9+
with:
10+
mode: snapshot
11+
secrets: inherit
12+
permissions:
13+
contents: write
14+
packages: write
15+
id-token: write
16+
17+
component-descriptor:
18+
uses: gardener/cc-utils/.github/workflows/post-build.yaml@master
19+
needs:
20+
- build
21+
secrets: inherit
22+
permissions:
23+
id-token: write
24+
contents: write

.github/workflows/release.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
next-version:
6+
type: choice
7+
options:
8+
- bump-minor
9+
- bump-patch
10+
11+
12+
jobs:
13+
build:
14+
uses: ./.github/workflows/build.yaml
15+
permissions:
16+
contents: write
17+
id-token: write
18+
packages: write
19+
with:
20+
mode: release
21+
22+
release-to-github-and-bump:
23+
uses: gardener/cc-utils/.github/workflows/release.yaml@master
24+
needs:
25+
- build
26+
secrets: inherit
27+
permissions:
28+
contents: write
29+
id-token: write
30+
packages: write
31+
with:
32+
release-commit-target: branch
33+
next-version: ${{ inputs.next-version }}
34+
next-version-callback-action-path:
35+
slack-channel-id:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Create Upgrade-Pull-Requests
2+
on:
3+
schedule:
4+
- cron: '*/10 * * * *'
5+
workflow_dispatch:
6+
7+
jobs:
8+
upgrade-pullrequests:
9+
uses: gardener/cc-utils/.github/workflows/upgrade-dependencies.yaml@master
10+
secrets: inherit
11+
permissions:
12+
contents: write
13+
pull-requests: write

.ocm/base-component.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
componentReferences:
2+
- name: machine-controller-manager
3+
componentName: github.com/gardener/machine-controller-manager
4+
version: v0.58.0
5+
main-source:
6+
labels:
7+
- name: cloud.gardener.cnudie/dso/scanning-hints/source_analysis/v1
8+
value:
9+
policy: skip
10+
comment: |
11+
we use gosec for sast scanning. See attached log.

MCM_VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)