Skip to content

Commit

Permalink
Merge pull request #222 from majguo/update-doc
Browse files Browse the repository at this point in the history
Update doc
  • Loading branch information
venunathb committed May 25, 2023
2 parents 2ea0388 + bb4ba7f commit f5cb969
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 17 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ on:
default: true
ndImageResourceId:
description: 'Private ND vm image resource id. Only requried for ND VM image cicd, ignore it otherwise.'
required: true
default: 'NA'
required: false
ihsImageResourceId:
description: 'Private IHS vm image resource id. Only requried for IHS VM image cicd, ignore it otherwise.'
required: true
default: 'NA'
required: false
# Allows you to run this workflow using GitHub APIs
# PERSONAL_ACCESS_TOKEN=<GITHUB_PERSONAL_ACCESS_TOKEN>
# REPO_NAME=WASdev/azure.websphere-traditional.cluster
Expand Down Expand Up @@ -246,7 +244,9 @@ jobs:
run: |
cd ${{ env.repoName }}/target/cli
chmod a+x deploy.azcli
./deploy.azcli -n ${{ env.testDeploymentName }} -g ${{ env.testResourceGroup }} -l ${{ env.location }} -d ${{ inputs.ndImageResourceId }} -i ${{ inputs.ihsImageResourceId }}
ndImageResourceId=${{ inputs.ndImageResourceId }}
ihsImageResourceId=${{ inputs.ihsImageResourceId }}
./deploy.azcli -n ${{ env.testDeploymentName }} -g ${{ env.testResourceGroup }} -l ${{ env.location }} -d "${ndImageResourceId:-NA}" -i "${ihsImageResourceId:-NA}"
- name: Verify the deployment
run: |
outputs=$(az deployment group show -n ${{ env.testDeploymentName }} -g ${{ env.testResourceGroup }} --query 'properties.outputs')
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/setup-credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ VM_ADMIN_ID=
VM_ADMIN_PASSWORD=
# Password for database user db2inst1 (IBM DB2) and testuser (other database types)
DATABASE_PASSWORD=
# Client ID for an Azure AD application registered in the Partner Center
CLIENT_ID=
# Secret value of the Azure AD application registered in the Partner Center
SECRET_VALUE=
# Tenant ID of the Azure AD application registered in the Partner Center
TENANT_ID=
# Optional: Web hook for Microsoft Teams channel
MSTEAMS_WEBHOOK=

Expand Down Expand Up @@ -102,6 +108,21 @@ if [ "$DATABASE_PASSWORD" == '' ] ; then
read -r -p "Enter password for database user db2inst1 (IBM DB2) and testuser (other database types): " DATABASE_PASSWORD
fi

# get CLIENT_ID if not set at the beginning of this file
if [ "$CLIENT_ID" == '' ] ; then
read -r -p "Enter client ID for an Azure AD application registered in the Partner Center: " CLIENT_ID
fi

# get SECRET_VALUE if not set at the beginning of this file
if [ "$SECRET_VALUE" == '' ] ; then
read -r -p "Enter secret value for the Azure AD application registered in the Partner Center: " SECRET_VALUE
fi

# get TENANT_ID if not set at the beginning of this file
if [ "$TENANT_ID" == '' ] ; then
read -r -p "Enter tenant ID for the Azure AD application registered in the Partner Center: " TENANT_ID
fi

# Optional: get MSTEAMS_WEBHOOK if not set at the beginning of this file
if [ "$MSTEAMS_WEBHOOK" == '' ] ; then
read -r -p "[Optional] Enter Web hook for Microsoft Teams channel, or press 'Enter' to ignore: " MSTEAMS_WEBHOOK
Expand Down Expand Up @@ -167,6 +188,9 @@ if $USE_GITHUB_CLI; then
gh ${GH_FLAGS} secret set VM_ADMIN_ID -b"${VM_ADMIN_ID}"
gh ${GH_FLAGS} secret set VM_ADMIN_PASSWORD -b"${VM_ADMIN_PASSWORD}"
gh ${GH_FLAGS} secret set DATABASE_PASSWORD -b"${DATABASE_PASSWORD}"
gh ${GH_FLAGS} secret set CLIENT_ID -b"${CLIENT_ID}"
gh ${GH_FLAGS} secret set SECRET_VALUE -b"${SECRET_VALUE}"
gh ${GH_FLAGS} secret set TENANT_ID -b"${TENANT_ID}"
gh ${GH_FLAGS} secret set MSTEAMS_WEBHOOK -b"${MSTEAMS_WEBHOOK}"
msg "${GREEN}Secrets configured"
} || {
Expand All @@ -189,6 +213,12 @@ if [ $USE_GITHUB_CLI == false ]; then
msg "${GREEN}${VM_ADMIN_PASSWORD}"
msg "${YELLOW}\"DATABASE_PASSWORD\""
msg "${GREEN}${DATABASE_PASSWORD}"
msg "${YELLOW}\"CLIENT_ID\""
msg "${GREEN}${CLIENT_ID}"
msg "${YELLOW}\"SECRET_VALUE\""
msg "${GREEN}${SECRET_VALUE}"
msg "${YELLOW}\"TENANT_ID\""
msg "${GREEN}${TENANT_ID}"
msg "${YELLOW}\"MSTEAMS_WEBHOOK\""
msg "${GREEN}${MSTEAMS_WEBHOOK}"
msg "${NOFORMAT}========================================================================"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/tear-down-credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ if $USE_GITHUB_CLI; then
gh ${GH_FLAGS} secret remove VM_ADMIN_ID
gh ${GH_FLAGS} secret remove VM_ADMIN_PASSWORD
gh ${GH_FLAGS} secret remove DATABASE_PASSWORD
gh ${GH_FLAGS} secret remove CLIENT_ID
gh ${GH_FLAGS} secret remove SECRET_VALUE
gh ${GH_FLAGS} secret remove TENANT_ID
gh ${GH_FLAGS} secret remove MSTEAMS_WEBHOOK
msg "${GREEN}Secrets removed"
} || {
Expand All @@ -94,6 +97,9 @@ if [ $USE_GITHUB_CLI == false ]; then
msg "${YELLOW}\"VM_ADMIN_ID\""
msg "${YELLOW}\"VM_ADMIN_PASSWORD\""
msg "${YELLOW}\"DATABASE_PASSWORD\""
msg "${YELLOW}\"CLIENT_ID\""
msg "${YELLOW}\"SECRET_VALUE\""
msg "${YELLOW}\"TENANT_ID\""
msg "${YELLOW}\"MSTEAMS_WEBHOOK\""
msg "${NOFORMAT}========================================================================"
fi
25 changes: 13 additions & 12 deletions docs/howto-update-for-was-fixpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,35 @@ Please follow sections below in order to update the solution for next tWAS fixpa
* Images may also need to updated to fix a critical WebSphere or OS fixes.

1. How to run CI/CD?
* Go to [Actions](https://github.com/WASdev/azure.websphere-traditional.image/actions) > Click `twas-nd CICD` > Click to expand `Run workflow` > Click `Run workflow` > Refresh the page
* Go to [Actions](https://github.com/WASdev/azure.websphere-traditional.image/actions) > Click `ihs CICD` > Click to expand `Run workflow` > Click `Run workflow` > Refresh the page
* If Workflow does not kick off from the UI, try the command line:
* Before running the CI/CD, make sure the VM image in partner center has already been live. If the VM image is not published or published but in preview stage, the CI/CD workflow run will fail.
* Go to [Actions](https://github.com/WASdev/azure.websphere-traditional.image/actions) > Click `twas-nd CICD` > Click to expand `Run workflow` > Fill in image version number for **Must provide image version number** > Click `Run workflow` > Refresh the page.
* Note: The **image version number** you provide will be used as the value of **Image version** for the new `twas-nd` VM image that will be added to partner center by the CICD pipeline.
* Go to [Actions](https://github.com/WASdev/azure.websphere-traditional.image/actions) > Click `ihs CICD` > Click to expand `Run workflow` > Fill in image version number for **Must provide image version number** > Click `Run workflow` > Refresh the page.
* Note: The **image version number** you provide will be used as the value of **Image version** for the new `ihs` VM image that will be added to partner center by the CICD pipeline.
* If Workflow does not kick off from the UI, try the command line after replacing `<twas-nd-image-version-number>` and `<ihs-image-version-number>` with real values respectively:

```
PERSONAL_ACCESS_TOKEN=<access-token>
REPO_NAME=WASdev/azure.websphere-traditional.image
curl --verbose -X POST https://api.github.com/repos/${REPO_NAME}/dispatches -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${PERSONAL_ACCESS_TOKEN}" --data '{"event_type": "integration-test-all"}
curl --verbose -X POST -u "WASdev:${PERSONAL_ACCESS_TOKEN}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${REPO_NAME}/actions/workflows/twas-ndBuild.yml/dispatches --data '{"ref": "main", "inputs": {"imageVersionNumber": "<twas-nd-image-version-number>"}}'
curl --verbose -X POST -u "WASdev:${PERSONAL_ACCESS_TOKEN}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${REPO_NAME}/actions/workflows/ihsBuild.yml/dispatches --data '{"ref": "main", "inputs": {"imageVersionNumber": "<ihs-image-version-number>"}}'
```

1. How to test the image, what testcases to run?
* The CI/CD has already contains tests to verify the entitlement check and tWAS installation, so basically it's good to go without manual tests.
* The CI/CD contains tests to verify the entitlement check, tWAS installation, configuring tWAS cluster, installing a sample application and accessing admin console and application. So basically it's good to go without manual tests.
* However, if CI/CD failed, please look at error messages from the CI/CD logs, and [access the source VM](https://github.com/WASdev/azure.websphere-traditional.image/blob/main/docs/howto-access-source-vm.md) for troubleshooting if necessary.

1. How to publish the image in marketplace and who can do it?
1. For `twas-nd` image: Wait until the CI/CD workflow for `twas-nd CICD` successfully completes > Click to open details of the workflow run > Scroll to the bottom of the page > Click `sasurl-twasnd` to download the zip file `sasurl-twasnd.zip` > Unzip and open file `sas-url-twasnd.txt` > Find values for `osDiskSasUrl` and `dataDiskSasUrl`;
1. For `ihs` image: Wait until the CI/CD workflow for `ihs CICD` successfully completes > Click to open details of the workflow run > Scroll to the bottom of the page > Click `sasurl-ihs` to download the zip file `sasurl-ihs.zip` > Unzip and open file `sas-url-ihs.txt` > Find values for `osDiskSasUrl` and `dataDiskSasUrl`;
1. For `twas-nd` image: Wait until the CI/CD workflow for `twas-nd CICD` successfully completes. The workflow will update the offer by adding a new `twas-nd` VM image and saving it as a draft in partner center.
1. For `ihs` image: Wait until the CI/CD workflow for `ihs CICD` successfully completes. The workflow will update the offer by adding a new `ihs` VM image and saving it as a draft in partner center.
1. Sign into [Microsoft Partner Center](https://partner.microsoft.com/dashboard/commercial-marketplace/overview): Repeat these steps for ND and IHS images.
* Select the Directory `IBM-Alliance-Microsoft Partner Network-Global-Tenant`
* Expand `Build solutions` and choose `Publish your solution`.
* Click to open the offer for `2023-03-27-twas-cluster-base-image` ND base image (`2023-03-27-ihs-base-image` for IHS base image)
* Click `Plan overview` then click to open the plan
* **IMPORTANT** Click `Pricing and availability` to verify the plan is NOT hidden from the marketplace
* Ensure the `Hide plan` checkbox is NOT checked
* Click `Technical configuration`
* Scroll down and click `+` under "VM images" > Specify a new value for `Version number`, following the convention \<major version\>.YYYYMMDD, e.g. 9.0.20210929 and write it down (We deliberately do not specify the minor verson because the pipeline gets the latest at the time it is run).
* Under `SAS URI` > `Add OS Disk`. Copy and paste value of `osDiskSasUrl` for `twas-nd` or `ihs` (from the earlier steps) to the textbox `OS VHD Link`
* Click `+ Add data disk` > Select `Data disk 0` > Copy and paste value of `dataDiskSasUrl` for `twas-nd` or `ihs` (from the earlier steps) to the textbox `Data disk VHD link`
* Scroll to the bottom of the page and click `Save draft`
* Click `Technical configuration`. You should see a new draft of VM image exists.
* Click `Review and publish`
* In the "Notes for certification" section enter the twas-nd or ihs CICD URL
* Click `Publish`;
Expand Down

0 comments on commit f5cb969

Please sign in to comment.