-
Notifications
You must be signed in to change notification settings - Fork 225
/
.release.sh
executable file
·53 lines (43 loc) · 1.24 KB
/
.release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
set -ex
# Requires the following packages: git, hub, docker
# SET THE FOLLOWING VARIABLES
USERNAME=simplysecurity
IMAGE=simplyemail
VERSION="$(cat VERSION)"
# UPDATE THE SOURCE CODE
git pull
# bump version
docker run --rm -v "$PWD":/app treeder/bump patch
VERSION=`cat VERSION`
echo "version: $VERSION"
# TAF, PULL, MERGE DEV
git checkout -b "Version-$VERSION"
git add --all
git commit -m "SimplyEmail $VERSION Release"
#git tag -a "$VERSION" -m "SimplyEmail $VERSION Release"
git push origin "Version-$VERSION"
#git push origin "Version-$VERSION" --tags
git checkout master
git merge "Version-$VERSION"
git push
hub release create Version-$VERSION -m "SimplyEmail $VERSION Release"
# DEL BRANCH
#git branch -d "dev"
#git branch -D "dev"
# ALERT VERSION
echo "Building Version: $VERSION"
# START BUILD
./.build.sh
# DOCKER TAG/VERSIONING
docker tag $USERNAME/$IMAGE:latest $USERNAME/$IMAGE:$VERSION
# PUSH TO DOCKER HUB
docker push $USERNAME/$IMAGE:latest
echo "Docker image pushed: $USERNAME/$IMAGE:latest"
docker push $USERNAME/$IMAGE:$VERSION
echo "Docker image pushed: $USERNAME/$IMAGE:$VERSION"
# GENERATE CHANGELOG FOR TAG AND PUSH
github_changelog_generator
git add --all
git commit -m "Update CHANGLOG.md from version bump"
git push