From 261b81c8a7815a38b164f72871abe364bd90f43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 21 Nov 2019 18:41:34 +0100 Subject: [PATCH] nix: upgrade: 2.2.1 > 2.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit also drop toolversion scripts and functions Signed-off-by: Jakub SokoĊ‚owski --- .TOOLVERSIONS | 6 ---- ci/utils.groovy | 8 ----- scripts/lib/setup/packages.sh | 4 --- scripts/prepare-for-desktop-platform.sh | 2 -- scripts/run-environment-check.sh | 46 ------------------------- scripts/setup | 2 +- scripts/toolversion | 45 ------------------------ 7 files changed, 1 insertion(+), 112 deletions(-) delete mode 100644 .TOOLVERSIONS delete mode 100755 scripts/run-environment-check.sh delete mode 100755 scripts/toolversion diff --git a/.TOOLVERSIONS b/.TOOLVERSIONS deleted file mode 100644 index 002d5b5ad1..0000000000 --- a/.TOOLVERSIONS +++ /dev/null @@ -1,6 +0,0 @@ -android-sdk-build-tools;28.0.1; -android-sdk;4333796;aa190cfd7299cd6a1c687355bb2764e4 -nix;2.2.1; -node;10.15.0; -StatusImAppImage;20181208; -StatusIm-Windows-base-image;20181113; \ No newline at end of file diff --git a/ci/utils.groovy b/ci/utils.groovy index debdb8f964..a501ad0cea 100644 --- a/ci/utils.groovy +++ b/ci/utils.groovy @@ -3,14 +3,6 @@ def getVersion() { return readFile(path).trim() } -def getToolVersion(name) { - def version = sh( - returnStdout: true, - script: "${env.WORKSPACE}/scripts/toolversion ${name}" - ).trim() - return version -} - def branchName() { return env.GIT_BRANCH.replaceAll(/.*origin\//, '') } diff --git a/scripts/lib/setup/packages.sh b/scripts/lib/setup/packages.sh index 2cc4f9698c..6c09418a1c 100755 --- a/scripts/lib/setup/packages.sh +++ b/scripts/lib/setup/packages.sh @@ -25,7 +25,3 @@ function program_version_exists() { fi $(exit 1) } - -function toolversion() { - ${GIT_ROOT}/scripts/toolversion "${1}" -} diff --git a/scripts/prepare-for-desktop-platform.sh b/scripts/prepare-for-desktop-platform.sh index 652c918a86..9e61ee02e3 100755 --- a/scripts/prepare-for-desktop-platform.sh +++ b/scripts/prepare-for-desktop-platform.sh @@ -16,8 +16,6 @@ YELLOW='\033[1;33m' NC='\033[0m' PLATFORM_FOLDER="desktop/js_files" -$GIT_ROOT/scripts/run-environment-check.sh desktop - if [ ! -f package.json ] || [ $(readlink package.json) != "${PLATFORM_FOLDER}/package.json" ]; then rm -rf node_modules diff --git a/scripts/run-environment-check.sh b/scripts/run-environment-check.sh deleted file mode 100755 index 5a7685dcb7..0000000000 --- a/scripts/run-environment-check.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash - -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -NC='\033[0m' -PLATFORM="" - -_current_dir=$(cd "${BASH_SOURCE%/*}" && pwd) -source "$_current_dir/lib/setup/path-support.sh" - -source_lib "packages.sh" - -EXPECTED_NODE_VERSION="v$(toolversion node)" # note the 'v' in front, that is how node does versioning -EXPECTED_YARN_VERSION="$(toolversion yarn)" # note the lack of 'v' in front. inconsistent. :( - -# if no arguments passed, inform user about possible ones -if [ $# -eq 0 ]; then - echo -e "${GREEN}This script should be invoked with platform argument: 'android', 'ios' or 'desktop'${NC}" - exit 1 -else - PLATFORM=$1 -fi - -if [ -z "$IN_NIX_SHELL" ]; then - if ! program_version_exists node $EXPECTED_NODE_VERSION || ! program_version_exists yarn $EXPECTED_YARN_VERSION; then - echo -e "${YELLOW}********************************************************************************************" - - echo -e "The current environment doesn't contain the expected versions of node and/or yarn" - echo -e " - node:\texpected\t${EXPECTED_NODE_VERSION}" - echo -e " \t\tfound\t\t$(node -v) ($(which node))" - echo -e " - yarn:\texpected\t${EXPECTED_YARN_VERSION}" - echo -e " \t\tfound\t\t$(yarn -v) ($(which yarn))" - echo -e "Please open another console to reload the environment." - - echo -e "**********************************************************************************************${NC}" - exit 1 - fi -fi - -if [ "$PLATFORM" == 'ios' ] && [ "$(uname)" != "Darwin" ]; then - echo -e "${RED}iOS builds are only possible on macOS hosts${NC}" - exit 1 -fi - -echo -e "${GREEN}Finished!${NC}" diff --git a/scripts/setup b/scripts/setup index 1fe66efd44..2e92cfd433 100755 --- a/scripts/setup +++ b/scripts/setup @@ -50,7 +50,7 @@ fi setup_header "Installing requirements..." if [ "$IN_NIX_SHELL" != 'pure' ] && ! is_nixos && ! program_exists nix; then - required_version=$(toolversion nix) + required_version="2.3.1" NIX_INSTALLER_NO_MODIFY_PROFILE=1 bash <(curl https://nixos.org/releases/nix/nix-${required_version}/install) --no-daemon if [ $? -eq 0 ]; then echo -e "${YELLOW}**********************************************************************************************************" diff --git a/scripts/toolversion b/scripts/toolversion deleted file mode 100755 index 50f1296f8b..0000000000 --- a/scripts/toolversion +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -################################################################################ -# This tool fetches versions and checksums of build tools from the .TOOLVERSIONS -# file in project root. This is then used by various setup scripts, -# and most importantly by Dockerfiles. -################################################################################ - -set -e - -GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel) -TOOL_VERSIONS_FILE="${GIT_ROOT}/.TOOLVERSIONS" - -usage () { - echo "Usage: toolversion [-c] " >&2 - echo - echo "This script extracts tooling versions from ${TOOL_VERSIONS_FILE}" - exit 0 -} - -# some options parsing -while getopts ":ch" opt; do - case $opt in - c) CHECKSUM=1; shift ;; - h) usage;; - \?) echo "Invalid option: -$OPTARG" >&2; exit 1;; - esac -done - -# verify the main argument was given -if [[ -z "${1}" ]]; then usage; fi - -NAME=${1} - -getColumn () { - local value=$(awk -F';' "/^${NAME};/{print \$${1}}" "${TOOL_VERSIONS_FILE}") - [ -z "$value" ] && echo "\nUnexpected missing value for ${NAME} in ${TOOL_VERSIONS_FILE}" && exit 1 - echo $value -} - -if [[ $CHECKSUM ]]; then - getColumn 3 -else - getColumn 2 -fi