diff --git a/DOCS.md b/DOCS.md index 0a686d0..6f2ea68 100644 --- a/DOCS.md +++ b/DOCS.md @@ -122,6 +122,17 @@ pipeline: + scale: 2 ``` +Example configuration for specifying the `--public` argument for the `now` CLI. + +```diff +pipeline: + now: + image: lucap/drone-now + deploy_name: deployment-name + secrets: [ now_token ] +- scale: 2 ++ public: true +``` # Secret Reference @@ -158,4 +169,4 @@ rules_file : File that contain set of rules scale -: Min and Max scaling values \ No newline at end of file +: Min and Max scaling values diff --git a/README.md b/README.md index 085753d..bcb715b 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,5 @@ pipeline: directory: public alias: my.deployment.com secrets: [ now_token ] + public: true ``` diff --git a/script.sh b/script.sh index 3d39795..75514e6 100644 --- a/script.sh +++ b/script.sh @@ -4,6 +4,15 @@ set -e NOW_DEPLOY_OPTIONS=" --no-clipboard" NOW_AUTH="" +# Is this a public deployment? +if [ "$PLUGIN_PUBLIC" == "true" ] +then + echo "> adding option --public. If you are using an OSS plan, your source and logs will be public!" + NOW_DEPLOY_OPTIONS="${NOW_DEPLOY_OPTIONS} --public" +else + echo "> --public option not specified." +fi + # Get the token or error if [ -z "$PLUGIN_NOW_TOKEN" ] then @@ -94,4 +103,4 @@ then exit $rc else echo $'\n'"> Successfully deployed! $NOW_DEPLOYMENT_URL"$'\n' -fi \ No newline at end of file +fi