Sha256: 7c5f4650228d576200062c2130f4aef6c54bd72d6bf171280e5dd29abb0af0d4

Contents?: true

Size: 763 Bytes

Versions: 1

Compression:

Stored size: 763 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

1 entries across 1 versions & 1 rubygems

Version Path
minke-0.14.0 lib/minke/commands/go.rb