Beta versions support: SxS support, in-app env/instance display (#1606)
* Script for beta config; unique data dir, in-app env/type display To release a beta build, increment the version and add -beta-N to the end, then go through all the standard release activities. The prepare-build npm script then updates key bits of the package.json to ensure that the beta build can be installed alongside a production build. This includes a new name ('Signal Beta') and a different location for application data. Note: Beta builds can be installed alongside production builds. As part of this, a couple new bits of data are shown across the app: - Environment (development or test, not shown if production) - App Instance (disabled in production; used for multiple accounts) These are shown in: - The window title - both environment and app instance. You can tell beta builds because the app name, preceding these data bits, is different. - The about window - both environment and app instance. You can tell beta builds from the version number. - The header added to the debug log - just environment. The version number will tell us if it's a beta build, and app instance isn't helpful. * Turn on single-window mode in non-production modes Because it's really frightening when you see 'unable to read from db' errors in the console. * aply.sh: More instructions for initial setup and testing * Gruntfile: Get consistent with use of package.json datas * Linux: manually update desktop keys, since macros not availablepull/749/head
parent
a3fbb9a6aa
commit
c94d4efd18
@ -1,18 +1,40 @@
|
||||
#!/bin/bash
|
||||
# Setup:
|
||||
# Setup - creates the local repo which will be mirrored up to S3, then back-fill it. Your
|
||||
# future deploys will eliminate all old versions without these backfill steps:
|
||||
# aptly repo create signal-desktop
|
||||
# aptly mirror create -ignore-signatures backfill-mirror https://updates.signal.org/desktop/apt xenial
|
||||
# aptly mirror update -ignore-signatures backfill-mirror
|
||||
# aptly repo import backfill-mirror signal-desktop signal-desktop signal-desktop-beta
|
||||
# aptly repo show -with-packages signal-desktop
|
||||
#
|
||||
# First run on a machine - uncomment the first two 'aptly publish snapshot' commands,
|
||||
# comment the other two. Sets up the two publish channels, one local, one to S3.
|
||||
#
|
||||
# Testing - comment out the lines with s3:$ENDPOINT to publish only locally. To eliminate
|
||||
# effects of testing, remove package from repo, then move back to old snapshot:
|
||||
# aptly repo remove signal-desktop signal-desktop_1.0.35_amd64
|
||||
# aptly publish switch -gpg-key=57F6FB06 xenial signal-desktop_v1.0.34
|
||||
#
|
||||
# Release:
|
||||
# VERSION=X.X.X ./aptly.sh
|
||||
# NAME=signal-desktop(-beta) VERSION=X.X.X ./aptly.sh
|
||||
|
||||
echo "Releasing $NAME build version $VERSION"
|
||||
|
||||
REPO=signal-desktop
|
||||
DISTRO=xenial
|
||||
ENDPOINT=signal-desktop-apt # Matches endpoint name in .aptly.conf
|
||||
DEB_PATH=release
|
||||
SNAPSHOT=signal-desktop_v$VERSION
|
||||
GPG_KEYID=57F6FB06
|
||||
aptly repo add $REPO $DEB_PATH/$REPO\_$VERSION\_*.deb
|
||||
|
||||
aptly repo add $REPO release/$NAME\_$VERSION\_*.deb
|
||||
aptly snapshot create $SNAPSHOT from repo $REPO
|
||||
|
||||
# run these two only on first release to a given repo from a given machine
|
||||
# https://www.aptly.info/doc/aptly/publish/snapshot/
|
||||
# aptly publish snapshot -gpg-key=$GPG_KEYID $SNAPSHOT
|
||||
# aptly publish snapshot -gpg-key=$GPG_KEYID -config=.aptly.conf $SNAPSHOT s3:$ENDPOINT:
|
||||
|
||||
# these update already-published repos, run every time after that
|
||||
# https://www.aptly.info/doc/aptly/publish/switch/
|
||||
aptly publish switch -gpg-key=$GPG_KEYID $DISTRO $SNAPSHOT
|
||||
aptly publish switch -gpg-key=$GPG_KEYID -config=.aptly.conf $DISTRO s3:$ENDPOINT: $SNAPSHOT
|
||||
|
@ -0,0 +1,65 @@
|
||||
const fs = require('fs');
|
||||
const _ = require('lodash');
|
||||
|
||||
const packageJson = require('./package.json');
|
||||
const version = packageJson.version;
|
||||
const beta = /beta/;
|
||||
|
||||
// You might be wondering why this file is necessary. It comes down to our desire to allow
|
||||
// side-by-side installation of production and beta builds. Electron-Builder uses
|
||||
// top-level data from package.json for many things, like the executable name, the
|
||||
// debian package name, the install directory under /opt on linux, etc. We tried
|
||||
// adding the ${channel} macro to these values, but Electron-Builder didn't like that.
|
||||
|
||||
if (!beta.test(version)) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('prepare_build: updating package.json for beta build');
|
||||
|
||||
// -------
|
||||
|
||||
const NAME_PATH = 'name';
|
||||
const PRODUCTION_NAME = 'signal-desktop';
|
||||
const BETA_NAME = 'signal-desktop-beta';
|
||||
|
||||
const PRODUCT_NAME_PATH = 'productName';
|
||||
const PRODUCTION_PRODUCT_NAME = 'Signal';
|
||||
const BETA_PRODUCT_NAME = 'Signal Beta';
|
||||
|
||||
const APP_ID_PATH = 'build.appId';
|
||||
const PRODUCTION_APP_ID = 'org.whispersystems.signal-desktop';
|
||||
const BETA_APP_ID = 'org.whispersystems.signal-desktop-beta';
|
||||
|
||||
const STARTUP_WM_CLASS_PATH = 'build.linux.desktop.StartupWMClass';
|
||||
const PRODUCTION_STARTUP_WM_CLASS = 'Signal';
|
||||
const BETA_STARTUP_WM_CLASS = 'Signal Beta';
|
||||
|
||||
|
||||
|
||||
// -------
|
||||
|
||||
function checkValue(object, objectPath, expected) {
|
||||
const actual = _.get(object, objectPath)
|
||||
if (actual !== expected) {
|
||||
throw new Error(objectPath + ' was ' + actual + '; expected ' + expected);
|
||||
}
|
||||
}
|
||||
|
||||
// ------
|
||||
|
||||
checkValue(packageJson, NAME_PATH, PRODUCTION_NAME);
|
||||
checkValue(packageJson, PRODUCT_NAME_PATH, PRODUCTION_PRODUCT_NAME);
|
||||
checkValue(packageJson, APP_ID_PATH, PRODUCTION_APP_ID);
|
||||
checkValue(packageJson, STARTUP_WM_CLASS_PATH, PRODUCTION_STARTUP_WM_CLASS);
|
||||
|
||||
// -------
|
||||
|
||||
_.set(packageJson, NAME_PATH, BETA_NAME);
|
||||
_.set(packageJson, PRODUCT_NAME_PATH, BETA_PRODUCT_NAME);
|
||||
_.set(packageJson, APP_ID_PATH, BETA_APP_ID);
|
||||
_.set(packageJson, STARTUP_WM_CLASS_PATH, BETA_STARTUP_WM_CLASS);
|
||||
|
||||
// -------
|
||||
|
||||
fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, ' '));
|
Loading…
Reference in New Issue