-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update build-workflow to build helm-values for the operator
- Loading branch information
1 parent
4117e8a
commit a002815
Showing
8 changed files
with
150 additions
and
61 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,57 @@ | ||
name: Build - Uffizzi Cluster Operator | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
types: [opened,reopened,synchronize,closed] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
id-token: write | ||
|
||
jobs: | ||
build-operator: | ||
name: Build and Push `operator` Image | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed' }} | ||
outputs: | ||
tags: ${{ steps.meta.outputs.tags }} | ||
uuid: ${{ env.UUID_OPERATOR }} | ||
steps: | ||
- name: Checkout git repo | ||
uses: actions/checkout@v3 | ||
- name: Generate UUID image name | ||
id: uuid | ||
run: echo "UUID_OPERATOR=$(uuidgen)" >> $GITHUB_ENV | ||
- name: Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
# An anonymous, emphemeral registry built on ttl.sh | ||
images: registry.uffizzi.com/${{ env.UUID_OPERATOR }} | ||
tags: type=raw,value=48h | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Build and Push Image to Uffizzi Ephemeral Registry | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
context: ./ | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: Create Helm Values File | ||
run: | | ||
cat <<EOF > helm-values.yaml | ||
image: | ||
repository: registry.uffizzi.com/${{ env.UUID_OPERATOR }} | ||
tag: 48h | ||
EOF | ||
cat helm-values.yaml # For debugging, to check the contents of the file. | ||
- name: Upload Helm Values as Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: helm-values | ||
path: helm-values.yaml |
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Release Helm Charts | ||
name: Release - Helm Chart | ||
|
||
on: | ||
push: | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/pull_request.yaml → .github/workflows/pull-request.yaml
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Unit Tests and Coverage | ||
name: Tests - Unit Tests and Coverage | ||
|
||
on: | ||
pull_request: | ||
|
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
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,50 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
# create multiple uffizzi clusters | ||
|
||
for i in {1..10}; do | ||
kubectl create -f hack/e2e/manifests/001-multicluster.yaml | ||
done | ||
|
||
# Retrieve the names of the newly created UffizziCluster resources | ||
# Assuming 'uffizzicluster' is the kind for the UffizziCluster resources | ||
uffizzi_clusters=($(kubectl get uffizzicluster -o jsonpath='{.items[*].metadata.name}')) | ||
|
||
# Check if we have any clusters to monitor | ||
if [ ${#uffizzi_clusters[@]} -eq 0 ]; then | ||
echo "No UffizziClusters found. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
echo "Monitoring the following UffizziClusters for readiness: ${uffizzi_clusters[@]}" | ||
|
||
# Function to check the APIReady condition of a UffizziCluster | ||
check_api_ready() { | ||
local cluster_name=$1 | ||
api_ready=$(kubectl get uffizzicluster "$cluster_name" -o jsonpath='{.status.conditions[?(@.type=="APIReady")].status}') | ||
echo "$api_ready" | ||
} | ||
|
||
# Monitor each UffizziCluster until the APIReady condition is True | ||
start_time=$(date +%s) | ||
for cluster in "${uffizzi_clusters[@]}"; do | ||
while true; do | ||
api_ready=$(check_api_ready "$cluster") | ||
if [ "$api_ready" == "True" ]; then | ||
echo "UffizziCluster $cluster is ready." | ||
break | ||
else | ||
echo "Waiting for UffizziCluster $cluster to become ready..." | ||
sleep 5 | ||
fi | ||
done | ||
done | ||
end_time=$(date +%s) | ||
|
||
# Calculate the total time taken for all UffizziClusters to become ready | ||
total_time=$((end_time - start_time)) | ||
echo "All UffizziClusters are ready. Total time taken: $total_time seconds." |
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,4 @@ | ||
kind: UffizziCluster | ||
apiVersion: uffizzi.com/v1alpha1 | ||
metadata: | ||
generateName: multicluster- |