From 951fa27c71ca93b45a6cde6c9d8868d81f28ff49 Mon Sep 17 00:00:00 2001 From: matang Date: Tue, 26 Nov 2019 12:37:22 +0200 Subject: [PATCH 1/4] Adding readme file --- README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d22aa17 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# Packman +Project Scaffolding for Professionals + +## Motivation +At SecureNative, we push new micro-services on a daily basis and the job of creating new projects, wiring it up, importing our common libs, etc.. is a tedious job and should be automated :) +Enters `packman`, a simple tool allows you to generate boilerplate without sacrificing your freedom as a developer. No new DSL to learn, no weird config files to edit a tool written for developers by developers. + +## Prerequisites +- Go 1.11 or above with [Go Modules enabled](https://github.com/golang/go/wiki/Modules#how-to-use-modules) +- Basic knowledge of [Go's templating engine](https://curtisvermeeren.github.io/2017/09/14/Golang-Templates-Cheatsheet) +- Git account (Github, Bitbucket, GitLab, etc...) + +## How to get it +If you have golang installed just use: +`go get -u github.com/securenative/packman` + +You can also use one of the pre-built binaries from our [releases page](https://github.com/securenative/packman/releases) + +## API Reference + +### Render +While working on your *template project* you'll need to constantly render your template to check if it works. +The `packman render` command will take a local path to the template's folder and a list of custom flags and +in return will create a new folder with the rendered template. +```bash +packman render \ + -key-1 value-1 \ + -key-2 value-2 \ + ... \ + -key-n value-n +``` + +For example if I have a template called `myProject` and it requires the following flags: `host`, `port` running: +```bash +packman render myProject \ + -host 127.0.0.1 \ + -port 9909 +``` +will create a new folder called `myProject-rendered` with the rendered template. + +### Unpack +Unpack is the **"wet"** version of render, the only difference is that unpack will ask you where to get the template from (i.e which git repository to clone). +```bash +packman unpack \ + -key-1 value-1 \ + -key-2 value-2 \ + ... \ + -key-n value-n +``` + +### Pack +Pack will just commit and push your changes to the remote git repository, if you prefer (and basically you should) you can manage it manually with your favourite git client. +```bash +packman pack +``` + +### Auth +To get access to private repositories or to use the `packman pack` command you'll need to authenticate with git. +```bash +packman auth +``` + +### Change the default script engine +While the default script engine uses GO and as much as we love GO at SecureNative, `packman` was built as an un-opinionated tool so we don't impose any limit on your scripting capabilities. +You can use any language to write scripts, damn, you can even use bash scripts to generate your template as long as you respect the interface with `packman`. +`packman` scripts defines 2 standards that you must comply to: +1) The script will be executed with 2 command-line arguments, the path to the flags.json file and the path to save the reply.json file. +2) The script has to write its reply (as json) to the reply path (provided as a cli argument) +You can see its pretty simple requirements to fulfil, you can check [this code](https://github.com/securenative/packman/blob/master/pkg/packman.go) to better understand it. + +```bash +packman script "go run" # Will run go files +packman script "python" # will run python files +packman script "node" # will run javascript files +``` \ No newline at end of file From f0e36eabd8b8d7a9fae5130945f947a010f64d2f Mon Sep 17 00:00:00 2001 From: matang Date: Tue, 26 Nov 2019 12:45:20 +0200 Subject: [PATCH 2/4] Adding readme file --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d22aa17..f57f65d 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ packman auth While the default script engine uses GO and as much as we love GO at SecureNative, `packman` was built as an un-opinionated tool so we don't impose any limit on your scripting capabilities. You can use any language to write scripts, damn, you can even use bash scripts to generate your template as long as you respect the interface with `packman`. `packman` scripts defines 2 standards that you must comply to: -1) The script will be executed with 2 command-line arguments, the path to the flags.json file and the path to save the reply.json file. -2) The script has to write its reply (as json) to the reply path (provided as a cli argument) +1) The script will be executed with 2 additional command-line arguments, the path to the flags.json file and the path to save the reply.json file. +2) The script has to write its reply (as json) to the reply path (provided as a cli argument) You can see its pretty simple requirements to fulfil, you can check [this code](https://github.com/securenative/packman/blob/master/pkg/packman.go) to better understand it. ```bash From b21f3ff35ea79c070455d25eb9e33a0676dbc066 Mon Sep 17 00:00:00 2001 From: matang Date: Tue, 26 Nov 2019 12:48:28 +0200 Subject: [PATCH 3/4] Adding readme file --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f57f65d..54446d1 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Project Scaffolding for Professionals ## Motivation At SecureNative, we push new micro-services on a daily basis and the job of creating new projects, wiring it up, importing our common libs, etc.. is a tedious job and should be automated :) -Enters `packman`, a simple tool allows you to generate boilerplate without sacrificing your freedom as a developer. No new DSL to learn, no weird config files to edit a tool written for developers by developers. +Enters `packman`, a simple tool allows you to generate boilerplate without sacrificing your freedom as a developer. No new DSL to learn, no weird config files to edit. ## Prerequisites - Go 1.11 or above with [Go Modules enabled](https://github.com/golang/go/wiki/Modules#how-to-use-modules) @@ -66,6 +66,7 @@ You can use any language to write scripts, damn, you can even use bash scripts t `packman` scripts defines 2 standards that you must comply to: 1) The script will be executed with 2 additional command-line arguments, the path to the flags.json file and the path to save the reply.json file. 2) The script has to write its reply (as json) to the reply path (provided as a cli argument) + You can see its pretty simple requirements to fulfil, you can check [this code](https://github.com/securenative/packman/blob/master/pkg/packman.go) to better understand it. ```bash From f283522d13283435ffe7496eefd6024e41d9e8aa Mon Sep 17 00:00:00 2001 From: matang Date: Tue, 26 Nov 2019 18:49:46 +0200 Subject: [PATCH 4/4] Adding readme file --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 54446d1..e782371 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,9 @@ Project Scaffolding for Professionals ## Motivation At SecureNative, we push new micro-services on a daily basis and the job of creating new projects, wiring it up, importing our common libs, etc.. is a tedious job and should be automated :) -Enters `packman`, a simple tool allows you to generate boilerplate without sacrificing your freedom as a developer. No new DSL to learn, no weird config files to edit. +`packman` is a simple tool that allows you to generate boilerplate without sacrificing your freedom as a developer, no new DSL to learn, no weird config files to edit, only you and your favourite language decides the limits. + +We are using `packman` intensively at SecureNative ## Prerequisites - Go 1.11 or above with [Go Modules enabled](https://github.com/golang/go/wiki/Modules#how-to-use-modules) @@ -16,6 +18,15 @@ If you have golang installed just use: You can also use one of the pre-built binaries from our [releases page](https://github.com/securenative/packman/releases) +after that you can use `packman` to get templates, try it now: +```bash +packman unpack \ + https://github.com/securenative/packman-init \ + packmanExample \ + -author matan \ + -company SecureNative +``` + ## API Reference ### Render