mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 14:02:48 +00:00
refactor: enable gitlab review tool
This commit is contained in:
@@ -33,7 +33,7 @@ setup:
|
||||
build:
|
||||
stage: build
|
||||
script:
|
||||
- npm run build:prod
|
||||
- npm run build
|
||||
artifacts:
|
||||
paths:
|
||||
- www
|
||||
@@ -126,6 +126,7 @@ review:
|
||||
stage: deploy
|
||||
script:
|
||||
- npm run build:prod
|
||||
- .gitlab/ci/enableGitlabReviewToolbar.sh www/index.html "$CI_PROJECT_ID" "$CI_OPEN_MERGE_REQUESTS"
|
||||
- cp www/index.html www/200.html
|
||||
- ./node_modules/.bin/surge -p ./www -d https://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh/
|
||||
environment:
|
||||
|
||||
@@ -8,5 +8,8 @@ if echo -n $3 | grep -Eq '[0-9]+$'; then
|
||||
MERGE_REQUEST_ID="$(echo -n "$3" | grep -Eo '[0-9]+$')"
|
||||
fi
|
||||
|
||||
SCRIPT_TAG="<script defer data-project-id=\"$2\" data-project-path=\"openstapps/app\" data-merge-request-id=\"$MERGE_REQUEST_ID\" data-mr-url=\"https://gitlab.com\" id=\"review-app-toolbar-script\" src=\"https://gitlab.com/assets/webpack/visual_review_toolbar.js\"></script>"
|
||||
INDEX_PATH=$(dirname $1)
|
||||
SCRIPT_TAG="<script defer data-project-id=\"$2\" data-project-path=\"openstapps/app\" data-merge-request-id=\"$MERGE_REQUEST_ID\" data-mr-url=\"https://gitlab.com\" id=\"review-app-toolbar-script\" src=\"visual_review_toolbar.js\"></script>"
|
||||
|
||||
curl https://gitlab.com/assets/webpack/visual_review_toolbar.js --output "$INDEX_PATH/visual_review_toolbar.js" --silent
|
||||
sed -i -e "\@</head>@i\\$SCRIPT_TAG" $1
|
||||
|
||||
Reference in New Issue
Block a user