-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the clevertools wiki!
clevertools is a public github project!!
clevertools is a set of helper scripts that (hopefully!) helps you build and deploy your projects!!
- encourage many small builds/deploys (vs few large builds/deploys)
- make it as painless and hassle-free as possible to do builds/deploys
- building and deploying should be fearless and uneventful
linux and mac:
sudo pip install https://github.com/CleverPet/clevertools/archive/master.zip
- helper scripts to help you run your build and deploy scripts in clean/reproducible sandboxes
- a monotonically increasing cleverbuild number (CLEVERBUILD_NUMBER environment variable, increases on successful builds), persisted in the target git project as a git tag, e.g., "cleverbuild-5"
- a single per-project non-idempotent ".cleverbuild" script (optional) that, when run with /usr/local/bin/cleverbuild, results in a new git tag to help you build (and manage) your project
- multiple per-project idempotent ".cleverscript" scripts (optional) that, when run with /usr/local/bin/cleverscript, do "interesting things" to help you deploy (and manage) your projects
- .cleverbuild scripts act as documentation on how to build your projects
- .cleverscript scripts act as documentation on how to deploy your projects
there are two (2) main clevertools actions/concepts:
- cleverbuild (runs .cleverbuild script)
- cleverscript (runs .cleverscript scripts)
/usr/local/bin/cleverbuild:
- runs the project's .cleverbuild script in a isolated sandbox, with the next optimistic monotonically increasing cleverbuild number (or an explicit previous cleberbuild number), to try to build a new build and
- if success then tags git repo with the cleverbuild number
/usr/local/bin/cleverscript:
- runs the project's .cleverbuild script in a isolated sandbox with the most recent cleverbuild number (or an explicit previous cleverbuild number)
- runs a project .cleverscript script in the same isolated sandbox
running cleverbuild creates a new git tag; running cleverscripts do not
there is only one (1) .cleverbuild script; there may be zero or more .cleverscripts (as many as u need to do whatever u need that makes sense for your project)
be conservative when running cleverbuild (because it creates new git tags); be liberal when running .cleverscript scripts (because they do not create new git tags)
clevertools scripts should be "fail fast", e.g., for bash scripts use
#!/bin/sh -e
-e means "fail fast"
better yet, use -ex, e.g.,
#!/bin/sh -ex
-x means print commands as they are run
things I didn't like (never liked) about building software w/jenkins
- jenkins kept track of "failed" builds (and incremented build number on failed builds too).. this is understandable on jenkins part as jenkins is primarily a unit test runner and u do want to keep track of failed unit tests
- because jenkins kept track of build number then that meant that the jenkins install was "sacred", i.e., that it needed to be managed in case of disaster (e.g., backup/restore)
- branches, e.g., "cleverbuild hotfix1"
self hosted clevertools, i.e., clevertools uses clevertoolsautomatically create rough draft release notes?-
if cleverbuild and no diff then run cleverscript?bad idea - cleverbuild/script assumes "origin".. needs fixing?
- prune /tmp folders
-
don't run "git fetch" ?!?cleverbuild runs git fetch (rationale: because it also pushes git tags.. i.e., it already modifies the local git dir so a fetch isn't anything new).. cleverscript does not run git fetch.. rationale: it doesn't modify the local git dir in anyway whatsoever.. its supposed to be idempotent cleverscript --cleverbuild_number zzz- pass args to .cleverbuild and/or .cleverscripts