GithubHelp home page GithubHelp logo

trung85-go / go-project-blueprint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from martinheinz/go-project-blueprint

1.0 1.0 0.0 8.36 MB

Blueprint/Boilerplate For Golang Projects

License: MIT License

Makefile 29.55% Shell 11.43% Go 57.61% Dockerfile 1.40%

go-project-blueprint's Introduction

Blueprint/Boilerplate For Golang Projects

Build Status Maintainability Rating Test Coverage Go Report Card

Blog Posts - More Information About This Repo

You can find more information about this project/repository and how to use it in following blog posts:

Setting Up

  • Replace All Occurrences of trung85-go/go-project-blueprint with your username repository name
  • Replace All Occurrences of blueprint with your desired image name

Adding New Libraries/Dependencies

go mod vendor

Using GitHub Registry

Create and Push:

docker login docker.pkg.github.com -u <USERNAME> -p <GITHUB_TOKEN>
docker build -t  docker.pkg.github.com/trung85-go/go-project-blueprint/blueprint:latest .
# make container
docker push docker.pkg.github.com/trung85-go/go-project-blueprint/blueprint:latest
# make push

List all docker packages on github: https://github.com/trung85-go/go-project-blueprint/packages

Pull and Run:

docker pull docker.pkg.github.com/trung85-go/go-project-blueprint/blueprint:latest
docker run -p 1234:1234 \
           -e BLUEPRINT_DSN="postgres://<USER>:<PASSWORD>@<DOCKER_SERVICE/URL>:<PORT>/<DB>?sslmode=disable" \
           -e BLUEPRINT_API_KEY="api_key" \
           docker.pkg.github.com/trung85-go/go-project-blueprint/blueprint:latest

Setup new SonarCloud Project

  • https://docs.travis-ci.com/user/sonarcloud/
  • On SonarCloud:
    • Click Plus Sign in Upper Right Corner
    • Analyze New Project
    • Click GitHub app configuration link
    • Configure SonarCloud
    • Select Repository and Save
    • Go Back to Analyze Project
    • Tick Newly Added Repository
    • Click Set Up
    • Click Configure with Travis
    • Copy the Command to Encrypt the Travis Token
    • Run travis encrypt --com <TOKEN_YOU_COPPIED> (generate token in SonarCloud)
    • Populate the secure Field in .travis.yml with outputted string
    • Follow steps to populate your sonar-project.properties
    • Push
  • On Travis CI:
    • Set DOCKER_USERNAME. (organization github trung85-go)
    • Set DOCKER_PASSWORD to Your GitHub Registry Token (develop github token)

Setup CodeClimate

Swagger

  • Application uses gin-swagger.
  • To generate/update docs use swag init (from /go-project-blueprint/cmd/blueprint)
  • You can find generated docs in docs package

To view docs, navigate to http://localhost:1234/swagger/index.html or to http://localhost:1234/swagger/doc.json for raw JSON

go-project-blueprint's People

Contributors

martinheinz avatar tademnf avatar marvincaspar avatar trung85 avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.