forked from hyphanet/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-build
executable file
·78 lines (70 loc) · 3.05 KB
/
release-build
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# Release a Freenet build.
# Everything here can be safely re-run except for tag-build. If you get a failure after that, comment out tag-build before running this script again.
# Usage is "release-build 9999" for build 9999.
# TODO Add --help etc.
# TODO Add --snapshot to proxy to release-fred --snapshot ???
# Load configuration and utility functions.
source freenet-scripts-common || exit
BUILD=$1
TARGET=$2
if [[ x"$TARGET" == x"" || x"$BUILD" == x"" ]]; then
echo usage: "$0" BUILDNUMBER TARGET
echo BUILDNUMBER: XXXX, i.e. 1484
echo TARGET:
echo "- build (release),"
echo "- testing (use latest testing tag), or"
echo "- snapshot (no tag, no installer, identified by vcs-rev)"
exit 1
fi
# Set up agents at the beginning of this script, but not the individual scripts.
# TODO We could put this in freenet-scripts-common but only if it doesn't get re-run in every script we call.
#eval `gpg-agent --daemon`
if [ "$useSshAgent" == "1" ]; then
eval $(ssh-agent -s)
ssh-add
function stopAgent() {
ssh-agent -k
}
trap stopAgent EXIT
fi
./update-bookmarks || exit
if [ x"$TARGET" == x"build" ]; then
./update-version $BUILD || exit
./tag-build $BUILD || exit 1
fi
# Get build info after tagging the new build.
getBuildInfo $TARGET
echo Releasing $TARGET $buildNumber
./release-fred $TARGET || exit 2
if [ x"$TARGET" == x"snapshot" ]; then
echo "skipping further actions because this is a snapshot release";
exit 0;
fi
./release-installer $TARGET || exit 3
# ./release-wininstaller $TARGET || exit 4
echo Now please test the new build.
echo Deploy the build only when:
echo 1: You have tested the new build and are satisfied that it works, and
echo 2: You have a node running on FCP port $fcpUpdatePort, without excessive logging - this should NOT be your normal development node.
echo The test node you just installed will do fine.
java -jar ${releaseDir}/new_installer_offline_${buildNumber}.jar || exit 6
# TODO: upload-assets does not work for testing yet, because it expects an int as build number
if [ x"$TARGET" == x"testing" ]; then
echo "skipping further actions because this is a testing release";
exit 0;
fi
require "upload to github? Requires FreenetInstaller-${buildNumber}.exe in $releaseDir. Add all jars from ~/Freenet to the release, then trigger an action at https://github.com/freenet/wininstaller-innosetup/actions/ and extract FreenetInstaller.exe from the zip. Move it to $releaseDir/FreenetInstaller-${buildNumber}.exe."
if test ! -e ~/FreenetReleased/FreenetInstaller-$buildNumber.exe.sig; then
gpg --sign --detach-sign ~/FreenetReleased/FreenetInstaller-$buildNumber.exe
fi
env GITHUB_OAUTH="$gitHubOAuthToken" ./upload-assets $buildNumber "$releaseDir" || exit
# REDFLAG IT IS NEVER SAFE TO INSERT A BUILD ON A DEVELOPMENT NODE!!!!!
require "Perform release?"
# TODO: automate website update?
echo "FIXME: deploy news entry for new version"
require "Final chance: Deploy to auto-update?"
./insert-update || exit 9
#killall gpg-agent
# TODO How to terminate our gpg-agent and no others?
echo All done.