Skip to content
Snippets Groups Projects
Commit fd2f43b8 authored by Tamer Tas's avatar Tamer Tas
Browse files

wiki: version control the wiki

parent 6da364d0
Branches
No related tags found
No related merge requests found
......@@ -121,6 +121,4 @@ Take a look at the [Templates](https://github.com/tmrts/boilr/wiki/Templates) pa
# Need Help? Found a bug? Want a Feature?
If you'd like to contribute, share your opinions or ask questions, please feel free to open an issue.
The [Wiki](https://github.com/tmrts/boilr/wiki) is public and edits are open to everyone, feel free to contribute to sections where you feel needs improvement.
At this stage, user feedback is of **utmost importance**, every contribution is welcome however small it may be.
# Creating Templates
At the top-level of your repository include an optional "project.json"
file that contains the default values that you'd like to substitute
```json
{
"Name": "example-project",
"Author": "Tamer Tas",
"Email": "contact@tmrts.com",
"PrintHomeDir": true,
"License": [
"MIT",
"GNU GPL v3.0",
"Apache Software License 2.0"
]
}
```
Now, create a `template` folder that contains all the files that you'd like to
be part of your project template. When using a template, the contents of this
folder will be parsed and copied to the target directory requested by user
`template` directory:
```txt
template/
LICENSE
README.md
{{Name}}.go
{{time "Mon Jan 2 15:04:05 -0700 MST 2006"}}.log
```
`LICENSE` file:
```txt
{{if eq License "MIT"}}
// MIT License
{{else if eq License "GNU GPL v3.0"}}
// GNU GPL v3.0 License
{{else if eq License "Apache Software License 2.0"}}
// Apache License
{{end}}
```
`README` file:
```markdown
This project was created by {{Author}}.
This project is under the {{License}} license.
For more information please send an e-mail to `{{Email}}`.
{{if PrintHomeDir}}
During the project creation the home directory path was `{{env "HOME" | toLower}}`.
{{end}}
```
## File/Directory Name Templating
File/Directory names can also be templated:
- `{{Name}}.go` file will be `example-project.go`.
- `{{time "Mon_Jan_2_15:04_2006"}}.log` file will be formatted with the given example
time format using the current time. It will become `Mon_Dec_14_15:08_2015.log`
**Note:**
- Defined values are by convention, capital CamelCase and functions are lowercase camelCase.
- The user will be prompted for a choice for each value in the `project.json` template
- Only the contents of the `template` folder will be copied.
# Install Script
Download the latest version
of [install](https://raw.githubusercontent.com/tmrts/boilr/master/install)
script, which is also included in
every [release](https://github.com/tmrts/boilr/releases), and run it to install
the `boilr` binary. The `boilr` binary will be installed to `~/bin/boilr`.
# Binary Release
You can find the latest binary
releases [here](https://github.com/tmrts/boilr/releases). Grab the one the suits
your architecture and operating system and start using it.
# Building from Source
Make sure you have setup a Go >=1.6 development environment and the `GOPATH`
environment variable is configured
(see [official docs](https://golang.org/doc/code.html#GOPATH) for instructions)
and your `PATH` includes `$GOPATH/bin`.
Then use the following command
```bash
go get github.com/tmrts/boilr
```
The binary will be installed into `$GOPATH/bin`.
`boilr` is a *fast* & *powerful* command-line project templating tool.
It is written in Go and supports Go templates for project templates.
## Motivation
Coding usually requires a lot of tedious work at the beginning, such as
creating license files, Makefiles, gathering asset files, creating a working skeleton.
## Solution
`boilr` is a cli-tool with a pragmatic approach to creating projects and
eliminating boilerplate coding parts. `boilr` has the following goals:
- Make creating projects easier and error-free.
- Eliminate dependencies and create a single binary that is portable.
## Where to start?
After following the [Installation](Installation.md) page, take a look at the [Usage](Usage.md)
page for details on how to start using `boilr`.
Here is a list of project templates
## Applications
- [Apache Spark App Template for Scala](https://github.com/tmrts/boilr-spark)
- [Docker Compose PHP Template](https://github.com/rawkode/boilr-docker-compose-php)
- [Docker Host Vagrant Template](https://github.com/dmstr/vado-ligure)
- [Electron Quick Start Template](https://github.com/tmrts/boilr-electron)
- [Makefile](https://github.com/littlemanco/boilr-makefile)
- [Boilr Template for a Boilr Template](https://github.com/littlemanco/boilr-template)
- [License Template](https://github.com/tmrts/boilr-license)
## Kubernetes
- [Kubernetes Namespace](https://github.com/littlemanco/boilr-k8snamespace)
- [Kuberentes Service](https://github.com/littlemanco/boilr-k8sservice)
- [Kubernetes Deployment](https://github.com/littlemanco/boilr-k8sdeployment)
# Usage
Use `boilr help` to get the list of available commands.
## Download Template
In order to download a template from a github repository, use the following command:
```bash
boilr template download <github-repo-path> <template-name>
boilr template download tmrts/boilr-license license
```
The downloaded template will be saved to local `boilr` registry.
## Save Local Template
In order to save a template from filesystem to the template registry use the following command:
```bash
boilr template save <template-path> <template-name>
boilr template save ~/boilr-license license
```
The saved template will be saved to local `boilr` registry.
## Use Template
In order to use a template from template registry use the following command:
```bash
boilr template use <template-name> <target-dir>
boilr template use license ~/Workspace/example-project/
``
You will be prompted for values when using a template.
- [Introduction](Introduction.md)
- [Installation](Installation.md)
- [Usage](Usage.md)
- [Creating Templates](Creating-Templates.md)
- [Project Templates](Templates.md)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment