Sha256: bcef95215d0b6aa140dbb2ea2acd1b58215211da39870e2fb54fadf1ec9db252

Contents?: true

Size: 1.47 KB

Versions: 291

Compression:

Stored size: 1.47 KB

Contents

module DPL
  class Provider
    class Catalyze < Provider
      def config
        {
            # the git repository to deploy to
            "target" => options[:target] || context.env['CATALYZE_TARGET'],
            # the pathspec for files to add to git for deployment e.g. your build directory. defaults to all files.
            "path" => options[:path] || context.env['CATALYZE_PATH'] || '.'
        }
      end

      def needs_key?
        false
      end

      def check_app
      end

      def check_auth
        error "Missing Catalyze target" unless config['target']
      end

      def push_app
        log "Deploying to Catalyze '#{config['target']}'"

        if options[:skip_cleanup]
          # create commit message
          build_num = context.env["TRAVIS_BUILD_NUMBER"]
          commit = context.env["TRAVIS_COMMIT"]
          repo_slug = context.env["TRAVIS_REPO_SLUG"]
          branch = context.env["TRAVIS_BRANCH"]
          if build_num && commit && repo_slug && branch
            commit_message = "Build ##{build_num} (#{commit}) of #{repo_slug}@#{branch}"
          else
            commit_message = "Local build"
          end

          log "Using build files for deployment"
          context.shell "git checkout HEAD"
          context.shell "git add #{config["path"]} --all --force"
          context.shell "git commit -m \"#{commit_message}\" --quiet"
        end

        context.shell "git push --force #{config['target']} HEAD:master"
      end
    end
  end
end

Version data entries

291 entries across 291 versions & 3 rubygems

Version Path
dpl-catalyze-1.9.3 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.2.travis.2764.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.2 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.2.travis.2763.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.2.travis.2762.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.2.travis.2750.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.2.travis.2749.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.2.travis.2748.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.2.travis.2737.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.2.travis.2725.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.2.travis.2724.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.1 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.1.travis.2711.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.1.travis.2710.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.1.travis.2705.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.0 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.1.travis.2689.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.1.travis.2669.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.1.travis.2666.5 lib/dpl/provider/catalyze.rb
dpl-catalyze-1.9.1.travis.2660.5 lib/dpl/provider/catalyze.rb