-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into EVEREST-1771-remove-cookie
- Loading branch information
Showing
5 changed files
with
109 additions
and
119 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,60 @@ | ||
name: Auto-Update PR Base | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
auto-update-base: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
try { | ||
const { data: pulls } = await github.rest.pulls.list({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
state: "open", | ||
}); | ||
for (const pull of pulls) { | ||
const hasAutoUpdateLabel = pull.labels.some(label => label.name === "auto-update-base"); | ||
if (hasAutoUpdateLabel) { | ||
try { | ||
const pr = await github.rest.pulls.get({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: pull.number, | ||
}); | ||
if (pr.data.mergeable_state === 'dirty') { | ||
console.log(`[INFO] PR #${pull.number}: "${pull.title}" - Skipping update due to merge conflict.`); | ||
continue; | ||
} | ||
if (pr.data.mergeable_state !== 'behind') { | ||
console.log(`[INFO] PR #${pull.number}: "${pull.title}" - Base branch is up-to-date.`); | ||
continue; | ||
} | ||
console.log(`[UPDATE] PR #${pull.number}: "${pull.title}" - Updating base branch...`); | ||
try { | ||
await github.rest.pulls.updateBranch({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: pull.number, | ||
}); | ||
console.log(`[SUCCESS] PR #${pull.number}: "${pull.title}" - Base branch updated.`); | ||
} catch (updateError) { | ||
console.error(`[ERROR] PR #${pull.number}: Failed to update base branch - ${updateError.message}`); | ||
} | ||
} catch (diffError) { | ||
console.error(`[ERROR] PR #${pull.number}: Failed to compare commits - ${diffError.message}`); | ||
} | ||
} | ||
} | ||
} catch (error) { | ||
console.error(`[ERROR] Failed to list pull requests - ${error.message}`); | ||
} |
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,29 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ -z "$VS_IMAGE" ]]; then | ||
echo "Error: VS_IMAGE environment variable is empty." >&2 | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "$VERSION" ]]; then | ||
echo "Error: VERSION environment variable is empty." >&2 | ||
exit 1 | ||
fi | ||
# deploy VS and get it's internal IP | ||
SERVICE_IP=$(./vs.sh) | ||
|
||
if [[ -z "$HELM_PATH" ]]; then | ||
echo "Error: HELM_PATH environment variable is empty. Please add the absolute path to your helm build to the HELM_PATH environment variable." >&2 | ||
exit 1 | ||
fi | ||
kubectl port-forward svc/percona-version-service 8081:80 & | ||
|
||
if [[ -z "$EVEREST_CTL_PATH" ]]; then | ||
echo "Error: EVEREST_CTL_PATH environment variable is empty." >&2 | ||
exit 1 | ||
fi | ||
# sleep for 2 seconds to make sure the port-forward is ready | ||
sleep 2 | ||
|
||
# deploy VS and get it's internal IP | ||
SERVICE_IP=$(curl -sfL https://raw.githubusercontent.com/percona/everest/main/dev/fb/vs.sh | bash -s) | ||
os=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
arch=$(uname -m | tr '[:upper:]' '[:lower:]') | ||
|
||
kubectl port-forward svc/percona-version-service 8081:80 & | ||
if [[ ($os == "linux" || $os == "darwin") && $arch == "x86_64" ]] | ||
then | ||
arch="amd64" | ||
elif [[ $os == "linux" && $arch == "aarch64" ]] | ||
then | ||
arch="arm64" | ||
fi | ||
|
||
# run everest installation with everest CLI | ||
"$EVEREST_CTL_PATH" install --chart-dir "$HELM_PATH/charts/everest" --version "$VERSION" --version-metadata-url http://localhost:8081 --operator.xtradb-cluster --operator.mongodb --operator.postgresql --skip-wizard --namespaces everest -v --helm.set "versionMetadataURL=http://$SERVICE_IP" | ||
"./everestctl-$os-$arch" install --chart-dir "helm-chart" --version "$(cat version.txt)" --version-metadata-url http://localhost:8081 --operator.xtradb-cluster --operator.mongodb --operator.postgresql --skip-wizard --namespaces everest -v --helm.set "versionMetadataURL=http://$SERVICE_IP" |
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,17 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ -z "$HELM_PATH" ]]; then | ||
echo "Error: HELM_PATH environment variable is empty. Please add the absolute path to your helm build to the HELM_PATH environment variable." >&2 | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "$VS_IMAGE" ]]; then | ||
echo "Error: VS_IMAGE environment variable is empty." >&2 | ||
exit 1 | ||
fi | ||
|
||
# deploy VS and get it's internal IP | ||
SERVICE_IP=$(curl -sfL https://raw.githubusercontent.com/percona/everest/main/dev/fb/vs.sh | bash -s) | ||
SERVICE_IP=$(./vs.sh) | ||
|
||
# run everest installation with helm | ||
helm install everest-core "$HELM_PATH/charts/everest" --namespace=everest-system --create-namespace --set versionMetadataURL="http://$SERVICE_IP" --timeout=10m --devel | ||
helm install everest-core "helm-chart" --namespace=everest-system --create-namespace --set versionMetadataURL="http://$SERVICE_IP" --timeout=10m --devel |
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