-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump go and node versions * Fix patch issue
- Loading branch information
Showing
13 changed files
with
67 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,72 @@ | ||
#!/bin/bash | ||
|
||
# Colours | ||
CYAN="\033[96m" | ||
YELLOW="\033[93m" | ||
RED="\033[91m" | ||
RESET="\033[0m" | ||
BOLD="\033[1m" | ||
|
||
# Program Paths: | ||
PROG=$(basename ${BASH_SOURCE[0]}) | ||
PROG_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
STRATOS_DIR="$( cd "${PROG_DIR}/.." && pwd )" | ||
|
||
echo "Stratos Directory: ${STRATOS_DIR}" | ||
echo -e "${CYAN}${BOLD}=============================${RESET}" | ||
echo -e "${CYAN}${BOLD}Updating Go and Node versions${RESET}" | ||
echo -e "${CYAN}${BOLD}=============================${RESET}" | ||
|
||
UPDATE="false" | ||
echo -e "${YELLOW}Stratos Directory: ${STRATOS_DIR}${RESET}" | ||
echo "" | ||
|
||
# Current versions that we should be using | ||
GO_VERSION=1.12.4 | ||
NODE_VERSION=10.15.3 | ||
GO_VERSION=1.13.4 | ||
NODE_VERSION=12.13.0 | ||
|
||
ALL_GOOD="true" | ||
echo -e "${YELLOW}Go Version : ${GO_VERSION}${RESET}" | ||
echo -e "${YELLOW}Node Version: ${NODE_VERSION}${RESET}" | ||
|
||
function checkGoVersion() { | ||
function checkVersion() { | ||
|
||
FILE=$1 | ||
DESC=$2 | ||
EXISTS=$3 | ||
REPLACE=$4 | ||
|
||
if [ ! -f "$FILE" ]; then | ||
echo "Error: File $FILE does not exist" | ||
echo -e "${RED}Error: File $FILE does not exist${RESET}" | ||
fi | ||
|
||
grep "${EXISTS}" "${FILE}" > /dev/null | ||
if [ $? -ne 0 ]; then | ||
echo "${DESC} has incorrect Go version" | ||
ALL_GOOD="false" | ||
|
||
if [ "$UPDATE" == "true" ]; then | ||
echo " => Updating to correct Go version" | ||
sed -i.bak -e 's/'"$REPLACE"'/'"$EXISTS"'/g' ${FILE} | ||
fi | ||
fi | ||
echo -e "${CYAN} ${FILE}${RESET}" | ||
sed -i.bak -e 's/'"$REPLACE"'/'"$EXISTS"'/g' ${FILE} | ||
} | ||
|
||
if [ "$1" == "-u" ]; then | ||
UPDATE="true" | ||
echo "Versions will be updated" | ||
fi | ||
|
||
# Check versions in the various files that we have | ||
|
||
echo "" | ||
echo -e "${YELLOW}Patching files:${RESET}" | ||
|
||
# Go Version | ||
|
||
checkGoVersion "${STRATOS_DIR}/deploy/stratos-base-images/Dockerfile.stratos-go-build-base.tmpl" "Go Builder Base Image" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkGoVersion "${STRATOS_DIR}/.travis.yml" "Travis file" "gimme ${GO_VERSION}" "gimme [0-9\.]*" | ||
checkGoVersion "${STRATOS_DIR}/deploy/ci/travis/depcache.sh" "Depcache generation script" "gimme ${GO_VERSION}" "gimme [0-9\.]*" | ||
checkGoVersion "${STRATOS_DIR}/deploy/ci/travis/run-e2e-tests.sh" "Travis E2E Tests script" "gimme ${GO_VERSION}" "gimme [0-9\.]*" | ||
checkGoVersion "${STRATOS_DIR}/deploy/fissile/Dockerfile.bosh-cli" "BOSH Release Dockerfile" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkGoVersion "${STRATOS_DIR}/deploy/ci/scripts/Dockerfile.bosh" "BOSH Dockerfile" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkGoVersion "${STRATOS_DIR}/deploy/stratos-ui-release/config/blobs.yml" "BOSH Release config file" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkGoVersion "${STRATOS_DIR}/deploy/stratos-ui-release/packages/golang/packaging" "BOSH Release packaging file" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkGoVersion "${STRATOS_DIR}/deploy/stratos-ui-release/packages/golang/spec" "BOSH Release spec file" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkGoVersion "${STRATOS_DIR}/src/frontend/packages/core/test-framework/store-test-helper.ts" "Store test helper" "\'go${GO_VERSION}\'" "\'go[0-9\.]*\'" | ||
|
||
if [ "$ALL_GOOD" == "true" ]; then | ||
echo "All files have correct versions" | ||
else | ||
echo "Some files do not have correct versions" | ||
fi | ||
|
||
echo "NOTE: Please ensure you check the Go version in the Stratos Buildpack" | ||
checkVersion "${STRATOS_DIR}/deploy/stratos-base-images/Dockerfile.stratos-go-build-base.tmpl" "Go Builder Base Image" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkVersion "${STRATOS_DIR}/.travis.yml" "Travis file" "(gimme ${GO_VERSION})" "(gimme [0-9\.]*)" | ||
checkVersion "${STRATOS_DIR}/deploy/ci/travis/depcache.sh" "Depcache generation script" "gimme ${GO_VERSION}" "gimme [0-9\.]*" | ||
checkVersion "${STRATOS_DIR}/deploy/fissile/Dockerfile.bosh-cli" "BOSH Release Dockerfile" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkVersion "${STRATOS_DIR}/deploy/ci/scripts/Dockerfile.bosh" "BOSH Dockerfile" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkVersion "${STRATOS_DIR}/deploy/stratos-ui-release/config/blobs.yml" "BOSH Release config file" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkVersion "${STRATOS_DIR}/deploy/stratos-ui-release/packages/golang/packaging" "BOSH Release packaging file" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
checkVersion "${STRATOS_DIR}/deploy/stratos-ui-release/packages/golang/spec" "BOSH Release spec file" "go${GO_VERSION}.linux" "go[0-9\.]*.linux" | ||
|
||
# Node Version | ||
|
||
checkVersion "${STRATOS_DIR}/deploy/stratos-base-images/Dockerfile.stratos-ui-build-base.tmpl" "UI Builder Base Image" "v${NODE_VERSION}\/node-v${NODE_VERSION}-linux" "v[0-9\.]*\/node-v[0-9\.]*-linux" | ||
checkVersion "${STRATOS_DIR}/deploy/stratos-base-images/Dockerfile.stratos-ui-build-base.tmpl" "UI Builder Base Image 2" "node-v${NODE_VERSION}" "node-v[0-9\.]*" | ||
checkVersion "${STRATOS_DIR}/deploy/stratos-base-images/Dockerfile.stratos-bk-build-base.tmpl" "Backend Builder Base Image" "node-v${NODE_VERSION}" "node-v[0-9\.]*" | ||
checkVersion "${STRATOS_DIR}/deploy/stratos-base-images/Dockerfile.stratos-bk-build-base.tmpl" "Backend Builder Base Image" "v${NODE_VERSION}\/node-v${NODE_VERSION}-linux" "v[0-9\.]*\/node-v[0-9\.]*-linux" | ||
checkVersion "${STRATOS_DIR}/.travis.yml" "Travis file" " - \"${NODE_VERSION}\"" " - \"[0-9\.]*\"" | ||
checkVersion "${STRATOS_DIR}/package.json" "Package file" "\"node\": \"${NODE_VERSION}\"" "\"node\": \"[0-9\.]*\"" | ||
checkVersion "${STRATOS_DIR}/docs/developers-guide.md" "Developer Guide doc" "minimum node version ${NODE_VERSION}" "minimum node version [0-9\.]*" | ||
|
||
echo "" | ||
echo -e "${YELLOW}NOTE: Please ensure you check the Go version in the Stratos Buildpack${RESET}" | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
set -e | ||
|
||
tar xzf golang/go1.12.4.linux-amd64.tar.gz | ||
tar xzf golang/go1.13.4.linux-amd64.tar.gz | ||
cp -R go/* ${BOSH_INSTALL_TARGET} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
name: golang | ||
|
||
files: | ||
- golang/go1.12.4.linux-amd64.tar.gz | ||
- golang/go1.13.4.linux-amd64.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters