release-me-sh 0.10.5 → 0.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/plugins/docker.sh +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-me-sh",
3
- "version": "0.10.5",
3
+ "version": "0.10.7",
4
4
  "description": "Blazing fast minimal release workflow script written in Bash with plugins and presets support",
5
5
  "keywords": [
6
6
  "bash",
package/plugins/docker.sh CHANGED
@@ -1,6 +1,15 @@
1
1
  #!/bin/sh
2
2
  set -eu
3
3
 
4
+ prepare() {
5
+
6
+ printf "%s" "${DOCKER_HUB_PAT-}" | docker login --username "${DOCKER_HUB_USERNAME-}" --password-stdin
7
+ }
8
+
9
+ cleanup() {
10
+ docker logout
11
+ }
12
+
4
13
  release() {
5
14
  # Build and publish a `Docker` tag
6
15
  if [ -n "${DOCKER_HUB_USERNAME-}" ] && [ -n "${DOCKER_HUB_PAT-}" ]; then
@@ -17,11 +26,15 @@ release() {
17
26
  return 1
18
27
  fi
19
28
 
29
+ prepare
30
+
20
31
  docker build -t "${GIT_REPO_NAME-}:${NEXT_BUILD_VERSION-}" . --push
21
32
  docker tag "${GIT_REPO_NAME}:${NEXT_BUILD_VERSION}" "${GIT_REPO_NAME}:latest"
22
33
  docker push "${GIT_REPO_NAME}:latest"
23
34
 
24
35
  log "Docker image published [${NEXT_RELEASE_TAG}]!"
36
+
37
+ cleanup
25
38
  else
26
39
  log "Skipped Docker image [${NEXT_RELEASE_TAG}] in DRY-RUN mode."
27
40
  fi