This guide covers how to get started using Ironman.
Download a binary release of Ironman from the releases page for your OS and put it under a PATH directory.
You can get help by running ironman help and ironman help <command>
To install an existing template, use the ironman install <template-id> command.
We will install a template to create the base project structure for a Go HTTP app.
$ ironman install https://github.com/ironman-project/simple-gohttp-template.gitNow you can list the available templates.
$ ironman list
Installed templates
+---------------+-------------------------+--------------------------------+
| ID | NAME | DESCRIPTION |
+---------------+-------------------------+--------------------------------+
| simple-gohttp | Simple Go HTTP Template | A simple HTTP Go library |
| | | template |
+---------------+-------------------------+--------------------------------+A template might have many generators. The default "app" generator will run if you don't specify one. The app generator of this template generates the base project.
$ ironman generate simple-gohttp /path/to/app --set projectName="Some project name",projectDescription="Some project description"The generated project will be under the /path/to/app. Open the directory with your favorite editor and check the results.
You can check the template definition here https://github.com/ironman-project/simple-gohttp-template.
You could have also passed the necessary values using a file.
$ ironman generate simple-gohttp /path/to/app -f /path/to/values.yamlwhere values.yaml would look something like:
projectName: Some Project Name
projectDescription: Some project Descriptionor multiple files:
$ ironman generate simple-gohttp /path/to/app -f /path/to/values.yaml,/path/to/values2.yamlthe rightmost file takes precedence.
You can also mix it with inline values, which have the higher precedence:
$ ironman generate simple-gohttp /path/to/app -f /path/to/values.yaml --set projectName="Higher Precedence Project Name"Go is necessary for this step (https://golang.org/), given the generated application is a Go app.
cd /path/to/app
go build
$ ./app #will run the http servergo to http://localhost:8080, and you should see the message "Hello World"
Ironman also supports file generators. This template implements an "endpoint" generator
cd /path/to/app
ironman generate simple-gohttp:endpoint myendpoint.go --set endpoint="/myendpoint"Stop and rebuild your app:
cd /path/to/app
go build
$ ./app #will run the http serverYou should be able to reach your new endpoint http://localhost:8080/myendpoint