-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: made VRTs optional as they're not yet working
Also cleaned up `bacon.yml` and used `yarn-berry` script.
- Loading branch information
1 parent
97243f3
commit 7f9c08c
Showing
6 changed files
with
94 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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
File renamed without changes.
This file contains 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,65 @@ | ||
#!/bin/bash | ||
|
||
source $OKTA_HOME/$REPO/scripts/setup.sh | ||
|
||
cd $OKTA_HOME/$REPO | ||
|
||
PUBLISH_SHA="$(git rev-parse --short $SHA)" | ||
PUBLISH_REGISTRY="${ARTIFACTORY_URL}/api/npm/npm-topic" | ||
CURRENT_VERSION=$(< lerna.json jq -r '.version') | ||
TAGGED_VERSION=$CURRENT_VERSION-$PUBLISH_SHA | ||
|
||
npm config set @okta:registry ${PUBLISH_REGISTRY} | ||
|
||
function lerna_publish() { | ||
# use lerna to publish without making a commit to the repo | ||
MY_CMD="yarn run lerna publish from-package --force-publish=* --ignore-changes --no-push --no-git-tag-version --no-verify-access --registry \"${PUBLISH_REGISTRY}\" --yes" | ||
echo "Running ${MY_CMD}" | ||
${MY_CMD} | ||
} | ||
|
||
# prevent local changes from being reported so lerna can publish | ||
git checkout . | ||
|
||
# All packages are built by `prepack`. | ||
|
||
# update version with commit SHA to allow lerna to publish | ||
FILES_TO_UPDATE_VERSION="packages/odyssey-storybook/package.json" | ||
for PATH_AND_FILE in $FILES_TO_UPDATE_VERSION; do | ||
FULL_PATH="$OKTA_HOME/$REPO/$PATH_AND_FILE" | ||
json_contents="$(jq '.version = "'$TAGGED_VERSION'"' $FULL_PATH)" && \ | ||
echo -E "${json_contents}" > $FULL_PATH | ||
git update-index --assume-unchanged $FULL_PATH | ||
done | ||
|
||
echo "Publishing to artifactory" | ||
if ! lerna_publish; then | ||
echo "ERROR: Lerna Publish has failed." | ||
exit $PUBLISH_ARTIFACTORY_FAILURE | ||
else | ||
echo "Publish successful. Sending promotion message" | ||
fi | ||
|
||
## | ||
## Publish docs | ||
## | ||
## While the package artifact is already in npm-release, we use this | ||
## promotion event workaround to trigger the conductor workflow to deploy | ||
## | ||
|
||
echo "Publish successful. Sending promotion message" | ||
|
||
function send_promotion_message() { | ||
curl -H "x-aurm-token: ${AURM_TOKEN}" \ | ||
-H "Content-Type: application/json" \ | ||
-X POST -d "[{\"artifactId\":\"$1\",\"repository\":\"npm-topic\",\"artifact\":\"$2\",\"version\":\"$3\",\"promotionType\":\"ARTIFACT\"}]" \ | ||
-k "${APERTURE_BASE_URL}/v1/artifact-promotion/createPromotionEvent" | ||
} | ||
|
||
ARTIFACT="@okta/odyssey-storybook/-/@okta/odyssey-storybook-${CURRENT_VERSION}.tgz" | ||
echo "Artifact is ${ARTIFACT}" | ||
if ! send_promotion_message "odyssey-storybook" "${ARTIFACT}" "${CURRENT_VERSION}"; then | ||
echo "Error sending docs promotion event to Aperture" | ||
fi | ||
|
||
exit $SUCCESS |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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