-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the cleverbuild wiki!
cleverbuild is a public github project!!
cleverbuild 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) by..
- .. making it as painless and hassle-free as possible to do builds/deploys
- building and deploying should be fearless, painless and uneventful
linux and mac:
pip install https://github.com/CleverPet/cleverbuild/archive/master.zip
u really do NOT wanna do "sudo pip install" here.. really.. u don't.. especially on macosx el capitan
- 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 cleverbuild actions/concepts:
- cleverbuild (runs .cleverbuild script)
- cleverscript (runs .cleverscript scripts)
cd cleverpet-cloud
cleverbuild
confirm success, there should be a new tag created
SECRETS_ZIP=~/Downloads/secrets.zip cleverscript .clever-script-deploy-staging
check developer console --> app engine --> versions, to confirm its deployed
- runs the project's .cleverbuild script in a isolated sandbox, with the next optimistic monotonically increasing cleverbuild number (or an explicit previous cleverbuild number), to try to build a new build and
- if success then tags git repo with the cleverbuild number
- provides CLEVERBUILD_BRANCH environment variable, e.g., "master"
- provides CLEVERBUILD_NUMBER environment variable, e.g., "5"
- 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
- provides CLEVERBUILD_BRANCH environment variable, e.g., "master"
- provides CLEVERBUILD_NUMBER environment variable, e.g., "5"
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 to do 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)
cleverbuild 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"TODO: scrub branch-name 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? 5a. might use something like this: "git config --get branch.master.remote" -> github
- 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
- http://stackoverflow.com/questions/33004708/osx-el-capitan-sudo-pip-install-oserror-errno-1-operation-not-permitted/33463702#33463702