def prod_check(cmd): puts('****************************************') puts(red(' P R O D U C T I O N ')) puts(' woah there cowboy! ') puts(red(' check ')) puts('****************************************') puts('Command Called => %s\n' % cyan(cmd)) proceed = prompt("Are you sure you want to do proceed?", default="no") if proceed.lower() != 'yes' and proceed.lower() != 'y': abort('change aborted!')
def create(self): """ Provisions a fully configured heroku app from scratch. Behind the scenes, you're getting the following: - heroku apps:create - git push heroku - heroku config - heroku addons - heroku domains - all post deploy hooks The command will handle creating a special git remote for the environment and can push from a non-master branch, things which are not easily accomplished with the heroku toolbelt. This is driven from the bltenv configuration. Usage: blt e:[env] heroku.create """ print "******** Creating New Heroku App ********" print "App Name: " + green(self.cfg['heroku']['app']) print "Environment: " + green(self.cfg['blt_envtype']) print "Branch: " + green(self.cfg['heroku']['git_branch']) proceed = prompt("\nLook good? ==>", default='no') if proceed.lower() != 'yes' and proceed.lower() != 'y': abort('Aborting heroku creation.') local('heroku apps:create %s --remote %s' % (self.cfg['heroku']['app'] , self.cfg['heroku']['git_remote'])) self.config('set') self.push() self.addon('add') # if we have domains configured, add them if 'domains' in self.cfg['heroku']: self.domain('add') # handle post deploy steps self.run(*self.cfg['heroku']['post_deploy']) print '\nHeroku Deploy Complete!' url = '==> http://%s.herokuapp.com/' % self.cfg['heroku']['app'] print url