summaryrefslogtreecommitdiffhomepage
path: root/desktop/scripts/release/6-publish-linux-repositories
blob: 970e41ba0079ade34643948b9b5ffaa681f31a04 (plain)
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
#!/usr/bin/env bash

set -eu

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR"

REPO_ROOT=../../../
PRODUCT_VERSION_PATH=$REPO_ROOT/dist-assets/desktop-product-version.txt
PRODUCT_VERSION=$(cat $PRODUCT_VERSION_PATH)

$REPO_ROOT/scripts/utils/commit-verification
"$SCRIPT_DIR/verify-version-is-release"

if [ $# -ne 1 ]; then
    echo "Please provide the following arguments:"
    echo "    $(basename "$0") \\"
    echo "        <build server SSH destination>"
    exit 1
fi

# shellcheck source=desktop/scripts/release/release-config.sh
source "$SCRIPT_DIR/release-config.sh"

# The hostname (can be the alias in your ~/.ssh/config) of the build server
BUILD_SERVER_HOST=$1

source $REPO_ROOT/scripts/utils/log

function run_on_build_server {
  # This should be expanded client side
  # shellcheck disable=SC2029
  ssh "$BUILD_SERVER_HOST" "$@"
}

function run_on_build_server_as_build_user {
  run_on_build_server sudo -i -u "$BUILDSERVER_BUILDUSER" "$@"
}

run_on_build_server_as_build_user \
  "autobuild-linux/publish-app-to-repositories.sh" \
  --production \
  "autobuild-linux/artifacts/$PRODUCT_VERSION" \
  "$PRODUCT_VERSION"