An automated CI tool to help with building packages and ignoring them when there wasn't a change.
$ npm install -g entro-ci
$ entro-ci COMMAND
running command...
$ entro-ci (-v|--version|version)
entro-ci/4.4.0 linux-x64 node-v16.19.0
$ entro-ci --help [COMMAND]
USAGE
$ entro-ci COMMAND
...
entro-ci docker:build
entro-ci docker:build-from-file
entro-ci hash:directory DIRECTORY
entro-ci help [COMMAND]
entro-ci kube:deployment:update DEPLOYMENT [NAMESPACE]
entro-ci project:version
entro-ci templates:update
entro-ci trigger:post-build
Checks if the Docker image has been built before and if it has not then it will build it and push it with the hash to the Docker registry
USAGE
$ entro-ci docker:build
OPTIONS
-P, --docker-password=docker-password The password for logging into the docker repository (mainly for if you
are running this build process inside a container)
-R, --dry-run Whether to run this live or do a dry run
-W, --watch-file=watch-file Files that should be watched to trigger the build. Note, if you set this
then it IGNORES the build directory so you'd have to add that here as
well.
-b, --docker-build-flags=docker-build-flags Any additional build flags that you would like to plug directly into the
Docker build command
-d, --directory=directory (required) The path to the directory that you want to build
-f, --docker-file-name=docker-file-name [default: Dockerfile] The name of the Docker file in the directory
-i, --image-name=image-name (required) The name of the Docker image name without the version on it,
eg: entrostat/entro-ci is correct and entrostat/entro-ci:latest is not
valid
-l, --latest Whether to push the latest tag to the registry
-p, --package=package [default: ./package.json] The path to the package.json that holds the
version of the build
-r, --registry=registry The registry that should be used (by default Docker Hub is used)
-t, --tag=tag The tag version that should be pushed to the registry so that it can be
used in automated deployments
-u, --docker-username=docker-username The username for logging into the docker repository (mainly for if you
are running this build process inside a container)
-w, --watch-directory=watch-directory Directories that should be watched to trigger the build. Note, if you set
this then it IGNORES the build directory so you'd have to add that here
as well.
EXAMPLES
entro-ci docker:build --directory=./backend --image-name=my-repo/my-image --tag=stable
entro-ci docker:build --directory=./backend --image-name=my-repo/my-image --tag=stable --watch-directory=./backend/src
entro-ci docker:build --directory=./backend --image-name=my-repo/my-image --tag=stable --watch-directory=./backend/src
--watch-directory=./backend/migrations
entro-ci docker:build --directory=./backend --image-name=my-repo/my-image --tag=stable --latest
--watch-directory=./project/shared --watch-directory=./backend
entro-ci docker:build --directory=./backend --image-name=my-repo/my-image --tag=stable
--watch-directory=./project/shared --watch-directory=./backend --docker-build-flags="--build-arg API_VERSION=v2
--build-arg ENV=prod"
entro-ci docker:build --directory=./backend --image-name=my-repo/my-image --tag=stable
--watch-directory=./project/shared --watch-directory=./backend --docker-build-flags="--build-arg API_VERSION=v2"
--docker-build-flags="--build-arg ENV=prod"
See code: src/commands/docker/build.ts
Checks to see if a specific Dockerfile has changed (not the contents of a directory) and builds if this is the case
USAGE
$ entro-ci docker:build-from-file
OPTIONS
-P, --docker-password=docker-password The password for logging into the docker repository (mainly for if you
are running this build process inside a container)
-R, --dry-run Whether to run this live or do a dry run
-b, --docker-build-flags=docker-build-flags Any additional build flags that you would like to plug directly into the
Docker build command
-f, --docker-file-path=docker-file-path (required) The path to the Docker file
-i, --image-name=image-name (required) The name of the Docker image name without the version on it,
eg: entrostat/entro-ci is correct and entrostat/entro-ci:latest is not
valid
-l, --latest Whether to push the latest tag to the registry
-p, --package=package [default: ./package.json] The path to the package.json that holds the
version of the build
-r, --registry=registry The registry that should be used (by default Docker Hub is used)
-t, --tag=tag The tag version that should be pushed to the registry so that it can be
used in automated deployments
-u, --docker-username=docker-username The username for logging into the docker repository (mainly for if you
are running this build process inside a container)
-w, --watch-file=watch-file One or more files that should be "watched" for change that fall into this
Dockerfile. So it is not a whole folder but a file or two.
EXAMPLES
entro-ci docker:build-from-file --image-name=my-repo/my-image --docker-file-path=./backend/Dockerfile
--watch-file=./backend/package.json --watch-file=./backend/manifest.json --tag=stable
entro-ci docker:build-from-file --image-name=my-repo/my-image --docker-file-path=./backend/Dockerfile
--watch-file=./backend/package.json --watch-file=./backend/manifest.json --tag=stable --latest
--docker-build-flags="--build-arg API_VERSION=v2"
See code: src/commands/docker/build-from-file.ts
Generates the hash of a directory and outputs it to screen.
USAGE
$ entro-ci hash:directory DIRECTORY
ARGUMENTS
DIRECTORY The directory that we're hashing
See code: src/commands/hash/directory.ts
display help for entro-ci
USAGE
$ entro-ci help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
Trigger an update on a deployment
USAGE
$ entro-ci kube:deployment:update DEPLOYMENT [NAMESPACE]
ARGUMENTS
DEPLOYMENT The name of the deployment that you would like to update
NAMESPACE [default: default] The namespace that the deployment is in
OPTIONS
-b, --bin=bin [default: kubectl] The path to the kubectl executable
ALIASES
$ entro-ci kdu
See code: src/commands/kube/deployment/update.ts
Returns the current version of the project. This command starts from the current directory and moves up until it finds a package.json file.
USAGE
$ entro-ci project:version
OPTIONS
-p, --package=package [default: ./package.json] The path of the package.json file that holds the current version
EXAMPLE
entro-ci project:version
See code: src/commands/project/version.ts
Updates files specified in the entro-ci.yaml file in the repository
USAGE
$ entro-ci templates:update
OPTIONS
-V, --outputVersion=outputVersion The version that you want to set (if you don't want to use the version in the
package.json)
-f, --file=file [default: ./entro-ci.yaml] The path to the yaml file with the config
-p, --package=package [default: ./package.json] The path of the package.json file that holds the current
version
EXAMPLES
entro-ci templates:update
entro-ci templates:update -f .templates.yaml
See code: src/commands/templates/update.ts
Trigger a script if the build with a certain image name triggered during this run
USAGE
$ entro-ci trigger:post-build
OPTIONS
-S, --shell=shell [default: /bin/bash] The shell that should be used to trigger this script.
-a, --all-true Require all of the image names to have been built to trigger this.
-i, --image-name=image-name (required) The image name or image names that should build in order for this to trigger.
By default, the trigger works if any one of these names built.
-s, --script=script (required) The path to the script you want to run.
EXAMPLES
entro-ci trigger:post-build --script=./scripts/deploy_prod.sh --image-name=myproject/backend
entro-ci trigger:post-build --script=./deploy_prod.sh --image-name=myproject/frontend --shell=/bin/zsh
entro-ci trigger:post-build --script=./deploy_prod.sh --image-name=myproject/backend-os --image-name=myproject/backend
entro-ci trigger:post-build --script=./deploy_prod.sh --image-name=myproject/backend-os --image-name=myproject/backend
--all-true
See code: src/commands/trigger/post-build.ts