summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2019-01-21 20:01:16 +0000
committerMonty Taylor <mordred@inaugust.com>2019-02-04 21:26:37 +0000
commit3294e6e3e39a3c03ae0f817cc4256005c0e53b75 (patch)
tree1e8987c1ae3b2e0226f2966db88d6ef99eb2e92c
parent7fe0e780cf4278feccd78290e7d6638e3ac4f79b (diff)
Use node v10 instead of node v8
nodejs v10 is the latest LTS release of node. Update to use it instead of v8. One would not expect this to impact us much, but in theory v10 is faster so we could see quicker compile times. Update zuul-build-dashboard to run on changes to install-js-tools. Downloaded the 10.x version of the upstream setup script and updated the header. Made a meaningless change in package.json to trigger build jobs. Change-Id: Ibfc732a9b725f8ee5f0eb51ece11692694956592
Notes
Notes (review): Code-Review+2: James E. Blair <corvus@inaugust.com> Code-Review+2: Tobias Henkel <tobias.henkel@bmw.de> Workflow+1: Tobias Henkel <tobias.henkel@bmw.de> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 05 Feb 2019 18:40:53 +0000 Reviewed-on: https://review.openstack.org/632165 Project: openstack-infra/zuul Branch: refs/heads/master
-rw-r--r--.zuul.yaml10
-rw-r--r--[-rwxr-xr-x]tools/install-js-repos-rpm.sh188
-rwxr-xr-xtools/install-js-tools.sh2
-rw-r--r--web/package.json2
4 files changed, 155 insertions, 47 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index 693385c..c3ca07b 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -186,11 +186,11 @@
186 - zuul-build-dashboard-multi-tenant 186 - zuul-build-dashboard-multi-tenant
187 - nodejs-npm-run-lint: 187 - nodejs-npm-run-lint:
188 vars: 188 vars:
189 node_version: 8 189 node_version: 10
190 zuul_work_dir: "{{ zuul.project.src_dir }}/web" 190 zuul_work_dir: "{{ zuul.project.src_dir }}/web"
191 - nodejs-npm-run-test: 191 - nodejs-npm-run-test:
192 vars: 192 vars:
193 node_version: 8 193 node_version: 10
194 zuul_work_dir: "{{ zuul.project.src_dir }}/web" 194 zuul_work_dir: "{{ zuul.project.src_dir }}/web"
195 success-url: 'npm/reports/bundle.html' 195 success-url: 'npm/reports/bundle.html'
196 files: 196 files:
@@ -217,11 +217,11 @@
217 - zuul-build-dashboard 217 - zuul-build-dashboard
218 - nodejs-npm-run-lint: 218 - nodejs-npm-run-lint:
219 vars: 219 vars:
220 node_version: 8 220 node_version: 10
221 zuul_work_dir: "{{ zuul.project.src_dir }}/web" 221 zuul_work_dir: "{{ zuul.project.src_dir }}/web"
222 - nodejs-npm-run-test: 222 - nodejs-npm-run-test:
223 vars: 223 vars:
224 node_version: 8 224 node_version: 10
225 zuul_work_dir: "{{ zuul.project.src_dir }}/web" 225 zuul_work_dir: "{{ zuul.project.src_dir }}/web"
226 success-url: 'npm/reports/bundle.html' 226 success-url: 'npm/reports/bundle.html'
227 files: 227 files:
@@ -236,7 +236,7 @@
236 - publish-zuul-python-branch-tarball 236 - publish-zuul-python-branch-tarball
237 - publish-openstack-javascript-content: 237 - publish-openstack-javascript-content:
238 vars: 238 vars:
239 node_version: 8 239 node_version: 10
240 zuul_work_dir: "{{ zuul.project.src_dir }}/web" 240 zuul_work_dir: "{{ zuul.project.src_dir }}/web"
241 create_tarball_directory: build 241 create_tarball_directory: build
242 promote: 242 promote:
diff --git a/tools/install-js-repos-rpm.sh b/tools/install-js-repos-rpm.sh
index 6832c14..a304c38 100755..100644
--- a/tools/install-js-repos-rpm.sh
+++ b/tools/install-js-repos-rpm.sh
@@ -22,25 +22,62 @@
22 22
23# The above license is inferred from the 23# The above license is inferred from the
24# https://github.com/nodesource/distributions source repository. 24# https://github.com/nodesource/distributions source repository.
25
26# Discussion, issues and change requests at: 25# Discussion, issues and change requests at:
27# https://github.com/nodesource/distributions 26# https://github.com/nodesource/distributions
28# 27#
29# Script to install the NodeSource Node.js 8.x repo onto an 28# Script to install the NodeSource Node.js 10.x repo onto an
30# Enterprise Linux or Fedora Core based system. 29# Enterprise Linux or Fedora Core based system.
31# 30#
32# Run as root or insert `sudo -E` before `bash`: 31# This was downloaded from https://rpm.nodesource.com/setup_10.x
33#
34# This was downloaded from https://rpm.nodesource.com/setup_8.x
35# A few modifications have been made. 32# A few modifications have been made.
36 33
34SCRSUFFIX="_10.x"
35NODENAME="Node.js 10.x"
36NODEREPO="pub_10.x"
37NODEPKG="nodejs"
38
37print_status() { 39print_status() {
38 local outp=$(echo "$1" | sed -r 's/\\n/\\n## /mg') 40 local outp=$(echo "$1") # | sed -r 's/\\n/\\n## /mg')
39 echo 41 echo
40 echo -e "## ${outp}" 42 echo -e "## ${outp}"
41 echo 43 echo
42} 44}
43 45
46if test -t 1; then # if terminal
47 ncolors=$(which tput > /dev/null && tput colors) # supports color
48 if test -n "$ncolors" && test $ncolors -ge 8; then
49 termcols=$(tput cols)
50 bold="$(tput bold)"
51 underline="$(tput smul)"
52 standout="$(tput smso)"
53 normal="$(tput sgr0)"
54 black="$(tput setaf 0)"
55 red="$(tput setaf 1)"
56 green="$(tput setaf 2)"
57 yellow="$(tput setaf 3)"
58 blue="$(tput setaf 4)"
59 magenta="$(tput setaf 5)"
60 cyan="$(tput setaf 6)"
61 white="$(tput setaf 7)"
62 fi
63fi
64
65print_bold() {
66 title="$1"
67 text="$2"
68
69 echo
70 echo "${red}================================================================================${normal}"
71 echo "${red}================================================================================${normal}"
72 echo
73 echo -e " ${bold}${yellow}${title}${normal}"
74 echo
75 echo -en " ${text}"
76 echo
77 echo "${red}================================================================================${normal}"
78 echo "${red}================================================================================${normal}"
79}
80
44bail() { 81bail() {
45 echo 'Error executing command, exiting' 82 echo 'Error executing command, exiting'
46 exit 1 83 exit 1
@@ -55,18 +92,88 @@ exec_cmd() {
55 exec_cmd_nobail "$1" || bail 92 exec_cmd_nobail "$1" || bail
56} 93}
57 94
58print_status "Installing the NodeSource Node.js 8.x repo..." 95node_deprecation_warning() {
96 if [[ "X${NODENAME}" == "Xio.js 1.x" ||
97 "X${NODENAME}" == "Xio.js 2.x" ||
98 "X${NODENAME}" == "Xio.js 3.x" ||
99 "X${NODENAME}" == "XNode.js 0.10" ||
100 "X${NODENAME}" == "XNode.js 0.12" ||
101 "X${NODENAME}" == "XNode.js 4.x LTS Argon" ||
102 "X${NODENAME}" == "XNode.js 5.x" ||
103 "X${NODENAME}" == "XNode.js 7.x" ]]; then
104
105 print_bold \
106" DEPRECATION WARNING " "\
107${bold}${NODENAME} is no longer actively supported!${normal}
108
109 ${bold}You will not receive security or critical stability updates${normal} for this version.
110
111 You should migrate to a supported version of Node.js as soon as possible.
112 Use the installation script that corresponds to the version of Node.js you
113 wish to install. e.g.
114
115 * ${green}https://deb.nodesource.com/setup_8.x — Node.js v8 LTS \"Carbon\"${normal} (recommended)
116 * ${green}https://deb.nodesource.com/setup_10.x — Node.js v10 Current${normal}
117
118 Please see ${bold}https://github.com/nodejs/Release${normal} for details about which
119 version may be appropriate for you.
120
121 The ${bold}NodeSource${normal} Node.js distributions repository contains
122 information both about supported versions of Node.js and supported Linux
123 distributions. To learn more about usage, see the repository:
124 ${bold}https://github.com/nodesource/distributions${normal}
125"
126 echo
127 echo "Continuing in 20 seconds ..."
128 echo
129 sleep 20
130 fi
131}
132
133script_deprecation_warning() {
134 if [ "X${SCRSUFFIX}" == "X" ]; then
135 print_bold \
136" SCRIPT DEPRECATION WARNING " "\
137This script, located at ${bold}https://rpm.nodesource.com/setup${normal}, used to
138 install Node.js v0.10, is deprecated and will eventually be made inactive.
139
140 You should use the script that corresponds to the version of Node.js you
141 wish to install. e.g.
142
143 * ${green}https://deb.nodesource.com/setup_8.x — Node.js v8 LTS \"Carbon\"${normal} (recommended)
144 * ${green}https://deb.nodesource.com/setup_10.x — Node.js v10 Current${normal}
145
146 Please see ${bold}https://github.com/nodejs/Release${normal} for details about which
147 version may be appropriate for you.
148
149 The ${bold}NodeSource${normal} Node.js Linux distributions GitHub repository contains
150 information about which versions of Node.js and which Linux distributions
151 are supported and how to use the install scripts.
152 ${bold}https://github.com/nodesource/distributions${normal}
153"
154
155 echo
156 echo "Continuing in 20 seconds (press Ctrl-C to abort) ..."
157 echo
158 sleep 20
159 fi
160}
161
162setup() {
163
164script_deprecation_warning
165node_deprecation_warning
166
167print_status "Installing the NodeSource ${NODENAME} repo..."
59 168
60print_status "Inspecting system..." 169print_status "Inspecting system..."
61 170
62if [ ! -x /bin/rpm ]; then 171if [ ! -x /bin/rpm ]; then
63 print_status "\ 172 print_status """You don't appear to be running an Enterprise Linux based system,
64You don't appear to be running an Enterprise Linux based \ 173please contact NodeSource at https://github.com/nodesource/distributions/issues
65system, please contact NodeSource at \ 174if you think this is incorrect or would like your distribution to be considered
66https://github.com/nodesource/distributions/issues if you think this \ 175for support.
67is incorrect or would like your distribution to be considered for \ 176"""
68support.\
69"
70 exit 1 177 exit 1
71fi 178fi
72 179
@@ -98,7 +205,7 @@ fi
98 205
99if [[ $DISTRO_PKG =~ ^(redhat|centos|cloudlinux|sl)- ]]; then 206if [[ $DISTRO_PKG =~ ^(redhat|centos|cloudlinux|sl)- ]]; then
100 DIST_TYPE=el 207 DIST_TYPE=el
101elif [[ $DISTRO_PKG =~ ^system-release- ]]; then # Amazon Linux 208elif [[ $DISTRO_PKG =~ ^(enterprise|system)-release- ]]; then # Oracle Linux & Amazon Linux
102 DIST_TYPE=el 209 DIST_TYPE=el
103elif [[ $DISTRO_PKG =~ ^(fedora|korora)- ]]; then 210elif [[ $DISTRO_PKG =~ ^(fedora|korora)- ]]; then
104 DIST_TYPE=fc 211 DIST_TYPE=fc
@@ -115,7 +222,7 @@ Include your 'distribution package' name: ${DISTRO_PKG}. \
115 222
116fi 223fi
117 224
118if [[ $DISTRO_PKG =~ ^system-release-201[4-9]\. ]]; then #NOTE: not really future-proof 225if [[ $DISTRO_PKG =~ ^system-release ]]; then
119 226
120 # Amazon Linux, for 2014.* use el7, older versions are unknown, perhaps el6 227 # Amazon Linux, for 2014.* use el7, older versions are unknown, perhaps el6
121 DIST_VERSION=7 228 DIST_VERSION=7
@@ -124,7 +231,7 @@ else
124 231
125 ## Using the redhat-release-server-X, centos-release-X, etc. pattern 232 ## Using the redhat-release-server-X, centos-release-X, etc. pattern
126 ## extract the major version number of the distro 233 ## extract the major version number of the distro
127 DIST_VERSION=$(echo $DISTRO_PKG | sed -r 's/^[[:alpha:]]+-release(-server|-workstation)?-([0-9]+).*$/\2/') 234 DIST_VERSION=$(echo $DISTRO_PKG | sed -r 's/^[[:alpha:]]+-release(-server|-workstation|-client)?-([0-9]+).*$/\2/')
128 235
129 if ! [[ $DIST_VERSION =~ ^[0-9][0-9]?$ ]]; then 236 if ! [[ $DIST_VERSION =~ ^[0-9][0-9]?$ ]]; then
130 237
@@ -147,7 +254,7 @@ fi
147## we include the arch in the directory tree anyway) 254## we include the arch in the directory tree anyway)
148RELEASE_URL_VERSION_STRING="${DIST_TYPE}${DIST_VERSION}" 255RELEASE_URL_VERSION_STRING="${DIST_TYPE}${DIST_VERSION}"
149RELEASE_URL="\ 256RELEASE_URL="\
150https://rpm.nodesource.com/pub_8.x/\ 257https://rpm.nodesource.com/${NODEREPO}/\
151${DIST_TYPE}/\ 258${DIST_TYPE}/\
152${DIST_VERSION}/\ 259${DIST_VERSION}/\
153${DIST_ARCH}/\ 260${DIST_ARCH}/\
@@ -193,15 +300,14 @@ if [ "$DIST_TYPE" == "el" ] && [ "$DIST_VERSION" == "5" ]; then
193 exit 1 300 exit 1
194 fi 301 fi
195 302
196 print_status "\ 303 print_status """The EPEL (Extra Packages for Enterprise Linux) repository is a
197The EPEL (Extra Packages for Enterprise Linux) repository is a\n\ 304prerequisite for installing Node.js on your operating system. Please
198prerequisite for installing Node.js on your operating system. Please\n\ 305add it and re-run this setup script.
199add it and re-run this setup script.\n\ 306
200\n\ 307The EPEL repository RPM is available at:
201The EPEL repository RPM is available at:\n\ 308 ${epel_url}${epel}
202 ${epel_url}${epel}\n\ 309You can try installing with: \`rpm -ivh <url>\`
203You can try installing with: \`rpm -ivh <url>\`\ 310"""
204"
205 311
206 exit 1 312 exit 1
207 fi 313 fi
@@ -236,21 +342,23 @@ EXISTING_NODE=$(rpm -qa 'node|npm|iojs' | grep -v nodesource)
236 342
237if [ "X${EXISTING_NODE}" != "X" ]; then 343if [ "X${EXISTING_NODE}" != "X" ]; then
238 344
239 # NOTE(mordred) Removed -y from the yum command below. 345 print_status """Your system appears to already have Node.js installed from an alternative source.
240 print_status "\ 346Run \`${bold}sudo yum remove -y ${NODEPKG} npm${normal}\` to remove these first.
241Your system appears to already have Node.js installed from an alternative source.\n\ 347"""
242Run \`\033[1myum remove nodejs npm\033[22m\` (as root) to remove these first.\
243"
244 348
245fi 349fi
246 350
247# NOTE(mordred) Removed -y from the yum commands below. 351print_status """Run \`${bold}sudo yum install -y ${NODEPKG}${normal}\` to install ${NODENAME} and npm.
248print_status "\ 352## You may also need development tools to build native addons:
249Run \`\033[1myum install nodejs\033[22m\` (as root) to install Node.js 8.x and npm.\n\ 353 sudo yum install gcc-c++ make
250You may also need development tools to build native addons:\n\ 354## To install the Yarn package manager, run:
251 \`yum install gcc-c++ make\`\ 355 curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
252" 356 sudo yum install yarn
253 357"""
254## Alternative to install dev tools: `yum groupinstall 'Development Tools'
255 358
256exit 0 359exit 0
360
361}
362
363## Defer setup until we have the complete script
364setup
diff --git a/tools/install-js-tools.sh b/tools/install-js-tools.sh
index d65668c..d5c550e 100755
--- a/tools/install-js-tools.sh
+++ b/tools/install-js-tools.sh
@@ -25,7 +25,7 @@ if type apt-get; then
25 $SUDO apt-get install -y apt-transport-https curl gnupg2 25 $SUDO apt-get install -y apt-transport-https curl gnupg2
26 # Install recent NodeJS repo 26 # Install recent NodeJS repo
27 curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | $SUDO apt-key add - 27 curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | $SUDO apt-key add -
28 echo "deb https://deb.nodesource.com/node_8.x xenial main" | $SUDO tee /etc/apt/sources.list.d/nodesource.list 28 echo "deb https://deb.nodesource.com/node_10.x bionic main" | $SUDO tee /etc/apt/sources.list.d/nodesource.list
29 # Install yarn repo 29 # Install yarn repo
30 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | $SUDO apt-key add - 30 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | $SUDO apt-key add -
31 echo "deb https://dl.yarnpkg.com/debian/ stable main" | $SUDO tee /etc/apt/sources.list.d/yarn.list 31 echo "deb https://dl.yarnpkg.com/debian/ stable main" | $SUDO tee /etc/apt/sources.list.d/yarn.list
diff --git a/web/package.json b/web/package.json
index 97d1be9..9185ef5 100644
--- a/web/package.json
+++ b/web/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "name": "@zuul-ci/dashboard", 2 "name": "@zuul-ci/dashboard",
3 "version": "1.0.0", 3 "version": "1.0.0",
4 "description": "Web Dashboard for Zuul", 4 "description": "Zuul Web Dashboard",
5 "repository": "https://git.zuul-ci.org/zuul", 5 "repository": "https://git.zuul-ci.org/zuul",
6 "author": "Zuul Developers", 6 "author": "Zuul Developers",
7 "license": "Apache-2.0", 7 "license": "Apache-2.0",