project

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

README

project - automate initial project setup Circle CI

Why

Whenever I need to setup new Go project I find myself copy/pasting from previous one. To solve that I created project tool that allows me to prepare different project template repositories and generate new project based on it.

How to use

Prerequisites

Make sure git is installed and required private keys are added to ssh agent. To add private key:

# If your private key is located at ~/.ssh/id_rsa
ssh-add ~/.ssh/id_rsa

Install

Download binary from here or go get:

go get github.com/nildev/project

Project templates

Using Golang template syntax prepare your project template, for example take a look at this one. Then create project.json file with actual values for each variable you have defined in your project template.

For example, content of such json file could be:

{
  "GitRepoFullPath": "https://bitbucket.org/nildev/selis",
  "OrgPath":"bitbucket.org/nildev",
  "BinaryName" : "selisd",
  "Org": "nildev",
  "ServiceName": "selis",
  "ServicePort" : "1080",
  "ServiceVersion" : "0.1.0"
}

Generate new project

  • replace $PATH_TO_NEW_PROJECT with path to directory where newly generated project should be created
  • replace $PATH_TO_CONFIG_JSON with path to json file with values for variables defined in template
  • replace $PATH_TO_TEMPLATE_REPO to project template git repo for example git@github.com:nildev/prj-tpl-cli-app.git

Run:

project setup --destDir=$PATH_TO_NEW_PROJECT --configFile=$PATH_TO_CONFIG_JSON --templateRepo="$PATH_TO_TEMPLATE_REPO"
for example:
project setup --destDir=$GOPATH/src/github.com/nildev/newapp --configFile=./newapp.config.json --templateRepo="git@github.com:nildev/prj-tpl-cli-app.git"

Template in private repository

If template is in private repository make sure that required ssh key is added to ssh agent.

Available templates

Here is a list of available templates. If you have created one please do a pull request with link to that repo.

Building from source

  1. Get repo
go get github.com/nildev/project
  1. Restore deps
godep restore 
  1. Run build
./build

Project Details

Release Notes

See the releases tab for more information on each release.

Contributing

See CONTRIBUTING for details on submitting patches and contacting developers via IRC and mailing lists.

License

project is released under the Apache 2.0 license. See the LICENSE file for details.

Specific components of project use code derivative from software distributed under other licenses; in those cases the appropriate licenses are stipulated alongside the code.

Documentation

Overview

`project` command allows you to perform various operations related to project setup.

$ go get github.com/nildev/project
$ project --help

Directories

Path Synopsis
Godeps
_workspace/src/github.com/Sirupsen/logrus
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
Package cli provides a minimal framework for creating and organizing command line Go applications.
_workspace/src/github.com/codegangsta/inject
Package inject provides utilities for mapping and injecting dependencies in various ways.
Package inject provides utilities for mapping and injecting dependencies in various ways.
_workspace/src/github.com/codeskyblue/go-sh
Package go-sh is intented to make shell call with golang more easily.
Package go-sh is intented to make shell call with golang more easily.
_workspace/src/github.com/coreos/go-semver/semver
Semantic Versions http://semver.org
Semantic Versions http://semver.org

Jump to

Keyboard shortcuts

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