0.0.3 • Published 7 years ago

bbenv v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

BBEnv

npm version

Nerd-snipped attempt at helping running Buddybuild custom build steps locally.

Context

Buddybuild is a smart service that does a lot for you. That said, there are some situation where you want to customize the build process. Using custom build steps, you can execute shell scripts after cloning, before and after the build... Here is an example from our blog post about this:

#!/usr/bin/env bash
# Adding the buddybuild branch to a PList
/usr/libexec/PlistBuddy -c "Add APP_BRANCH String $BUDDYBUILD_BRANCH" "Info.plist"

If you want to try this script locally before pushing it, you will need to define the BUDDYBUILD_BRANCH environment variable. This is tedious and there are quite a lot of environment variable you may need. I made this tool to let you run your custom builds steps in a close-to-production environment by exposing relevant environmment variables.

List of environment variables

Environment variableComment
BUDDYBUILD_BUILD_NUMBERTakes the latest build number and adds 1.
BUDDYBUILD_BUILD_IDGenerates a random UUID.
BUDDYBUILD_BRANCHTakes the branch you're currently on.
BUDDYBUILD_WORKSPACETakes the folder you're currently on.
BUDDYBUILD_TRIGGERED_BYAlways "ui_triggered" for now.
BUDDYBUILD_IPA_PATHDownload the IPA from the latest succesful build and use this path.
BUDDYBUILD_APP_STORE_IPA_PATHDownload the IPA from the latest succesful build and use this path.
BUDDYBUILD_BASE_BRANCHNot supported yet, always empty.
BUDDYBUILD_PULL_REQUESTNot supported yet, always empty.
BUDDYBUILD_APP_IDNot supported yet, always empty.
BUDDYBUILD_REPO_SLUGNot supported yet, always empty.
BUDDYBUILD_SECURE_FILESNot supported yet, always empty.
BUDDYBUILD_SCHEMENot supported yet, always empty.
BUDDYBUILD_TEST_DIRNot supported yet, always empty.
BUDDYBUILD_VARIANTSNot supported yet, always empty.
ANDROID_HOMENot supported yet, always empty.
ANDROID_NDK_HOMENot supported yet, always empty.

Why

50% because it's fun, 50% because I wanted to show the stuff you can do using our public API.

Installation

yarn global add bbenv (or npm install -g bbenv I guess)

Usage

bbenv buddybuild_postclone.js

Contributing to bbenv

  1. Clone the repo
  2. run make bootstrap

Run tests with bats using make test

License

MIT. See bundled LICENSE file.