Build customization
To customize certain aspects of the build process, build environment variables
can be used. You can specify them using the --build-env
flag during creation
or update of the application.
Setting build environment variables on app creation
You can use the --build-env
flag of the nctl create app
command to set build
environment variables on application creation.
--build-env=KEY=VALUE;... Environment variables which are passed to the app build process.
$ nctl create app go-example --build-env='BP_GO_TARGETS=./cmd/app'
depending on your shell, you may need to quote the arguments.
Multiple build time env variables can be set by using the --build-env
option
multiple times or by adding the variables separated by a semicolon:
$ nctl create app go-example --build-env='BP_GO_TARGETS=./cmd/app' --build-env='BP_KEEP_FILES=assets/*:public/*'
or
$ nctl create app go-example --build-env='BP_GO_TARGETS=./cmd/app;BP_KEEP_FILES=assets/*:public/*'
Updating build environment variables
To update build environment variables on existing applications you can use the
--build-env
flag of the nctl update app
command.
$ nctl update app go-example --build-env='BP_GO_TARGETS=./cmd/app'
More information
All build environment variables are specific to the language and the buildpack that is being used in the backend to build your app. You can find the language specific supported build environment variables in the "Languages" section of the documentation.