@@ -32,6 +32,9 @@ plugin_dir=~/.devstream/plugins
3232
3333GOOS=$( go env GOOS)
3434GOARCH=$( go env GOARCH)
35+ DTM_CORE_BINARY=dtm-${GOOS} -${GOARCH}
36+ STORAGE_BASE_URL=s3://download.devstream.io
37+ STORAGE_URL_WITH_TAG=${STORAGE_BASE_URL} /${tag}
3538
3639if [ ! $tag ] || [ ! $user ] || [ ! $repo ] || [ ! $github_token ] || [ ! $plugin_dir ]; then
3740 echo " The following variables cannot be empty!"
@@ -56,11 +59,15 @@ make build -j8
5659go install github.com/github-release/github-release@latest
5760
5861# upload dtm
59- echo ' Uploading ' dtm-${GOOS} -${GOARCH} ' ...'
60- github-release upload --security-token $github_token --user $user --repo $repo --tag $tag --file dtm --name dtm-${GOOS} -${GOARCH}
61- echo dtm-${GOOS} -${GOARCH} ' uploaded.'
62+ echo " Uploading ${DTM_CORE_BINARY} ..."
63+ # upload dtm to github release
64+ github-release upload --security-token $github_token --user $user --repo $repo --tag $tag --file dtm --name ${DTM_CORE_BINARY}
65+ # upload dtm to aws s3
66+ aws s3 cp dtm ${STORAGE_URL_WITH_TAG} /${DTM_CORE_BINARY} --acl public-read
67+ echo " ${DTM_CORE_BINARY} uploaded."
6268
6369# upload plugins and .md5 files
64- # In order to upload plug-ins to s3, you need to download awscli. After downloading awscli, you need to configure aws credentials.
70+ # In order to upload plug-ins to s3, you need to download aws cli.
71+ # After downloading aws cli, you need to configure aws credentials.
6572pip3 install awscli
66- aws s3 cp $plugin_dir s3://download.devstream.io/ ${tag} --recursive --acl public-read
73+ aws s3 cp $plugin_dir $STORAGE_URL_WITH_TAG --recursive --acl public-read
0 commit comments