Skip to content

mleuthold/build-tools-invoke-and-make

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

invoke-and-make

Compare build tools invoke and make.

The use case is a multi-project setup, i.e. multiple projects are hosted in a single git repo. Each sub project creates it's own Docker image.

prerequisites

Enable YAML configuration files for SHELL scripts:

pip install --user yq

pros and cons

make with Makefile invoke with tasks
+ well known standard + yaml as config files
+ shell scripts with highlighting in IDE + Python instead of shell scripting
+ less lines of code (2/3) .
- Shell scripts need to adopt specific $$ syntax .
+ can run targets in parallel - parallelism not supported

make with Makefile

runs with local environment by default

make build

run with specific environment

env ENVIRONMENT=development make build

run in parallel

make --jobs --output-sync=recurse --no-keep-going build

measure time for parallel run

MY_DATE=$(date); make --jobs --output-sync=recurse --no-keep-going build; echo $MY_DATE; (date)

invoke with tasks

run from root (includes all sub-projects)

inv -f configs/local.yaml build

run sepcific sub-project

inv -f configs/local.yaml project-a.build
# or
inv -f configs/local.yaml --search-root ./tasks --collection project_a build

How to use make with Makefile

For multiple commands use sub-shell

(export ENVIRONMENT=development; make build && make release)

or a single command in a sub-shell use env

env ENVIRONMENT=development make build

How to use invoke

Install invoke

pip3 install --user invoke docker

and list all available invoke targets

inv --list

and execute a chain of targets

inv deploy release

Execute invoke with a given config file

inv -f configs/local.yaml build
# or
inv -f configs/development.yaml build

About

Compare build tools invoke and make

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published