aap.bash
v1.0.21
Published
language-agnostic buildpacks using aap.json: a npm-inspired, highlevel dependecy manager/buildtool using bash+git
Downloads
6
Maintainers
Readme
In the beginning there was bash..and bash had aap.json
Getting started
If you're used to npm
or composer
, you will feel right at home.
Lets start a project by adding dependencies to it:
$ git init
$ aap init
$ aap install ssh+git://[email protected]/username/backend.git --save
$ aap install ssh+git://[email protected]/username/core-api.git --save
$ aap install ssh+git://[email protected]/username/landingpage.git --save
$ aap install ssh+git://[email protected]/username/[email protected]#master --save
$ aap install ssh+git://[email protected]/username/docker.mysql.git --save
$ aap install ssh+git://[email protected]/username/docker.mongodb.git --save
$ aap install npm://[email protected] --save
$ aap install composer://[email protected] --save
$ mkdir python
$ cd python && ../../aap install pip://mypythonpackage --save
Nice! Now aap.json will look like this
Now lets push our aap.json
buildpack to the repo:
$ git add aap.json && git commit -m "added aap manifest"
$ git push origin master
Congrats! Now with this aap.json
, other devs can easily install dependencies like so:
$ aap install
installing 'backend'
├─ $ git clone ssh+git://[email protected]/username/backend.git
├─ Cloning into 'backend'...
├─
├─ ʕ•x•ʔ
├─ +-+-+-+ Your personal nested build & dependency monkey
├─ |a|a|p| [https://github.com/coderofsalvation/aap]
├─ +-+-+-+
├─
├─
├─ installing 'backend'
├─ ├─ $ git clone https://[email protected]/username/backend-html-templates
├─ ├─ Cloning into 'backend-html-templates'...
├─
...and so on..
NOTE recursive installation is supported when
aap.json
occurs in gitrepo-dependencies as well.
Usecases
The usecases can range from application builds from a repository, till selfcontained installers, till deploying docker clouds:
Scripts, triggers'n' hooks
See here how to trigger scripts using the aap run <cmd>
, to build and configure stuff from one central place.
Perfect for monkeypatching your app before turning on the engine, compiling sources etc.
Installation
npm install aap.bash
or
wget "https://raw.githubusercontent.com/coderofsalvation/aap/master/aap" -O aap
chmod 755 aap
Why
Now you can easily manage dependencies of gitrepos, npm/composer modules and dockerrepos. All combined in one slim repo.
Basically aap init
generates aap.json
like this, which allows you to run:
$ aap install
Get any system to build a project from multiple remote sources.
Only requirements: git + bash
Options
$ aap
Usage: aap <cmd> [options]
aap.json Buildpacks for the web.
Easily manage dependencies of gitrepos, npm/composer modules and dockerrepos.
Combine a composable cloud in one slim repo.
Commands:
aap init [name] [options] ┆ generates aap manifest, options:
┆ -f = force, overwrites json
aap install [url] [..] [options] ┆ no arguments installs all dependencies in aap.json
┆ -f = force, overwrites existing dependencies
┆ --save = save dependency to "dependencies" in aap.json
┆ --save-dev = save dependency to "devDependencies"
┆ --dev = install from "devDependencies"
┆
┆ valid urls are:
┆ [email protected]:user/repo.git
┆ ssh+git://[email protected]/user/repo.git
┆ ssh+git://github.com/username/package.git
┆ ssh+git://github.com/username/package.git#master
┆ ssh+git://github.com/username/package.git#master#commit
┆ ssh+git://github.com/username/package.git#[email protected]
┆ npm://browserify
┆ composer://user/packagename
aap run <script> ┆ runs script defined in aap.json
Other possible goals
- run/deploy a cloud using multiple Docker cloudservices in one repo using crowdr
- depency management: wrap several repositories and modules in one repository
- use in and outside dockers
- install package managers in environments where they're not installed
- avoid git submodules (gets laborous pretty easily)
- readability: deploy and dependency info confined in one jsonfile (aap.json) to minimize shellscriptism
Todo
- aap update
- git commits and tags
- npm versions
- aap bake aap.json > myinstaller
- global commands: source ~/.aap*.json