buildinfo

package module
v0.0.0-...-bf70fcc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 2 Imported by: 7

README

buildinfo

Build Info for Go Binaries

GIT_COMMIT := $(shell git rev-list -1 HEAD)
DT := $(shell date +”%Y.%m.%d.%H%M%S”)
ME := $(shell whoami)
HOST := $(shell hostname)
PRODUCT := "MYAPI"

docker:
    CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X github.com/digitalcircle-com-br/buildinfo.Ver=$(GIT_COMMIT) -X github.com/digitalcircle-com-br/buildinfo.BuildDate=$(DT) -X github.com/digitalcircle-com-br/buildinfo.BuildUser=$(ME) -X github.com/digitalcircle-com-br/buildinfo.BuildHost=$(HOST) -X github.com/digitalcircle-com-br/buildinfo.Product=$(PRODUCT)"  -o deploy/api ./main.go
    cd deploy && \
	docker build -t mymimg .
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "LOCAL",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}/main.go",
            "buildFlags": "-ldflags '-X github.com/digitalcircle-com-br/buildinfo.Ver=DEV -X github.com/digitalcircle-com-br/buildinfo.BuildDate=Now -X github.com/digitalcircle-com-br/buildinfo.BuildUser=ME -X github.com/digitalcircle-com-br/buildinfo.BuildHost=localhost -X github.com/digitalcircle-com-br/buildinfo.Product=PRODUCT",
            "env": {
                "DSN": "host=localhost user=XXX password=XXX dbname=XXX port=5432 sslmode=disable TimeZone=America/Sao_Paulo",
                "REDIS": "redis://localhost:6379"
            }
        }
    ]
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildDate string
View Source
var BuildHost string
View Source
var BuildUser string
View Source
var Product string

Functions

func String

func String() string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL