This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from pracucci/add-instructions-to-release-etc…
…d-manager-ctl-binaries Added instructions and script to release etcd-manager-ctl binaries
- Loading branch information
Showing
3 changed files
with
45 additions
and
2 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 |
---|---|---|
|
@@ -14,3 +14,6 @@ bazel-testlogs | |
# We often create some local symlinks | ||
/etcd-manager | ||
/etcd-manager-ctl | ||
|
||
# Release assets | ||
dist/ |
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,36 @@ | ||
#!/bin/bash | ||
|
||
VERSION=$1 | ||
PLATFORMS="linux_amd64 darwin_amd64 windows_amd64" | ||
CMDS="etcd-manager-ctl" | ||
|
||
# Ensure the dist folder exists and is clean | ||
rm -fr dist/${VERSION} && mkdir -p dist/${VERSION} | ||
|
||
for CMD in ${CMDS}; do | ||
for PLATFORM in ${PLATFORMS}; do | ||
CMD_DIST_PATH="dist/${VERSION}/${CMD}-${PLATFORM/_/-}" | ||
|
||
# Get the expected binary file extension | ||
if [[ "${PLATFORM}" =~ "windows" ]]; then | ||
EXTENSION=".exe" | ||
else | ||
EXTENSION="" | ||
fi | ||
|
||
# Build | ||
bazel build --platforms=@io_bazel_rules_go//go/toolchain:${PLATFORM} //cmd/${CMD} | ||
|
||
if [ -e "bazel-bin/cmd/${CMD}/${PLATFORM}_stripped/${CMD}${EXTENSION}" ]; then | ||
cp bazel-bin/cmd/${CMD}/${PLATFORM}_stripped/${CMD}${EXTENSION} ${CMD_DIST_PATH} | ||
elif [ -e "bazel-bin/cmd/${CMD}/${PLATFORM}_pure_stripped/${CMD}${EXTENSION}" ]; then | ||
cp bazel-bin/cmd/${CMD}/${PLATFORM}_pure_stripped/${CMD}${EXTENSION} ${CMD_DIST_PATH} | ||
else | ||
echo "Unable to find compiled binary for ${CMD} ${PLATFORM}" | ||
exit 1 | ||
fi | ||
|
||
# Generate SHA-256 | ||
shasum -a 256 ${CMD_DIST_PATH} | cut -d ' ' -f 1 > ${CMD_DIST_PATH}-sha-256 | ||
done | ||
done |
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,8 +1,12 @@ | ||
#!/bin/bash | ||
|
||
TODAY=`date +%Y%m%d` | ||
VERSION="3.0.${TODAY}" | ||
|
||
echo "# Run these commands to do a release" | ||
echo "DOCKER_IMAGE_PREFIX=kopeio/ DOCKER_TAG=3.0.${TODAY} make push" | ||
echo "DOCKER_IMAGE_PREFIX=kopeio/ DOCKER_TAG=${VERSION} make push" | ||
echo "DOCKER_IMAGE_PREFIX=kopeio/ DOCKER_TAG=latest make push" | ||
echo "git tag 3.0.${TODAY}" | ||
echo "git tag ${VERSION}" | ||
echo "git push --tags ssh://[email protected]/kopeio/etcd-manager" | ||
echo "./dev/build-assets.sh ${VERSION}" | ||
echo "# Finally, create a new release on GitHub attaching binary assets at dist/${VERSION}/" |