Sha256: 8cf7067e3778ba353a5e64e3c73de57ad50fffe4fb49e040ed283758a8c66bcf
Contents?: true
Size: 1.44 KB
Versions: 5
Compression:
Stored size: 1.44 KB
Contents
require "generators/gomicroservice/version" require 'minke/generators/register' require 'minke/generators/config' module Minke module Generators module GoMicroservice # Register the template with minke config = Minke::Generators::Config.new config.name = 'minke-generator-go' config.template_location = File.expand_path(File.dirname(__FILE__)) + '/gomicroservice/scaffold' config.build_settings = Minke::Generators::BuildSettings.new config.build_settings.build_commands = Minke::Generators::BuildCommands.new.tap do |bc| bc.fetch = [['/bin/bash', '-c', "export GOPATH=/packages && go get -v -d -t $(go list -f '{{ join .Imports \"\\n\" }}' ./... | grep -v '<%= namespace %>/<%= application_name %>') && echo Downloaded packages"]] bc.build = [['/bin/bash', '-c', 'go build -a -installsuffix cgo -ldflags \'-s\' -o <%= application_name %>']] bc.test = [['/bin/bash', '-c', 'go test $(go list ./... | grep -v /vendor/)']] end config.build_settings.docker_settings = Minke::Generators::DockerSettings.new.tap do |bs| bs.image = 'golang:latest' bs.env = ['CGO_ENABLED=0'] bs.binds = [ "<%= src_root %>:/go/src/<%= namespace %>/<%= application_name %>", "<%= src_root %>/vendor:/packages/src" ] bs.working_directory = '/go/src/<%= namespace %>/<%= application_name %>' end Minke::Generators.register config end end end
Version data entries
5 entries across 5 versions & 1 rubygems