@cleandns/localbuild
v1.0.19
Published
Spoofs a simple execution of cloudbuild locally
Downloads
2
Keywords
Readme
@cleandns/localbuild
A build tool that spoofs the execution of Google Cloud Build locally. Localbuild is used throughout the CleanDNS stack to test and debug Cloud Build configurations without having to push changes to a remote repository, and to allow local dev environments to use secrets from Secret Manager.
Features
- Parses a
cloudbuild.yaml
file and executes the build steps locally. - Supports build substitutions and secret manager secrets.
- Allows specifying a build target.
Installation
You can install this package globally using npm:
npm install -g @cleandns/localbuild
Alternatively, it can be run without global install using npx
:
npx -y localbuild ...
Usage
You can run the tool using the localbuild command. It supports the following options:
-c
,--config
: Path to thecloudbuild.yaml
file (default:cloudbuild.yaml
).-b
,--build
: The ID of the build step to execute (default:BUILD
). For more information about the structure of Cloud Build files, see the documentation.-p
,--project
: The Google Cloud project ID.-t
,--target
: The Docker build target.
Example:
localbuild -c path/to/cloudbuild.yaml -b BUILD -p my-project -t my-target
Or using npx
:
npx -y localbuild --config path/to/cloudbuild.yaml --project my-project --target my-target
Development
This project is written in TypeScript (do not modify the raw javascript document as this is a build artifact). You can build the project using the tsc
command if Typescript is installed globally.
License This project is licensed under the ISC license.