Skip to content

Commit

Permalink
copy the kiali source prior to building release (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmazzitelli authored May 7, 2024
1 parent dbac6c9 commit 20b7e63
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
41 changes: 33 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ name: Release

on:
schedule:
# Every Monday at 01:00 (UTC) - this action takes several hours to complete
- cron: "00 1 * * MON"
# Every Tuesday at 01:00 (UTC) which is the day after the server release is done. This action takes several hours to complete.
- cron: "00 1 * * TUE"
workflow_dispatch:
inputs:
plugin_quay_repository:
description: Plugin Quay repository
type: string
default: quay.io/kiali/ossmconsole
required: true
kiali_source_code_version:
description: The version of the Kiali source code to build with OSSMC. This is either a branch or tag name. The default is the version of the OSSMC release being built. This means by default the versions of the Kiali source and OSSMC will be the same.
type: string
required: false

jobs:
initialize:
Expand All @@ -23,6 +27,7 @@ jobs:
branch_version: ${{ env.branch_version }}
next_version: ${{ env.next_version }}
plugin_quay_tag: ${{ env.plugin_quay_tag }}
kiali_src_code_version: ${{ env.kiali_src_code_version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -146,6 +151,20 @@ jobs:
echo "plugin_quay_tag=$PLUGIN_QUAY_TAG" >> $GITHUB_ENV
- name: Determine Kiali Source Code Version To Copy
env:
RELEASE_VERSION: ${{ env.release_version }}
id: determine_kiali_src_code_version
run: |
if [ -z "${{ github.event.inputs.kiali_source_code_version }}" ];
then
KIALI_SRC_CODE_VERSION="$RELEASE_VERSION"
else
KIALI_SRC_CODE_VERSION="${{ github.event.inputs.kiali_source_code_version }}"
fi
echo "kiali_src_code_version=$KIALI_SRC_CODE_VERSION" >> $GITHUB_ENV
- name: Cleanup
run: rm bump.py minor.py

Expand All @@ -161,6 +180,8 @@ jobs:
echo "Plugin Quay tag: ${{ env.plugin_quay_tag }}"
echo "Kiali Source Code Version to Copy: ${{ env.kiali_src_code_version }}"
release:
name: Release
if: ${{ needs.initialize.outputs.release_type != 'skip' && ((github.event_name == 'schedule' && github.repository == 'kiali/openshift-servicemesh-plugin') || github.event_name != 'schedule') }}
Expand All @@ -172,6 +193,7 @@ jobs:
NEXT_VERSION: ${{ needs.initialize.outputs.next_version }}
RELEASE_BRANCH: ${{ github.ref_name }}
PLUGIN_QUAY_TAG: ${{ needs.initialize.outputs.plugin_quay_tag }}
KIALI_SRC_CODE_VERSION: ${{ needs.initialize.outputs.kiali_src_code_version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -195,17 +217,20 @@ jobs:
- name: Print disk space after
run: df -h

- name: Build and push images
- name: Configure git
run: |
docker login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_PASSWORD }} quay.io
git config user.email 'kiali-dev@googlegroups.com'
git config user.name 'kiali-bot'
make build-push-plugin-multi-arch
- name: Copy Kiali source code
run: |
hack/copy-frontend-src-to-ossmc.sh --source-ref "$KIALI_SRC_CODE_VERSION"
- name: Configure git
- name: Build and push images
run: |
git config user.email 'kiali-dev@googlegroups.com'
docker login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_PASSWORD }} quay.io
git config user.name 'kiali-bot'
make build-push-plugin-multi-arch
- name: Create tag
run: |
Expand Down
4 changes: 4 additions & 0 deletions make/Makefile.plugin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ else
@$(eval KIALI_URL_TO_USE = $${KIALI_URL})
endif

## prepare-git: Prepares the local dev environment so you can git commit
prepare-git:
cd ${PLUGIN_DIR} && yarn add pretty-quick

## prepare-dev-env: Prepares the local dev environment so you can run the plugin and OpenShift console locally.
prepare-dev-env: .determine-kiali-url
@cd ${PLUGIN_DIR} && yarn install
Expand Down

0 comments on commit 20b7e63

Please sign in to comment.