-
Notifications
You must be signed in to change notification settings - Fork 64
Update CodeFlare operator to latest MCAD dev after every merged commit #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-robot
merged 1 commit into
project-codeflare:main
from
sutaakar:operator-upgrade
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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: Update CodeFlare operator with latest changes from MCAD | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Build and Push dev MCAD image into Quay] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
update-codeflare-operator: | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' && github.repository == 'project-codeflare/multi-cluster-app-dispatcher' | ||
|
||
steps: | ||
- name: checkout MCAD code | ||
uses: actions/checkout@v3 | ||
with: | ||
path: 'mcad' | ||
|
||
- name: Store latest MCAD Git SHA | ||
run: | | ||
echo "GIT_COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
working-directory: mcad | ||
|
||
- name: checkout CodeFlare operator code | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'project-codeflare/codeflare-operator' | ||
token: ${{ env.GITHUB_TOKEN }} | ||
path: operator | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} | ||
|
||
- name: Update CodeFlare operator code to use latest MCAD version | ||
run: | | ||
sed -i -E "s/(.*MCAD_VERSION \?= ).*/\1${{ env.GIT_COMMIT_SHA }}/" Makefile | ||
sed -i -E "s/(.*MCAD_REF \?= ).*/\1dev/" Makefile | ||
make modules | ||
go mod tidy | ||
working-directory: operator | ||
|
||
- name: Commit CodeFlare operator changes in the code back to repository | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Update MCAD to latest dev | ||
create_branch: true | ||
repository: operator | ||
branch: dev | ||
push_options: '--force' | ||
|
||
- name: Create a PR in CodeFlare operator repo with code changes if not opened yet | ||
run: | | ||
if [[ $(gh pr view dev) && $(gh pr view dev --json state --jq .state) == "OPEN" ]]; then | ||
echo "PR already opened" | ||
else | ||
gh pr create --base "main" --fill --head dev | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} | ||
working-directory: operator |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.