Sha256: d251f77e9d999979811bcd9260a014262604ebe269bc6a7929561fee8d51a15a

Contents?: true

Size: 1.13 KB

Versions: 470

Compression:

Stored size: 1.13 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 --jitsuconf #{File.expand_path(CONFIG_FILE)} --release=yes"
      end
    end
  end
end

Version data entries

470 entries across 470 versions & 1 rubygems

Version Path
dpl-1.8.18.travis.1553.3 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1552.3 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1551.3 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1544.3 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1543.3 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1530.3 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1529.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.13.travis.1528.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1527.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1518.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1496.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1492.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1489.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1472.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.17 lib/dpl/provider/nodejitsu.rb
dpl-1.8.18.travis.1465.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.17.travis.1464.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.17.travis.1460.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.17.travis.1444.4 lib/dpl/provider/nodejitsu.rb
dpl-1.8.17.travis.1416.4 lib/dpl/provider/nodejitsu.rb