Docker image for semantic-release
$ docker run --rm gtramontina/semantic-release:<version>
Note: Because running semantic-release alone automatically runs the application, the default command in this image is --help. If you want to actually run semantic-release, run the above command with your set of arguments, or simply -- if no arguments are needed, like so:
$ docker run --rm gtramontina/semantic-release:<version> --
Note 2: You'll need to mount your git-based project in the container, as well as the necessary environment variables. The example below mounts the current directory as /app in the container and sets it as the working directory (-w). It also sets the required GH_TOKEN and NPM_TOKEN environment variables (because we're using the default verification/publication settings).
$ docker run --rm \
-w /app \
-v $(pwd):/app \
-e GH_TOKEN=$GH_TOKEN \
-e NPM_TOKEN=$NPM_TOKEN \
gtramontina/semantic-release:<version>
Note 3: If you're running semantic-release in Travis, AppVeyor or any other CI environment, remember to forward the relevant environment variables to your container. The following example forwards Travis' variables:
$ docker run --rm \
-w /app \
-v $(pwd):/app \
-e GH_TOKEN=$GH_TOKEN \
-e NPM_TOKEN=$NPM_TOKEN \
-e TRAVIS_COMMIT=$TRAVIS_COMMIT \
-e TRAVIS_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER \
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \
-e TRAVIS_JOB_NUMBER=$TRAVIS_JOB_NUMBER \
-e TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST \
-e TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG \
-e TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR \
gtramontina/semantic-release:<version>
At the time of this writing, semantic-release was making use of env-ci to detect CI environments. Take a look at the environment variables it uses for your CI so you can forward them to your container.
$ make build # Builds a new image
$ make test # Runs/tests the image
$ make push # Pushes the image up
$ make clean # Removes any generated artifacts
$ make clobber # Removes artifacts and generated images
🐳
Content type
Image
Digest
Size
105.1 MB
Last updated
over 5 years ago
docker pull dem0n3d/docker-semantic-release