Code Monkey home page Code Monkey logo

taiji's Introduction

太极

无极生太极,太极生两仪。。。 一个go脚手架,目的是能够编译出多平台的二进制,镜像,rpm,debu,等格式的软件包,自动生成版本且保持一致

安装使用

cd <项目目录> GOPATH 下: taiji init <文件类型> 非GOPATH 下: taiji init <文件类型> --mod=<模块名字>

文件说明

命令行

  • 命令使用cobra详情可以查看官方文档,创建的cmd文件夹即为cobra的命令入口

配置文件

配置使用viper,读取配置文件名字为config.yaml; 默认会读取以下目录

  1. 程序的根目录

  2. 程序下的config目录

  3. /etc/<程序的名字>目录

  4. 用户配置目录

Dockerfile

采用多阶编译,镜像中修改时区为国内,以及镜像源替换为国内的命令

Makefile

在编译的时候注入版本信息到go文件中,如果有tag则为tag版本没有则为提交次数和hash,提供常用系统下的交编译命令,去除了字符链接缩小体积

产物

artifacts
├── bin
│   ├── test
│   ├── test-1.8f66f5e-darwin-amd64
│   ├── test-1.8f66f5e-darwin-arm64
│   ├── test-1.8f66f5e-linux-amd64
│   ├── test-1.8f66f5e-linux-arm64
│   ├── test-1.8f66f5e-windows-amd64.exe
│   └── test-1.8f66f5e-windows-arm64.exe
├── deb
│   └── test-1.8f66f5e-arm64.deb
├── rpm
│   ├── RPMS
│   │   └── aarch64
│   │       └── test-1.8f66f5e-1.el7.aarch64.rpm
│   └── SRPMS
│       └── test-1.8f66f5e-1.el7.src.rpm
└── tgz
    └── test-1.8f66f5e.tar.gz

TODO

  • 使用git describe --tags --always --dirty="-dev"替代if判断来生成自动生成版本号

  • 多平台支持,本地直接生成已经是实现,docker,rpm,deb考虑通过buildkit实现

taiji's People

Contributors

naturelr avatar

Stargazers

 avatar

Watchers

 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.