A simple docker push util to generate the docker image and push it, also it allows you to version your git project (package.json), commit, tag and push to origin.
npm i --save-dev docker-pusher
In your terminal run:
docker-pusher --imageName "my-docker-image"
You can pass the next arguments:
-
imageName
(required): The docker image name -
branchName
: The branch name that the git version is allowed, you can use RegEx, if it's empty it will allow all the branches- Default:
""
- Default:
-
commitSubjectTemplate
: The git commit subject template to use when commit the new version, you can use mustache string template, the parameter to render the string isversion
- Default:
chore(repo): update to v{{version}}
- Default:
-
skipGit
: Boolean, skips the git new version (package.json), git tag, git commit and git push- Default:
false
- Default:
-
beta
: Boolean, iftrue
the new version will be considered as a pre-release version:x.y.z-beta.n
, iffalse
the new version will be considered as a patch version- Default:
false
- Alias:
b
(-b
)
- Default:
-
version
: The specific new version using the Semantic Versioning Specification (SemVer) https://semver.org/`- Default: It will read the
package.json
version and increase by 1 the patch version or the pre-release version if the--beta
argument istrue
- Default: It will read the
If your prefer to set default arguments, you can create a docker-pusher-config.json
file in your root project with the arguments as properties, example:
{
"imageName": "my-docker-image",
"commitSubjectTemplate": "chore(tag): Release v{{version}} version!",
"branchName": "main"
}
Remember: if you run docker-pusher
with some of those docker-pusher-config.json
properties as arguments, the docker-pusher-config.json
property value will be ignored.