devops: support beta deployment for Trace viewer (#10201)
Trace Viewer will have 3 deployments: - Stable: https://trace.playwright.dev - Beta (from release branch): https://trace.playwright.dev/beta - Next (from master branch): https://trace.playwright.dev/next
This commit is contained in:
parent
56521e2a49
commit
7af0dc178b
12
.github/workflows/publish_canary.yml
vendored
12
.github/workflows/publish_canary.yml
vendored
|
|
@ -66,7 +66,13 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
- run: npm i -g npm@7
|
- run: npm i -g npm@7
|
||||||
- name: Deploy
|
- name: Deploy Canary
|
||||||
run: bash utils/build/deploy-trace-viewer.sh canary
|
run: bash utils/build/deploy-trace-viewer.sh --canary
|
||||||
env:
|
if: contains(github.ref, 'master')
|
||||||
|
env:
|
||||||
|
GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
|
||||||
|
- name: Deploy BETA
|
||||||
|
run: bash utils/build/deploy-trace-viewer.sh --beta
|
||||||
|
if: contains(github.ref, 'release')
|
||||||
|
env:
|
||||||
GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
|
GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
|
||||||
|
|
|
||||||
4
.github/workflows/publish_release.yml
vendored
4
.github/workflows/publish_release.yml
vendored
|
|
@ -72,7 +72,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
- run: npm i -g npm@7
|
- run: npm i -g npm@7
|
||||||
- name: Deploy
|
- name: Deploy Stable
|
||||||
run: bash utils/build/deploy-trace-viewer.sh production
|
run: bash utils/build/deploy-trace-viewer.sh --stable
|
||||||
env:
|
env:
|
||||||
GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
|
GH_SERVICE_ACCOUNT_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
|
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
|
||||||
echo "usage: $(basename $0) {canary,production}"
|
echo "usage: $(basename $0) {--stable,--beta,--canary}"
|
||||||
echo
|
echo
|
||||||
echo "Build the Trace Viewer and push it to the GitHub repository."
|
echo "Build the Trace Viewer and push it to the GitHub repository."
|
||||||
echo
|
echo
|
||||||
|
|
@ -20,7 +20,7 @@ if [[ -z "${GH_SERVICE_ACCOUNT_TOKEN}" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ENVIRONMENT="$1"
|
RELEASE_CHANNEL="$1"
|
||||||
|
|
||||||
# 1. Install dependencies and build the Trace Viewer
|
# 1. Install dependencies and build the Trace Viewer
|
||||||
npm ci
|
npm ci
|
||||||
|
|
@ -32,31 +32,31 @@ git config --global user.email 41898282+github-actions[bot]@users.noreply.github
|
||||||
git clone "https://${GH_SERVICE_ACCOUNT_TOKEN}@github.com/microsoft/playwright-trace.git" playwright-trace
|
git clone "https://${GH_SERVICE_ACCOUNT_TOKEN}@github.com/microsoft/playwright-trace.git" playwright-trace
|
||||||
|
|
||||||
# 3. Copy the built Trace Viewer to the repository
|
# 3. Copy the built Trace Viewer to the repository
|
||||||
if [[ "${ENVIRONMENT}" == "production" ]]; then
|
if [[ "${RELEASE_CHANNEL}" == "--stable" ]]; then
|
||||||
# 3.1 make a copy of the current next/ folder
|
|
||||||
if [[ -d "playwright-trace/docs/next" ]]; then
|
|
||||||
cp -r playwright-trace/docs/next .next-previous
|
|
||||||
fi
|
|
||||||
# 3.2 Clean it
|
|
||||||
rm -rf playwright-trace/docs/
|
rm -rf playwright-trace/docs/
|
||||||
mkdir playwright-trace/docs/
|
mkdir playwright-trace/docs/
|
||||||
# 3.3 Copy the old next/ back into the folder
|
|
||||||
if [[ -d ".next-previous/" ]]; then
|
|
||||||
mv .next-previous/ playwright-trace/docs/next/
|
|
||||||
fi
|
|
||||||
# 3.4 Copy the new production over
|
|
||||||
cp -r packages/playwright-core/lib/webpack/traceViewer/* playwright-trace/docs/
|
cp -r packages/playwright-core/lib/webpack/traceViewer/* playwright-trace/docs/
|
||||||
echo "Updated production version"
|
|
||||||
elif [[ "${ENVIRONMENT}" == "canary" ]]; then
|
# Restore CNAME, beta/ & next/ branches.
|
||||||
|
cd playwright-trace/
|
||||||
|
git checkout docs/beta
|
||||||
|
git checkout docs/next
|
||||||
|
git checkout docs/CNAME
|
||||||
|
cd -
|
||||||
|
|
||||||
|
echo "Updated stable version"
|
||||||
|
elif [[ "${RELEASE_CHANNEL}" == "--canary" ]]; then
|
||||||
rm -rf playwright-trace/docs/next/
|
rm -rf playwright-trace/docs/next/
|
||||||
cp -r packages/playwright-core/lib/webpack/traceViewer/ playwright-trace/docs/next/
|
cp -r packages/playwright-core/lib/webpack/traceViewer/ playwright-trace/docs/next/
|
||||||
echo "Updated canary version"
|
echo "Updated canary version"
|
||||||
|
elif [[ "${RELEASE_CHANNEL}" == "--beta" ]]; then
|
||||||
|
rm -rf playwright-trace/docs/beta/
|
||||||
|
cp -r packages/playwright-core/lib/webpack/traceViewer/ playwright-trace/docs/beta/
|
||||||
|
echo "Updated beta version"
|
||||||
else
|
else
|
||||||
echo "ERROR: unknown environment - ${ENVIRONMENT}"
|
echo "ERROR: unknown environment - ${RELEASE_CHANNEL}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# CNAME needs to be located inside the served docs/ folder for GitHub Pages
|
|
||||||
cp playwright-trace/CNAME playwright-trace/docs/CNAME
|
|
||||||
|
|
||||||
# 4. Commit and push the changes
|
# 4. Commit and push the changes
|
||||||
cd playwright-trace/
|
cd playwright-trace/
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue