-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run ./release.sh <VERSION> to prepare a new release.
- Loading branch information
Showing
5 changed files
with
92 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -2,3 +2,5 @@ settings.env | |
_server_workspace_ | ||
mailman.yaml | ||
start_mailman.sh | ||
mailserver*.tgz | ||
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
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,12 @@ | ||
contrib/ | ||
grafana/ | ||
prometheus/ | ||
systemd/ | ||
LICENSE | ||
README.md | ||
dns_check.sh | ||
settings.env.empty | ||
start_mailserver.sh | ||
start_monitoring.sh | ||
user.sh | ||
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,70 @@ | ||
#!/bin/bash | ||
# | ||
# Build a release container, generate a release tarball and tag a release. | ||
# | ||
|
||
name="mailserver" | ||
container="ghcr.io/t-lo/${name}" | ||
|
||
set -euo pipefail | ||
|
||
script_dir="$(dirname "$0")" | ||
|
||
function yell() { | ||
echo | ||
echo "############# " "${@}" " ##############" | ||
echo | ||
} | ||
# -- | ||
|
||
if [ -z "${1:-}" ] ; then | ||
echo "Usage: $0 'release-version'" | ||
exit 1 | ||
fi | ||
|
||
version="$1" | ||
release_name="${name}-${version}" | ||
|
||
# Sanity | ||
|
||
if ! git diff --exit-code; then | ||
yell "ERROR: Local changes detected (see diff above). Commit and push before creating a release." | ||
exit 1 | ||
fi | ||
|
||
if ! git diff --staged --exit-code; then | ||
yell "ERROR: Staged changes detected (see diff above). Commit and push before creating a release." | ||
exit 1 | ||
fi | ||
|
||
untracked="$(git ls-files --other --exclude-standard --directory 2>&1)" | ||
|
||
if [ -n "${untracked}" ] ; then | ||
echo | ||
git ls-files --other --exclude-standard --directory 2>&1 | ||
yell "ERROR: untracked files detected (see baove). Please commit and push or remove bevore creating a release." | ||
exit 1 | ||
fi | ||
|
||
yell "Building the container image" | ||
docker build -t "${container}:${version}" . | ||
docker tag "${container}:latest" "${container}:${version}" | ||
|
||
yell "Creating the release tarball" | ||
echo "${release_name}" >VERSION | ||
tar czvf "${release_name}.tgz" -T release-files.txt | ||
|
||
yell "Creating the release tag" | ||
git tag "${release_name}" | ||
|
||
yell "Done." | ||
|
||
echo "Now run:" | ||
echo " docker push ${container}:${version}" | ||
echo " docker push ${container}:latest" | ||
echo " git push origin" | ||
echo " git push origin ${release_name}" | ||
echo | ||
echo "Then go to" | ||
echo " https://github.com/t-lo/mailserver/releases/new" | ||
echo "to create a new release, and attach ${release_name}.tgz" |
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