Sha256: 9efe19708205dc59ffccea4b2120350b6acf4cd5a5957e32914df3685b81176d

Contents?: true

Size: 1.1 KB

Versions: 25

Compression:

Stored size: 1.1 KB

Contents

module DPL
  class Provider
    class Nodejitsu < Provider
      CONFIG_FILE = '.dpl/jitsu.json'
      requires 'json'
      npm_g 'jitsu'

      def config
        {
          "username"     => option(:username, :user_name, :user),
          "apiToken"     => option(:api_key),
          "apiTokenName" => "travis"
        }
      end

      def check_auth
        File.open(CONFIG_FILE, 'w') { |f| f << config.to_json }
      end

      def check_app
        error "missing package.json" unless File.exist? 'package.json'

        package = JSON.parse File.read('package.json')
        message = "missing %s in package.json, see https://www.nodejitsu.com/documentation/appendix/package-json/"
        error message % "subdomain"    unless package['subdomain']
        error message % "node version" unless package['engines'] and package['engines']['node']
        error message % "start script" unless package['scripts'] and package['scripts']['start']
      end

      def needs_key?
        false
      end

      def push_app
        context.shell "jitsu deploy -j #{CONFIG_FILE} --release=yes"
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
dpl-1.4.7.travis.127.2 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.126.2 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.124.2 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.125.2 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.119.2 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.118.4 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.117.3 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.117.4 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.117.6 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.117.5 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.117.1 lib/dpl/provider/nodejitsu.rb
dpl-1.4.6.travis.116.4 lib/dpl/provider/nodejitsu.rb
dpl-1.4.5 lib/dpl/provider/nodejitsu.rb
dpl-1.4.4 lib/dpl/provider/nodejitsu.rb
dpl-1.4.3 lib/dpl/provider/nodejitsu.rb
dpl-1.4.2 lib/dpl/provider/nodejitsu.rb
dpl-1.4.1 lib/dpl/provider/nodejitsu.rb
dpl-1.4.0 lib/dpl/provider/nodejitsu.rb
dpl-1.3.4 lib/dpl/provider/nodejitsu.rb