Merge pull request #3461 from dokku/plugin-releasing

feat: allow skipping aws releases for plugins
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2019-03-11 18:46:40 -04:00
commit 83104bf919
1 file changed
+7 -3
+7 -3
View File
@@ -53,7 +53,7 @@ fn-require-bin() {
} }
main() { main() {
local RELEASE="$1" local RELEASE="$1" AWS_RELEASE="$2"
local CURRENT_VERSION FILENAME NEXT_VERSION ORG_REPO_NAME REPO_NAME major minor patch local CURRENT_VERSION FILENAME NEXT_VERSION ORG_REPO_NAME REPO_NAME major minor patch
if [[ -z "$RELEASE" ]]; then if [[ -z "$RELEASE" ]]; then
@@ -91,6 +91,10 @@ EOF
fn-require-bin "git" fn-require-bin "git"
if [[ "$AWS_RELEASE" != "true" ]] && [[ "$AWS_RELEASE" != "false" ]]; then
local AWS_RELEASE=true
fi
if [[ "$CI" != "true" ]] && [[ -z "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then if [[ "$CI" != "true" ]] && [[ -z "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then
log-info "You are running this without a DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN environment variable." log-info "You are running this without a DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN environment variable."
log-info "Doing so disables uploading releases to S3, which may be necessary for installing private plugins." log-info "Doing so disables uploading releases to S3, which may be necessary for installing private plugins."
@@ -104,7 +108,7 @@ EOF
done done
fi fi
if [[ -n "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then if [[ "$AWS_RELEASE" == "true" ]]; then
fn-require-bin "aws" fn-require-bin "aws"
fn-require-bin "curl" fn-require-bin "curl"
if [[ -z "$DOKKU_PLUGIN_S3_BUCKET" ]]; then if [[ -z "$DOKKU_PLUGIN_S3_BUCKET" ]]; then
@@ -156,7 +160,7 @@ EOF
REPO_NAME="$(echo "$ORG_REPO_NAME" | cut -d'/' -f2)" REPO_NAME="$(echo "$ORG_REPO_NAME" | cut -d'/' -f2)"
FILENAME="${REPO_NAME}-${NEXT_VERSION}.tar.gz" FILENAME="${REPO_NAME}-${NEXT_VERSION}.tar.gz"
if [[ -n "$DOKKU_PLUGIN_GITHUB_ACCESS_TOKEN" ]]; then if [[ "$AWS_RELEASE" == "true" ]]; then
DOKKU_PLUGIN_S3_BUCKET="${DOKKU_PLUGIN_S3_BUCKET%/}" DOKKU_PLUGIN_S3_BUCKET="${DOKKU_PLUGIN_S3_BUCKET%/}"
DOKKU_PLUGIN_S3_PATH="${DOKKU_PLUGIN_S3_PATH%/}" DOKKU_PLUGIN_S3_PATH="${DOKKU_PLUGIN_S3_PATH%/}"
if [[ "$DOKKU_PLUGIN_S3_PATH" != "/" ]]; then if [[ "$DOKKU_PLUGIN_S3_PATH" != "/" ]]; then