-
Notifications
You must be signed in to change notification settings - Fork 0
/
release
25 lines (19 loc) · 855 Bytes
/
release
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
#!/bin/bash
set -e
~/semantic-release -ghr -vf -changelog CHANGELOG.md
export VERSION=$(cat .version)
#Set CGO_ENABLED to 0 so no all libs are static
env CGO_ENABLED=0 gox -parallel 4 -osarch="linux/amd64 darwin/amd64 linux/arm windows/amd64" -ldflags="-s -w -X main.SRVERSION=$VERSION" -output="bin/{{.Dir}}_v"$VERSION"_{{.OS}}_{{.Arch}}" ./cmd/subscription/
mkdir docker
cp bin/subscription_v"$VERSION"_linux_amd64 docker/subscription
chmod +x docker/subscription
ghr $(cat .ghr) bin/
# docker build
export IMAGE_NAME="pitwch/boll-kaspersky-subscriptions"
export IMAGE_NAME_VERSION="$IMAGE_NAME:$VERSION"
docker build -t $IMAGE_NAME_VERSION .
docker tag $IMAGE_NAME_VERSION $IMAGE_NAME
# push to docker hub
echo "$DOCKER_PASSWORD" | docker login --username $DOCKER_USERNAME --password-stdin
docker push $IMAGE_NAME_VERSION
docker push $IMAGE_NAME