From b374a4ed7261bf356bc10b1ef8678dc9a09c6080 Mon Sep 17 00:00:00 2001 From: Adam King Date: Thu, 19 Jan 2017 15:33:52 -0500 Subject: [PATCH 1/3] Add the bluemixcloudfoundry deployment type Signed-off-by: Adam King --- README.md | 2 +- assets/travis.sh | 6 +- lib/travis/cli/setup.rb | 57 ++++++++++--------- lib/travis/cli/setup/bluemix_cloud_foundry.rb | 21 +++++++ travis.gemspec | 1 + 5 files changed, 55 insertions(+), 32 deletions(-) create mode 100644 lib/travis/cli/setup/bluemix_cloud_foundry.rb diff --git a/README.md b/README.md index d0824eb8..f3cbce23 100644 --- a/README.md +++ b/README.md @@ -1220,7 +1220,7 @@ Helps you configure Travis addons. -R, --store-repo SLUG like --repo, but remembers value for current directory -f, --force override config section if it already exists -Available services: `anynines`, `appfog`, `artifacts`, `biicode`, `cloudcontrol`, `cloudfiles`, `cloudfoundry`, `cloud66`, `codedeploy`, `deis`, `divshot`, `elasticbeanstalk`, `engineyard`, `gcs`, `hackage`, `heroku`, `modulus`, `npm`, `ninefold`, `nodejitsu`, `openshift`, `opsworks`, `pypi`, `releases`, `rubygems`, `s3` and `sauce_connect`. +Available services: `anynines`, `appfog`, `artifacts`, `biicode`, `bluemixcloudfoundry`, `cloudcontrol`, `cloudfiles`, `cloudfoundry`, `cloud66`, `codedeploy`, `deis`, `divshot`, `elasticbeanstalk`, `engineyard`, `gcs`, `hackage`, `heroku`, `modulus`, `npm`, `ninefold`, `nodejitsu`, `openshift`, `opsworks`, `pypi`, `releases`, `rubygems`, `s3` and `sauce_connect`. Example: diff --git a/assets/travis.sh b/assets/travis.sh index 1a9f1583..4d990d31 100644 --- a/assets/travis.sh +++ b/assets/travis.sh @@ -21,7 +21,7 @@ if type compdef 1>/dev/null 2>/dev/null; then compdef _travis travis _travis() { _travis_complete $((${#words} - 1)) "${words[2]}"; } _travis_commands() { list=(accounts:"displays accounts and their subscription status" branches:"displays the most recent build for each branch" cache:"lists or deletes repository caches" cancel:"cancels a job or build" console:"interactive shell" disable:"disables a project" enable:"enables a project" encrypt:"encrypts values for the .travis.yml" encrypt-file:"encrypts a file and adds decryption steps to .travis.yml" endpoint:"displays or changes the API endpoint" env:"show or modify build environment variables" help:"helps you out when in dire need of information" history:"displays a projects build history" init:"generates a .travis.yml and enables the project" lint:"display warnings for a .travis.yml" login:"authenticates against the API and stores the token" logout:"deletes the stored API token" logs:"streams test logs" monitor:"live monitor for what's going on" open:"opens a build or job in the browser" pubkey:"prints out a repository's public key" raw:"makes an (authenticated) API call and prints out the result" report:"generates a report useful for filing issues" repos:"lists repositories the user has certain permissions on" requests:"lists recent requests" restart:"restarts a build or job" settings:"access repository settings" setup:"sets up an addon or deploy target" show:"displays a build or job" sshkey:"checks, updates or deletes an SSH key" status:"checks status of the latest build" sync:"triggers a new sync with GitHub" token:"outputs the secret API token" version:"outputs the client version" whatsup:"lists most recent builds" whoami:"outputs the current user") _describe -t common-commands 'common commands' list; } - _travis_setup() { list=(anynines:"automatic deployment to anynines" appfog:"automatic deployment to Appfog" artifacts:"automatic artifact shipping to S3" biicode:"automatic publish to biicode" cloudcontrol:"automatic deployment to cloudControl" cloudfiles:"automatic pushing to Rackspace Cloud Files" cloudfoundry:"automatic deployment to Cloud Foundry" cloud66:"Automatic deployment to Cloud 66" codedeploy:"triggering a new deployment on Amazon CodeDeploy" deis:"automatic deployment to a deis app" divshot:"deployment to Divshot.io" elasticbeanstalk:"deployment to AWS Elastic Beanstalk" engineyard:"automatic deployment to Engine Yard" gcs:"automatic pushing to Google Cloud Storage" hackage:"automatic deployment of hackage packages" heroku:"automatic deployment to Heroku" modulus:"deployment to Modulus" npm:"automatic release to NPM" ninefold:"Automatic deployment to Ninefold" nodejitsu:"automatic deployment to Nodejitsu" openshift:"automatic deployment to OpenShfit" opsworks:"deployment to OpsWorks" pypi:"automatic deployment to PyPI" releases:"Upload Assets to GitHub Releases" rubygems:"automatic release to RubyGems" s3:"automatic pushing to S3" sauce_connect:"Sauce Connet addon for Sauce Labs integration") _describe -t common-commands 'common commands' list; } + _travis_setup() { list=(anynines:"automatic deployment to anynines" appfog:"automatic deployment to Appfog" artifacts:"automatic artifact shipping to S3" biicode:"automatic publish to biicode" bluemixcloudfoundry:"automatic deployment to Bluemix" cloudcontrol:"automatic deployment to cloudControl" cloudfiles:"automatic pushing to Rackspace Cloud Files" cloudfoundry:"automatic deployment to Cloud Foundry" cloud66:"Automatic deployment to Cloud 66" codedeploy:"triggering a new deployment on Amazon CodeDeploy" deis:"automatic deployment to a deis app" divshot:"deployment to Divshot.io" elasticbeanstalk:"deployment to AWS Elastic Beanstalk" engineyard:"automatic deployment to Engine Yard" gcs:"automatic pushing to Google Cloud Storage" hackage:"automatic deployment of hackage packages" heroku:"automatic deployment to Heroku" modulus:"deployment to Modulus" npm:"automatic release to NPM" ninefold:"Automatic deployment to Ninefold" nodejitsu:"automatic deployment to Nodejitsu" openshift:"automatic deployment to OpenShfit" opsworks:"deployment to OpsWorks" pypi:"automatic deployment to PyPI" releases:"Upload Assets to GitHub Releases" rubygems:"automatic release to RubyGems" s3:"automatic pushing to S3" sauce_connect:"Sauce Connet addon for Sauce Labs integration") _describe -t common-commands 'common commands' list; } _travis_settings() { list=(builds_only_with_travis_yml:"Only run builds with a .travis.yml" build_pushes:"Build pushes" build_pull_requests:"Build pull requests" maximum_number_of_builds:"Maximum number of concurrent builds") _describe -t common-commands 'common commands' list; } _travis_init() { list=(c:'initialize c project' clojure:'initialize clojure project' cpp:'initialize cpp project' erlang:'initialize erlang project' go:'initialize go project' groovy:'initialize groovy project' haskell:'initialize haskell project' java:'initialize java project' node_js:'initialize node_js project' objective-c:'initialize objective-c project' perl:'initialize perl project' php:'initialize php project' python:'initialize python project' ruby:'initialize ruby project' scala:'initialize scala project') _describe -t common-commands 'common commands' list; } _travis_option() { @@ -68,7 +68,7 @@ elif type compctl 1>/dev/null 2>/dev/null; then compctl -K _travis travis _travis() { read -cA words && _travis_complete $((${#words} - 1)) "${words[2]}"; } _travis_commands() { reply=("accounts" "branches" "cache" "cancel" "console" "disable" "enable" "encrypt" "encrypt-file" "endpoint" "env" "help" "history" "init" "lint" "login" "logout" "logs" "monitor" "open" "pubkey" "raw" "report" "repos" "requests" "restart" "settings" "setup" "show" "sshkey" "status" "sync" "token" "version" "whatsup" "whoami"); } - _travis_setup() { reply=("anynines" "appfog" "artifacts" "biicode" "cloudcontrol" "cloudfiles" "cloudfoundry" "cloud66" "codedeploy" "deis" "divshot" "elasticbeanstalk" "engineyard" "gcs" "hackage" "heroku" "modulus" "npm" "ninefold" "nodejitsu" "openshift" "opsworks" "pypi" "releases" "rubygems" "s3" "sauce_connect"); } + _travis_setup() { reply=("anynines" "appfog" "artifacts" "biicode" "bluemixcloudfoundry" "cloudcontrol" "cloudfiles" "cloudfoundry" "cloud66" "codedeploy" "deis" "divshot" "elasticbeanstalk" "engineyard" "gcs" "hackage" "heroku" "modulus" "npm" "ninefold" "nodejitsu" "openshift" "opsworks" "pypi" "releases" "rubygems" "s3" "sauce_connect"); } _travis_settings() { reply=(builds_only_with_travis_yml build_pushes build_pull_requests maximum_number_of_builds); } _travis_init() { reply=("c" "clojure" "cpp" "erlang" "go" "groovy" "haskell" "java" "node_js" "objective-c" "perl" "php" "python" "ruby" "scala"); } _travis_option() { @@ -115,7 +115,7 @@ elif type complete 1>/dev/null 2>/dev/null; then complete -F _travis travis _travis() { _travis_complete "$COMP_CWORD" "${COMP_WORDS[1]}"; } _travis_commands() { COMPREPLY=( $(compgen -W "accounts branches cache cancel console disable enable encrypt encrypt-file endpoint env help history init lint login logout logs monitor open pubkey raw report repos requests restart settings setup show sshkey status sync token version whatsup whoami" -- "${COMP_WORDS[COMP_CWORD]}") ); } - _travis_setup() { COMPREPLY=( $(compgen -W "anynines appfog artifacts biicode cloudcontrol cloudfiles cloudfoundry cloud66 codedeploy deis divshot elasticbeanstalk engineyard gcs hackage heroku modulus npm ninefold nodejitsu openshift opsworks pypi releases rubygems s3 sauce_connect" -- "${COMP_WORDS[COMP_CWORD]}") ); } + _travis_setup() { COMPREPLY=( $(compgen -W "anynines appfog artifacts biicode bluemixcloudfoundry cloudcontrol cloudfiles cloudfoundry cloud66 codedeploy deis divshot elasticbeanstalk engineyard gcs hackage heroku modulus npm ninefold nodejitsu openshift opsworks pypi releases rubygems s3 sauce_connect" -- "${COMP_WORDS[COMP_CWORD]}") ); } _travis_settings() { COMPREPLY=( $(compgen -W "builds_only_with_travis_yml build_pushes build_pull_requests maximum_number_of_builds" -- "${COMP_WORDS[COMP_CWORD]}") ); } _travis_init() { COMPREPLY=( $(compgen -W ""c" "clojure" "cpp" "erlang" "go" "groovy" "haskell" "java" "node_js" "objective-c" "perl" "php" "python" "ruby" "scala"" -- "${COMP_WORDS[COMP_CWORD]}") ); } _travis_option() { diff --git a/lib/travis/cli/setup.rb b/lib/travis/cli/setup.rb index b02397b0..0a6845dd 100644 --- a/lib/travis/cli/setup.rb +++ b/lib/travis/cli/setup.rb @@ -3,34 +3,35 @@ module Travis module CLI class Setup < RepoCommand - autoload :Anynines, 'travis/cli/setup/anynines' - autoload :Appfog, 'travis/cli/setup/appfog' - autoload :Artifacts, 'travis/cli/setup/artifacts' - autoload :Biicode, 'travis/cli/setup/biicode' - autoload :CloudControl, 'travis/cli/setup/cloud_control' - autoload :CloudFoundry, 'travis/cli/setup/cloud_foundry' - autoload :CodeDeploy, 'travis/cli/setup/code_deploy' - autoload :EngineYard, 'travis/cli/setup/engine_yard' - autoload :Heroku, 'travis/cli/setup/heroku' - autoload :Nodejitsu, 'travis/cli/setup/nodejitsu' - autoload :NPM, 'travis/cli/setup/npm' - autoload :OpenShift, 'travis/cli/setup/open_shift' - autoload :PyPI, 'travis/cli/setup/pypi' - autoload :RubyGems, 'travis/cli/setup/ruby_gems' - autoload :Ninefold, 'travis/cli/setup/ninefold' - autoload :S3, 'travis/cli/setup/s3' - autoload :CloudFiles, 'travis/cli/setup/cloud_files' - autoload :Divshot, 'travis/cli/setup/divshot' - autoload :Hackage, 'travis/cli/setup/hackage' - autoload :OpsWorks, 'travis/cli/setup/opsworks' - autoload :SauceConnect, 'travis/cli/setup/sauce_connect' - autoload :Modulus, 'travis/cli/setup/modulus' - autoload :Releases, 'travis/cli/setup/releases' - autoload :GCS, 'travis/cli/setup/gcs' - autoload :Cloud_66, 'travis/cli/setup/cloud_66' - autoload :ElasticBeanstalk, 'travis/cli/setup/elastic_beanstalk' - autoload :Deis, 'travis/cli/setup/deis' - autoload :Service, 'travis/cli/setup/service' + autoload :Anynines, 'travis/cli/setup/anynines' + autoload :Appfog, 'travis/cli/setup/appfog' + autoload :Artifacts, 'travis/cli/setup/artifacts' + autoload :Biicode, 'travis/cli/setup/biicode' + autoload :BluemixCloudFoundry, 'travis/cli/setup/bluemix_cloud_foundry' + autoload :CloudControl, 'travis/cli/setup/cloud_control' + autoload :CloudFoundry, 'travis/cli/setup/cloud_foundry' + autoload :CodeDeploy, 'travis/cli/setup/code_deploy' + autoload :EngineYard, 'travis/cli/setup/engine_yard' + autoload :Heroku, 'travis/cli/setup/heroku' + autoload :Nodejitsu, 'travis/cli/setup/nodejitsu' + autoload :NPM, 'travis/cli/setup/npm' + autoload :OpenShift, 'travis/cli/setup/open_shift' + autoload :PyPI, 'travis/cli/setup/pypi' + autoload :RubyGems, 'travis/cli/setup/ruby_gems' + autoload :Ninefold, 'travis/cli/setup/ninefold' + autoload :S3, 'travis/cli/setup/s3' + autoload :CloudFiles, 'travis/cli/setup/cloud_files' + autoload :Divshot, 'travis/cli/setup/divshot' + autoload :Hackage, 'travis/cli/setup/hackage' + autoload :OpsWorks, 'travis/cli/setup/opsworks' + autoload :SauceConnect, 'travis/cli/setup/sauce_connect' + autoload :Modulus, 'travis/cli/setup/modulus' + autoload :Releases, 'travis/cli/setup/releases' + autoload :GCS, 'travis/cli/setup/gcs' + autoload :Cloud_66, 'travis/cli/setup/cloud_66' + autoload :ElasticBeanstalk, 'travis/cli/setup/elastic_beanstalk' + autoload :Deis, 'travis/cli/setup/deis' + autoload :Service, 'travis/cli/setup/service' description "sets up an addon or deploy target" on('-f', '--force', 'override config section if it already exists') diff --git a/lib/travis/cli/setup/bluemix_cloud_foundry.rb b/lib/travis/cli/setup/bluemix_cloud_foundry.rb new file mode 100644 index 00000000..1adf0357 --- /dev/null +++ b/lib/travis/cli/setup/bluemix_cloud_foundry.rb @@ -0,0 +1,21 @@ +require 'travis/cli/setup' + +module Travis + module CLI + class Setup + class BluemixCloudFoundry < Service + description "automatic deployment to Bluemix Cloud Foundry" + + def run + deploy 'bluemixcloudfoundry' do |config| + config['username'] ||= ask("Bluemix username: ").to_s + config['password'] ||= ask("Bluemix password: ") { |q| q.echo = "*" }.to_s + config['organization'] ||= ask("Bluemix organization: ").to_s + config['space'] ||= ask("Bluemix space: ").to_s + config['region'] ||= ask("Bluemix region [ng, eu-gb, au-syd]: ") { |q| q.default = "ng" } + end + end + end + end + end +end diff --git a/travis.gemspec b/travis.gemspec index f6912692..73b93676 100644 --- a/travis.gemspec +++ b/travis.gemspec @@ -199,6 +199,7 @@ Gem::Specification.new do |s| "lib/travis/cli/setup/appfog.rb", "lib/travis/cli/setup/artifacts.rb", "lib/travis/cli/setup/biicode.rb", + "lib/travis/cli/setup/bluemix_cloud_foundry.rb", "lib/travis/cli/setup/cloud_66.rb", "lib/travis/cli/setup/cloud_control.rb", "lib/travis/cli/setup/cloud_files.rb", From 158d529ff3b6bb2236c14463e50dd0f2ee6fbe5d Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 20 Jan 2017 10:56:19 -0500 Subject: [PATCH 2/3] Set edge true for bluemixcloudfoundry deploy type Set edge true for bluemixcloudfoundry deploy type to eliminate the manual step when using the CLI to generate .travis.yml Signed-off-by: Adam King --- lib/travis/cli/setup/bluemix_cloud_foundry.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/travis/cli/setup/bluemix_cloud_foundry.rb b/lib/travis/cli/setup/bluemix_cloud_foundry.rb index 1adf0357..5f76439b 100644 --- a/lib/travis/cli/setup/bluemix_cloud_foundry.rb +++ b/lib/travis/cli/setup/bluemix_cloud_foundry.rb @@ -8,6 +8,7 @@ class BluemixCloudFoundry < Service def run deploy 'bluemixcloudfoundry' do |config| + config['edge'] = true config['username'] ||= ask("Bluemix username: ").to_s config['password'] ||= ask("Bluemix password: ") { |q| q.echo = "*" }.to_s config['organization'] ||= ask("Bluemix organization: ").to_s From 8dd6dfd9d8f0a020e5f5b0ec31111512e7a41043 Mon Sep 17 00:00:00 2001 From: Adam King Date: Thu, 26 Jan 2017 13:24:03 -0500 Subject: [PATCH 3/3] Remove edge from bluemixcloudfoundry edge no longer required for bluemixcloudfoundry. Remove it. Signed-off-by: Adam King --- lib/travis/cli/setup/bluemix_cloud_foundry.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/travis/cli/setup/bluemix_cloud_foundry.rb b/lib/travis/cli/setup/bluemix_cloud_foundry.rb index 5f76439b..1adf0357 100644 --- a/lib/travis/cli/setup/bluemix_cloud_foundry.rb +++ b/lib/travis/cli/setup/bluemix_cloud_foundry.rb @@ -8,7 +8,6 @@ class BluemixCloudFoundry < Service def run deploy 'bluemixcloudfoundry' do |config| - config['edge'] = true config['username'] ||= ask("Bluemix username: ").to_s config['password'] ||= ask("Bluemix password: ") { |q| q.echo = "*" }.to_s config['organization'] ||= ask("Bluemix organization: ").to_s