-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
11 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 |
---|---|---|
|
@@ -6,7 +6,6 @@ on: | |
|
||
jobs: | ||
flux-schedule-check: | ||
if: github.ref == 'refs/heads/main' | ||
name: Flux Update Schedule Check | ||
runs-on: | ||
- self-hosted | ||
|
@@ -22,6 +21,29 @@ jobs: | |
path: kommander | ||
token: ${{ secrets.MESOSPHERECI_USER_TOKEN }} | ||
|
||
- name: Import GPG key (kommander workdir) | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
git_tag_gpgsign: true | ||
git_push_gpgsign: true | ||
git_config_global: true | ||
workdir: 'kommander' | ||
|
||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
git_tag_gpgsign: true | ||
git_push_gpgsign: true | ||
git_config_global: true | ||
|
||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY }} | ||
|
@@ -38,4 +60,5 @@ jobs: | |
- name: Check for Flux update | ||
env: | ||
GH_TOKEN: ${{ secrets.MESOSPHERECI_USER_TOKEN }} | ||
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | ||
run: devbox run -- "make KOMMANDER_REPO_PATH=${GITHUB_WORKSPACE}/kommander make flux-update" |
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ readonly CURRENT_FLUX_VERSION | |
KOMMANDER_REPO_PATH="${REPO_ROOT}/kommander" # Override in CI to path of kommander repository. | ||
|
||
function check_remote_branch() { | ||
if [[ -n $(git ls-remote --exit-code --heads git@github.com:mesosphere/"$1".git "$2") ]]; then | ||
if [[ -n $(git ls-remote --exit-code --heads https://github.com/mesosphere/"$1".git "$2") ]]; then | ||
echo "Flux update PR is already up!" | ||
exit 0 | ||
fi | ||
|
@@ -45,14 +45,12 @@ function update_flux() { | |
kustomize create --autodetect | ||
popd && popd | ||
|
||
# Update flux version in defaultApps whenever flux version is upgraded. | ||
sed -i "s/kommander-flux: \".*\"/kommander-flux: \"$LATEST_FLUX_VERSION\"/g" services/kommander/*/defaults/cm.yaml | ||
|
||
git add services | ||
|
||
if [[ -z "$(git config user.email 2>/dev/null || true)" ]]; then | ||
git config user.email "[email protected]" | ||
git config user.name "mesosphere-teamcity" | ||
git config user.email "[email protected]" | ||
git config user.name "mesosphere-ci" | ||
git config user.signingKey "${GPG_KEY_ID}" | ||
fi | ||
|
||
readonly COMMIT_MSG="feat: Upgrade flux to ${LATEST_FLUX_VERSION}" | ||
|
@@ -62,7 +60,7 @@ function update_flux() { | |
git push --set-upstream origin "${BRANCH_NAME}" | ||
|
||
git fetch origin main | ||
KOMMANDER_APPLICATIONS_PR=$(gh pr create --base main --fill --head "${BRANCH_NAME}" -t "${COMMIT_MSG}" -l ready-for-review -l ok-to-test -l slack-notify -l open-kommander-pr -l update-licenses) | ||
KOMMANDER_APPLICATIONS_PR=$(gh pr create --base main --fill --head "${BRANCH_NAME}" -t "${COMMIT_MSG}" -l ready-for-review -l ok-to-test -l slack-notify -l update-licenses) | ||
readonly KOMMANDER_APPLICATIONS_PR | ||
echo "${KOMMANDER_APPLICATIONS_PR} is created" | ||
} | ||
|
@@ -80,13 +78,14 @@ function bump_kommander_repo_flux() { | |
sed -i "s~KOMMANDER_APPLICATIONS_REF ?= main~KOMMANDER_APPLICATIONS_REF ?= ${BRANCH_NAME}~g" Makefile | ||
git add Makefile | ||
if [[ -z "$(git config user.email 2>/dev/null || true)" ]]; then | ||
git config user.email "[email protected]" | ||
git config user.name "mesosphere-teamcity" | ||
git config user.email "[email protected]" | ||
git config user.name "mesosphere-ci" | ||
git config user.signingKey "${GPG_KEY_ID}" | ||
fi | ||
git commit -m "${COMMIT_MSG}" | ||
git push --set-upstream origin "${BRANCH_NAME}" | ||
git fetch origin main | ||
gh pr create --base main --fill --head "${BRANCH_NAME}" -t "${COMMIT_MSG}" -l copy-flux-manifests -l ok-to-test -l ready-for-review -l stacked -b "Depends on ${KOMMANDER_APPLICATIONS_PR}" | ||
gh pr create --base main --fill --head "${BRANCH_NAME}" -t "${COMMIT_MSG}" -l copy-flux-manifests -l test/kuttl -l test/kuttl-multi-cluster -l test/airgapped -l test/license -l test/e2e -l ready-for-review -l stacked -b "Depends on ${KOMMANDER_APPLICATIONS_PR}" | ||
popd | ||
} | ||
|
||
|