Merge pull request #1691 from balena-io/build-improvements

Small improvements to `balena build`
This commit is contained in:
srlowe 2020-04-01 13:51:37 +02:00 committed by GitHub
commit c177f222ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 10 deletions

View File

@ -1888,11 +1888,11 @@ You must provide either an application or a device-type/architecture pair to use
the balena Dockerfile pre-processor (e.g. Dockerfile.template -> Dockerfile).
This command will look into the given source directory (or the current working
directory if one isn't specified) for a docker-compose.yml file. If it is found,
this command will build each service defined in the compose file. If a compose
file isn't found, the command will look for a Dockerfile[.template] file (or
alternative Dockerfile specified with the `-f` option), and if yet that isn't
found, it will try to generate one.
directory if one isn't specified) for a docker-compose.yml file, and if found,
each service defined in the compose file will be built. If a compose file isn't
found, it will look for a Dockerfile[.template] file (or alternative Dockerfile
specified with the `--dockerfile` option), and if no dockerfile is found, it
will try to generate one.
The --registry-secrets option specifies a JSON or YAML file containing private
Docker registry usernames and passwords to be used when pulling base images.

View File

@ -77,11 +77,11 @@ module.exports =
the balena Dockerfile pre-processor (e.g. Dockerfile.template -> Dockerfile).
This command will look into the given source directory (or the current working
directory if one isn't specified) for a docker-compose.yml file. If it is found,
this command will build each service defined in the compose file. If a compose
file isn't found, the command will look for a Dockerfile[.template] file (or
alternative Dockerfile specified with the `-f` option), and if yet that isn't
found, it will try to generate one.
directory if one isn't specified) for a docker-compose.yml file, and if found,
each service defined in the compose file will be built. If a compose file isn't
found, it will look for a Dockerfile[.template] file (or alternative Dockerfile
specified with the `--dockerfile` option), and if no dockerfile is found, it
will try to generate one.
#{registrySecretsHelp}
@ -121,6 +121,7 @@ module.exports =
sdk = getBalenaSdk()
{ ExpectedError } = require('../errors')
{ checkLoggedIn } = require('../utils/patterns')
{ validateProjectDirectory } = require('../utils/compose_ts')
helpers = require('../utils/helpers')
Logger = require('../utils/logger')
@ -141,6 +142,8 @@ module.exports =
Promise.try ->
if (not (arch? and deviceType?) and not application?) or (application? and (arch? or deviceType?))
throw new ExpectedError('You must specify either an application or an arch/deviceType pair to build for')
if (application)
checkLoggedIn()
.then ->
validateProjectDirectory(sdk, {
dockerfilePath: options.dockerfile,