-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-create release on tag, with manifests
Releases are created when a v* tag is pushed to the releases/v0 branch. As part of the release, the manifests from each of the submodules, and also from cert-manager and mpi-operator, are collected into a tarball and included as a release artifact. This tarball is meant to be unpacked in a gitops repo. Signed-off-by: Dean Roehrich <[email protected]>
- Loading branch information
1 parent
1edfc23
commit 9502500
Showing
3 changed files
with
110 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Handle Release Tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
create_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-tags: true | ||
fetch-depth: 0 | ||
- name: Repair tag | ||
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} | ||
- name: Verify that the tag is annotated | ||
run: if test x$(git for-each-ref ${{ github.ref }} | awk '{print $2}') = xtag; then /bin/true; else echo "\"${{ github.ref }}\" does not look like an annotated tag!"; /bin/false; fi | ||
- name: Submodule status | ||
run: git submodule status | ||
- name: Collect manifests | ||
run: tools/collect-manifests.sh ~+/release-manifests | ||
- name: Make tarball | ||
run: cd release-manifests && tar cvf ../manifests.tar * | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
#prerelease: true | ||
generate_release_notes: true | ||
files: manifests.tar | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2024 Hewlett Packard Enterprise Development LP | ||
# Other additional copyright holders may be indicated within. | ||
# | ||
# The entirety of this work is 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. | ||
|
||
TREEDIR="$1" | ||
|
||
if [[ -z $TREEDIR ]]; then | ||
echo "specify a tree dir" | ||
exit 1 | ||
elif [[ $TREEDIR != /* ]]; then | ||
echo "must begin with a slash" | ||
exit 1 | ||
elif [[ -d $TREEDIR ]]; then | ||
echo "the dir already exists" | ||
exit 1 | ||
fi | ||
|
||
mkdir "$TREEDIR" | ||
DO_MODULES="" | ||
SUBMODULES=$(git submodule status | awk '{print $2}') | ||
|
||
for SUBMODULE in $SUBMODULES; do | ||
if grep -qE '^edit-image:' "$SUBMODULE"/Makefile | ||
then | ||
echo "Generating the manifest from $SUBMODULE" | ||
if ! make -C "$SUBMODULE" edit-image kustomize; then | ||
echo "Stopping at $SUBMODULE" | ||
exit 1 | ||
fi | ||
DO_MODULES="$DO_MODULES $SUBMODULE" | ||
fi | ||
done | ||
|
||
for SUBMODULE in $DO_MODULES; do | ||
echo "Collecting the manifest from $SUBMODULE" | ||
mkdir "$TREEDIR/$SUBMODULE" | ||
(cd "$SUBMODULE" || exit 1 | ||
if [[ -d config/begin ]]; then | ||
bin/kustomize build config/begin > "$TREEDIR/$SUBMODULE/$SUBMODULE.yaml" | ||
fi | ||
if [[ -d config/begin-examples ]]; then | ||
bin/kustomize build config/begin-examples > "$TREEDIR/$SUBMODULE/$SUBMODULE-examples.yaml" | ||
fi | ||
if [[ -d config/prometheus ]]; then | ||
bin/kustomize build config/prometheus > "$TREEDIR/$SUBMODULE/$SUBMODULE-prometheus.yaml" | ||
fi | ||
if [[ -d deploy/kubernetes/begin ]]; then | ||
bin/kustomize build deploy/kubernetes/begin > "$TREEDIR/$SUBMODULE/$SUBMODULE.yaml" | ||
fi | ||
) | ||
done | ||
|
||
mkdir "$TREEDIR/cert-mgr" | ||
CERT_URL=$(yq -M '.thirdPartyServices[] | select(.name == "cert-manager") | .url' config/repositories.yaml) | ||
wget -O "$TREEDIR"/cert-mgr/cert-mgr.yaml "$CERT_URL" | ||
|
||
mkdir "$TREEDIR/mpi-operator" | ||
MPIOP_URL=$(yq -M '.thirdPartyServices[] | select(.name == "mpi-operator") | .url' config/repositories.yaml) | ||
wget -O "$TREEDIR"/mpi-operator/mpi-operator.yaml "$MPIOP_URL" | ||
|
||
|