Binaries
These are found in the bin/build directory and typically have equivalent functions within Zesk Build which are
similar.
These utilities can be accessed via the shell in the PATH:
./bin/build/
They are intended to be standalone tools useful for a variety of installation and package management functions:
cannon.sh- Same ascannonchmod-sh.sh- Same asmakeShellFilesExecutableidentical-check.sh- Same asidenticalCheckidentical-repair.sh- Same asidenticalCheckShellwith some extra functionality.install-bin-build.sh- Install or upgrdades current version of Zesk Build in./bin/buildif it is not installed already. Updates itself if required.map.sh- Same asmapEnvironmentneed-bash.sh- Tool to installbashin containers first which do not have it installed automatically (Alpine, for example)crontab-application-update.sh- Same ascrontabApplicationUpdate
Template scripts
test.sample.sh- Template for your owntest.shto run Bash tests (or any test suites)install.sample.sh- Template to write your owninstall-bin-build.shfor your project.
Development tools
bash-build.sh- Tool to installZesk Buildin a new container, load it and modify the.bashrcto load it every timebitbucket-container.sh- Wrapper for[bitbucketContainer](../tools/bitbucket.md#bitbucketcontainer) - Return Code: 1 - If already inside docker, or the ([source](https://github.com/zesk/build/blob/main/bin/build/tools/bitbucket.sh#L70))deprecated.sh- Do a project-wide replacement of deprecated code with modern updates. May modify or break your code. example)local-container.sh- Same asdockerLocalContainerrelease-new.sh- Same asreleaseNewrelease-notes.sh- Same asreleaseNotesversion-last.sh- Same asgitVersionLastversion-list.sh- Same asgitVersionList
tools.sh to run commands
Do source tools.sh to load all functions into the current environment.
You can also do
./tools.sh decorate file "$(pwd)"
To run commands directly; note this is slower for larger scripts and can be used when a single function is necessary.
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error
install-bin-build.sh
Arguments
--help- Optional. Flag. Display this help.relative- Required. RelativePath. Path from this script to our application root. INTERNAL.defaultPackagePath- Required. RelativePath. Path from application root to where the package should be installed. INTERNAL.packageInstallerName- Required. ApplicationFile. The new installer file, post installation, relative to theinstallationPath. INTERNAL.installationPath- Optional. ApplicationDirectory. Path to where the package should be installed instead of the defaultPackagePath.--help- Optional. Flag. Display this help.--source source- Optional. String. Source to display for the binary name. INTERNAL.--name name- Optional. String. Name to display for the remote package name. INTERNAL.--local localPackageDirectory- Optional. Directory. Directory of an existing installation to mock behavior for testing. INTERNAL.--url url- Optional. URL. URL of a tar.gz file. Download source code from here.--user username- Optional. String. Addusername:passwordto remote request.--password passwordText- Optional. String. Addusername:passwordto remote request.--header headerText- Optional. String. Add one or more headers to the remote request.--version-function urlFunction- Optional. Function. Function to compare live version to local version. Exits 0 if they match. Output version text if you want. INTERNAL.--url-function urlFunction- Optional. Function. Function to return the URL to download. INTERNAL.--check-function checkFunction- Optional. Function. Function to check the installation and output the version number or package name. INTERNAL.--installer installer- Optional. Executable. Multiple. Binary to run after installation succeeds. Can be supplied multiple times. Ifinstallerbegins with a@then any errors by the installer are ignored.--replace file- Optional. File. Replace the target file with this script and delete this one. Internal only, do not use. INTERNAL.--finalize file- Optional. File. Remove the temporary file and exit 0. INTERNAL.--debug- Optional. Flag. Debugging is on. INTERNAL.--force- Optional. Flag. Force installation even if file is up to date.--skip-self- Optional. Flag. Skip the installation script self-update. (By default it is enabled.)--diff- Optional. Flag. Show differences between old and new file.
Return codes
0- Success1- Environment error2- Argument error
Requires
cp rm cat printf realPath whichExists returnMessage fileTemporaryName catchArgument throwArgument catchEnvironment decorate usageArgumentString isFunction __decorateExtensionQuote
Modify the last line of this file when installing at a different project depth:
__installPackageConfiguration ../.. "$@"
The ../.. is the relative path from the script to the project root directory. - installInstallBuild - Installs install-bin-build.sh the first time in a new project, and (source)
will do this
for you.