Parcourir la source

Upgrade nodejs to the new LTS

Bob Mottram il y a 7 ans
Parent
révision
adb038143d
2 fichiers modifiés avec 16 ajouts et 4 suppressions
  1. 1
    0
      src/freedombone-upgrade
  2. 15
    4
      src/freedombone-utils-nodejs

+ 1
- 0
src/freedombone-upgrade Voir le fichier

@@ -97,6 +97,7 @@ if [ -d "$PROJECT_DIR" ]; then
97 97
         fi
98 98
 
99 99
         #rebuild_exim_with_socks
100
+        nodejs_upgrade
100 101
         apt-get -yq -t stretch-backports install certbot
101 102
         email_install_tls
102 103
         email_disable_chunking

+ 15
- 4
src/freedombone-utils-nodejs Voir le fichier

@@ -35,9 +35,9 @@ VARIANTS='mesh'
35 35
 
36 36
 # change these versions at your peril. Things will often crash if you don't
37 37
 # have specifically the correct versions
38
-NODEJS_VERSION='6.11.4'
38
+NODEJS_VERSION='8.11.1'
39 39
 NODEJS_N_VERSION='2.1.7'
40
-NPM_VERSION='4.0.5'
40
+NPM_VERSION='5.6.0'
41 41
 
42 42
 # This file keeps track of the apps needing nodejs
43 43
 # so that it can be removed if tere are no apps which need it
@@ -75,8 +75,8 @@ function mesh_install_nodejs {
75 75
         exit 6389252
76 76
     fi
77 77
     $mesh_install_nodejs_prefix apt-key add /root/node.gpg.key
78
-    echo "deb https://deb.nodesource.com/node_6.x stretch main" > "$rootdir/etc/apt/sources.list.d/nodesource.list"
79
-    echo "deb-src https://deb.nodesource.com/node_6.x stretch main" >> "$rootdir/etc/apt/sources.list.d/nodesource.list"
78
+    echo "deb https://deb.nodesource.com/node_8.x stretch main" > "$rootdir/etc/apt/sources.list.d/nodesource.list"
79
+    echo "deb-src https://deb.nodesource.com/node_8.x stretch main" >> "$rootdir/etc/apt/sources.list.d/nodesource.list"
80 80
 
81 81
     $mesh_install_nodejs_prefix apt-mark -q unhold nodejs
82 82
     $mesh_install_nodejs_prefix apt-get update
@@ -159,6 +159,17 @@ EOF
159 159
     rm "$rootdir/usr/bin/test_nodejs_install"
160 160
 }
161 161
 
162
+function nodejs_upgrade {
163
+    if [ ! -f /etc/apt/sources.list.d/nodesource.list ]; then
164
+        return
165
+    fi
166
+    if grep -q "node_8.x" /etc/apt/sources.list.d/nodesource.list; then
167
+        return
168
+    fi
169
+    rootdir=
170
+    mesh_install_nodejs
171
+}
172
+
162 173
 function remove_nodejs {
163 174
     if [ ! "$1" ]; then
164 175
         return