-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maciej Pijanowski <[email protected]>
- Loading branch information
Showing
6 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,6 @@ MAINTAINER Maciej Pijanowski <[email protected]> | |
RUN apk add git | ||
RUN npm install -g auto-changelog | ||
|
||
ADD VERSION . | ||
|
||
ENTRYPOINT ["auto-changelog"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
|
||
source name | ||
source name.sh | ||
|
||
docker build -t $DOCKER_USER_NAME/$DOCKER_IMAGE_NAME:latest . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
DOCKER_USER_NAME="macpijan" | ||
DOCKER_IMAGE_NAME="auto-changelog" | ||
|
||
CURRENT_VERSION="$(cat VERSION)" | ||
echo "Current version: $CURRENT_VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#!/bin/bash | ||
|
||
source name | ||
source name.sh | ||
|
||
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USER" --password-stdin | ||
docker push $DOCKER_USER_NAME/$DOCKER_IMAGE_NAME | ||
docker push $DOCKER_USER_NAME/$DOCKER_IMAGE_NAME:latest | ||
docker push $DOCKER_USER_NAME/$DOCKER_IMAGE_NAME:$CURRENT_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
source name.sh | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "Usage:" | ||
echo "$0 BUMP" | ||
echo "Available BUMPs: major, minor, patch" | ||
exit 1 | ||
fi | ||
|
||
BUMP="$1" | ||
|
||
[ "$BUMP" != "major" -a \ | ||
"$BUMP" != "minor" -a \ | ||
"$BUMP" != "patch" -a ] && echo "Invalid BUMP" && exit 1 | ||
|
||
function errorCheck { | ||
ERROR_CODE="$?" | ||
if [ "$ERROR_CODE" -ne 0 ]; then | ||
echo "[ERROR] $1 : ($ERROR_CODE)" | ||
exit 1 | ||
fi | ||
} | ||
|
||
# ensure we're up to date | ||
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" | ||
git feetch && git pull origin $CURRENT_BRANCH | ||
errorCheck "Failed to pull $CURRENT_BRANCH" | ||
|
||
# bump version | ||
docker run --rm -v "$PWD":/app treeder/bump $BUMP | ||
errorCheck "Failed to run \"treeder/bump\" container" | ||
|
||
BUMPED_VERSION="$(cat VERSION)" | ||
echo "Bumped version: $BUMPED_VERSION" | ||
|
||
# tag | ||
BRANCH="rel_$BUMPED_VERSION" | ||
git checkout -b $BRANCH | ||
errorCheck "Failed to create branch: \"$BRANCH\"" | ||
git commit -am "release $BUMPED_VERSION" | ||
errorCheck "Failed to create commit" | ||
git tag -a "$BUMPED_VERSION" -m "version $BUMPED_VERSION" | ||
errorCheck "Failed to create tag: \"$BUMPED_VERSION\"" | ||
git push origin $BRANCH | ||
errorCheck "Failed to push branch: \"$BRANCH\"" | ||
git push --tags | ||
errorCheck "Failed to push tags" |