summaryrefslogtreecommitdiff
path: root/azure-pipelines/manifest.sh
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2019-01-05 20:11:29 +0100
committerCharles Pigott <charlespigott@googlemail.com>2019-01-13 11:31:04 +0000
commit750927372f7d10f648aa2015193d1f7f800f3a69 (patch)
treeed3390b353c7be6393b6af762e4a5b0e7b98647f /azure-pipelines/manifest.sh
parent52a66e4dd3ed3831d0bfa02ecde72e6f2a491e05 (diff)
downloadopenttd-750927372f7d10f648aa2015193d1f7f800f3a69.tar.xz
Add: [AzurePipeline] introducing a release pipeline
This release pipeline creates all the official release binaries, and publishes them as artifacts. Currently it can only produce nightlies and custom builds; stable/testing release binaries are untested. This commit also splits up the pipeline in small bits, to both improve readability, and to share code with the CI pipeline where possible.
Diffstat (limited to 'azure-pipelines/manifest.sh')
-rwxr-xr-xazure-pipelines/manifest.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/azure-pipelines/manifest.sh b/azure-pipelines/manifest.sh
new file mode 100755
index 000000000..4d1197277
--- /dev/null
+++ b/azure-pipelines/manifest.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+set -ex
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 <folder-with-bundles>"
+ exit 1
+fi
+
+FOLDER=$1
+
+if [ ! -e .version ] || [ ! -e .release_date ]; then
+ echo "This script should be executed in the root of an extracted source tarball"
+ exit 1
+fi
+
+# Find the name based on the version
+if [ "${ISSTABLERELEASE}" = "true" ]; then
+ isTesting=$(cat .version | grep "RC\|beta" || true)
+ if [ -z "${isTesting}" ]; then
+ NAME="stable"
+ else
+ NAME="testing"
+ fi
+else
+ NAME=$(cat .version | cut -d- -f2 | cut -d- -f-2)
+fi
+
+# Convert the date to a YAML date
+DATE=$(cat .release_date | tr ' ' T | sed 's/TUTC/:00-00:00/')
+VERSION=$(cat .version)
+BASE="openttd-${VERSION}"
+
+echo "name: ${NAME}" >> manifest.yaml
+echo "date: ${DATE}" >> manifest.yaml
+echo "base: ${BASE}-" >> manifest.yaml
+echo "files:" >> manifest.yaml
+
+error=""
+for i in $(ls ${FOLDER} | grep -v ".txt$\|.md$\|sum$" | sort); do
+ if [ -n "$(echo $i | grep pdb.xz)" ]; then continue; fi
+ if [ -n "$(echo $i | grep dbg.deb)" ]; then continue; fi
+
+ if [ ! -e ${FOLDER}/$i.md5sum ] || [ ! -e ${FOLDER}/$i.sha1sum ] || [ ! -e ${FOLDER}/$i.sha256sum ]; then
+ echo "ERROR: missing checksum file for ${i}" 1>&2
+ error="y"
+ continue
+ fi
+
+ echo "- id: $i" >> manifest.yaml
+ echo " size: $(stat -c"%s" ${FOLDER}/$i)" >> manifest.yaml
+ echo " md5sum: $(cat ${FOLDER}/$i.md5sum | cut -d\ -f1)" >> manifest.yaml
+ echo " sha1sum: $(cat ${FOLDER}/$i.sha1sum | cut -d\ -f1)" >> manifest.yaml
+ echo " sha256sum: $(cat ${FOLDER}/$i.sha256sum | cut -d\ -f1)" >> manifest.yaml
+done
+
+if [ -n "${error}" ]; then
+ echo "ERROR: exiting due to earlier errors" 1>&2
+ exit 1
+fi