Sha256: bb93935770237a8b34d159545a129a1afe601f4fdbd8b5e56dd1ed9c7712109b

Contents?: true

Size: 824 Bytes

Versions: 121

Compression:

Stored size: 824 Bytes

Contents

module KnapsackPro
  module Config
    module CI
      class SnapCI < Base
        def node_total
          ENV['SNAP_WORKER_TOTAL']
        end

        def node_index
          index = ENV['SNAP_WORKER_INDEX']
          index.to_i - 1 if index
        end

        def node_build_id
          ENV['SNAP_PIPELINE_COUNTER']
        end

        def commit_hash
          ENV['SNAP_COMMIT']
        end

        # https://docs.snap-ci.com/environment-variables/
        # SNAP_BRANCH - the name of the git branch (not present on pull requests)
        # SNAP_UPSTREAM_BRANCH - the upstream branch for which the pull request was opened
        def branch
          ENV['SNAP_BRANCH'] || ENV['SNAP_UPSTREAM_BRANCH']
        end

        def project_dir
          ENV['SNAP_WORKING_DIR']
        end
      end
    end
  end
end

Version data entries

121 entries across 121 versions & 1 rubygems

Version Path
knapsack_pro-3.9.0 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.8.0 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.7.0 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.6.0 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.5.0 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.4.2 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.4.1 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.4.0 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.3.1 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.3.0 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.2.1 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.2.0 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.1.3 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.1.2 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.1.1 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.1.0 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-3.0.0 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-2.18.2 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-2.18.1 lib/knapsack_pro/config/ci/snap_ci.rb
knapsack_pro-2.18.0 lib/knapsack_pro/config/ci/snap_ci.rb