Sha256: c1dfc996abb2c53002d12b5da765109d971ee12b90474b684f520e9f4939be9b

Contents?: true

Size: 769 Bytes

Versions: 2

Compression:

Stored size: 769 Bytes

Contents

module Minke
  module Commands
    class Go
      def commands config
        {
          :build => {
            :get => [['go','get','-t','-v','-d','./...']],
            :build => [['go','build','-a','-installsuffix','cgo','-ldflags','\'-s\'','-o', "#{config['application_name']}"]],
            :test => [['go','test','./...']]
          },
          :docker => {
            :image => 'golang:latest',
            :env => ['CGO_ENABLED=0'],
            :binds => ["#{ENV['GOPATH']}/src:/go/src"],
            :working_directory => "#{working_directory}"
          }
        }
      end

      def working_directory
        dir = File.expand_path('../.')
        gopath = "#{ENV['GOPATH']}"
        new_dir = "/go" + dir.gsub(gopath,'')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
minke-0.16.0 lib/minke/commands/go.rb
minke-0.15.0 lib/minke/commands/go.rb