-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Redoc to Redocly CDN (#2026)
- Loading branch information
1 parent
1e4ea03
commit 77104d6
Showing
7 changed files
with
66 additions
and
7 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
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
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
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,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e # exit on error | ||
|
||
# TODO: Update script! | ||
|
||
VERSION=$(node scripts/version.js) | ||
VERSION_TAG=v${VERSION:0:1}.x | ||
|
||
copy_to_s3 () { | ||
aws s3 cp bundles "s3://redocly-cdn/redoc/$1/bundles" --recursive "$2" | ||
aws s3 cp CHANGELOG.md "s3://redocly-cdn/redoc/$1/CHANGELOG.md" "$2" | ||
aws s3 cp LICENSE "s3://redocly-cdn/redoc/$1/LICENSE" "$2" | ||
aws s3 cp package.json "s3://redocly-cdn/redoc/$1/package.json" "$2" | ||
aws s3 cp README.md "s3://redocly-cdn/redoc/$1/README.md" "$2" | ||
} | ||
|
||
if aws s3 ls "redocly-cdn/redoc/v$VERSION/" "$@"; then | ||
echo "Version $VERSION already exists" | ||
exit 1 | ||
else | ||
echo Releasing $VERSION | ||
|
||
echo Uploading to S3 $VERSION | ||
copy_to_s3 "v$VERSION" $@ | ||
|
||
echo Uploading to S3 $VERSION_TAG | ||
copy_to_s3 "$VERSION_TAG" $@ | ||
|
||
if [[ "$VERSION_TAG" == "v2.x" ]]; then | ||
echo Uploading to S3 latest | ||
copy_to_s3 latest $@ | ||
fi | ||
|
||
echo | ||
echo Deployed successfully | ||
exit 0 | ||
fi |
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 @@ | ||
console.log(require('../package.json').version); |