Skip to content

Commit

Permalink
Bump go and node versions (#4016)
Browse files Browse the repository at this point in the history
* Bump go and node versions

* Fix patch issue
  • Loading branch information
nwmac authored Dec 3, 2019
1 parent ee9c4e0 commit 579b8cd
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 63 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "10.16.3"
- "12.13.0"
sudo: required
dist: bionic
services:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
before_script:
- curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
- chmod +x ~/bin/gimme
- eval "$(gimme 1.12.4)"
- eval "$(gimme 1.13.4)"
- go get -u golang.org/x/lint/golint
script:
- golint src/jetstream/...
Expand All @@ -61,7 +61,7 @@ jobs:
before_script:
- curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
- chmod +x ~/bin/gimme
- eval "$(gimme 1.12.4)"
- eval "$(gimme 1.13.4)"
script:
- npm run test-backend
- name: Helm Chart Unit Tests
Expand Down
84 changes: 44 additions & 40 deletions build/update-tools-versions.sh
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 ""
2 changes: 1 addition & 1 deletion deploy/ci/scripts/Dockerfile.bosh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM bosh/cli2

RUN apt-get update
RUN apt-get install -y git curl wget
RUN curl https://storage.googleapis.com/golang/go1.12.4.linux-amd64.tar.gz -o /go1.9.7.tar.gz
RUN curl https://storage.googleapis.com/golang/go1.13.4.linux-amd64.tar.gz -o /go1.9.7.tar.gz
RUN curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - && \
sudo apt-get install -y nodejs git
RUN tar -C /usr/local -xzf /go1.9.7.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion deploy/ci/travis/depcache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ apt-get install -y curl
apt-get install -y git
curl -sL -o ./gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
chmod +x ./gimme
eval "$(./gimme 1.12.4)"
eval "$(./gimme 1.13.4)"
mkdir -p /root/go/bin
export PATH=/root/go/bin:$PATH
cd /stratos/src/jetstream
Expand Down
4 changes: 2 additions & 2 deletions deploy/fissile/Dockerfile.bosh-cli
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM splatform/bosh-cli

RUN curl https://storage.googleapis.com/golang/go1.12.4.linux-amd64.tar.gz -o go1.12.4.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.12.4.linux-amd64.tar.gz
RUN curl https://storage.googleapis.com/golang/go1.13.4.linux-amd64.tar.gz -o go1.13.4.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.13.4.linux-amd64.tar.gz
RUN curl https://deb.nodesource.com/setup_6.x -o install_node.sh
RUN chmod +x install_node.sh && \
./install_node.sh && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ RUN useradd -ms /bin/bash stratos && \
chown -R stratos /home/stratos && \
chgrp -R users /home/stratos

RUN cd / && wget https://nodejs.org/dist/v8.11.2/node-v8.11.2-linux-x64.tar.xz && \
tar -xf node-v8.11.2-linux-x64.tar.xz
RUN cd / && wget https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz && \
tar -xf node-v12.13.0-linux-x64.tar.xz
ENV USER=stratos
ENV PATH=$PATH:/node-v8.11.2-linux-x64/bin
ENV PATH=$PATH:/node-v12.13.0-linux-x64/bin
USER stratos
WORKDIR /home/stratos
WORKDIR /home/stratos
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ RUN zypper ref
RUN zypper -n ref && \
zypper -n up && \
zypper in -y which tar git gcc curl wget
RUN wget https://storage.googleapis.com/golang/go1.12.4.linux-amd64.tar.gz && \
tar -xzf go1.12.4.linux-amd64.tar.gz -C /usr/local/ && \
RUN wget https://storage.googleapis.com/golang/go1.13.4.linux-amd64.tar.gz && \
tar -xzf go1.13.4.linux-amd64.tar.gz -C /usr/local/ && \
mkdir -p /home/stratos/go/bin && \
mkdir -p /home/stratos/go/src

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ RUN zypper ref
RUN zypper -n ref && \
zypper -n up && \
zypper in -y wget tar git
RUN cd / && wget https://nodejs.org/dist/v8.11.2/node-v8.11.2-linux-x64.tar.xz && \
tar -xf node-v8.11.2-linux-x64.tar.xz
RUN cd / && wget https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz && \
tar -xf node-v12.13.0-linux-x64.tar.xz
ENV USER=stratos
ENV PATH=$PATH:/node-v8.11.2-linux-x64/bin
ENV PATH=$PATH:/node-v12.13.0-linux-x64/bin
RUN useradd -ms /bin/bash stratos && \
mkdir -p /home/stratos && \
chown -R stratos /home/stratos && \
Expand All @@ -31,4 +31,4 @@ RUN zypper rr smt_internal_server
{{/IS_SLE}}

USER stratos
WORKDIR /home/stratos
WORKDIR /home/stratos
4 changes: 2 additions & 2 deletions deploy/stratos-ui-release/config/blobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ nginx/pcre-8.40.tar.gz:
size: 2065161
object_id: 44706e8c-255c-4ff3-9737-23ab55a1a214
sha: 10384eb3d411794cc15f55b9d837d3f69e35391e
golang/go1.12.4.linux-amd64.tar.gz:
golang/go1.13.4.linux-amd64.tar.gz:
size: 118297141
object_id: 53346f1f-edfc-40d5-54b9-04126e05fdf3
sha: fa74941098fcf91fdcf1a45f6275a0de3ac67f1f
sha: bd3d3df8557fbf84e9328a1327fbf0ae1367df85

2 changes: 1 addition & 1 deletion deploy/stratos-ui-release/packages/golang/packaging
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}
2 changes: 1 addition & 1 deletion deploy/stratos-ui-release/packages/golang/spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
name: golang

files:
- golang/go1.12.4.linux-amd64.tar.gz
- golang/go1.13.4.linux-amd64.tar.gz
2 changes: 1 addition & 1 deletion docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using Visual Studio Code. If you feel comfortable with these and are happy with
choose a deployment method and bring one up. These deployments will bring up the entire backend, including api service and database
along with a V2 frontend.
* Need to make changes to the backend code? Follow the below [Backend Development](#Backend-Development) set up guide
* Install [NodeJs](https://nodejs.org) (minimum node version 8.11.3)
* Install [NodeJs](https://nodejs.org) (minimum node version 12.13.0)
* Install [Angular CLI](https://cli.angular.io/) - `npm install -g @angular/cli`

### Configuration
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"@nrwl/angular": "8.5.2"
},
"engines": {
"node": "8.11.2"
"node": "12.13.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.7",
Expand Down

0 comments on commit 579b8cd

Please sign in to comment.