@@ -10,14 +10,50 @@ pushd $repodir
10
10
11
11
arch=$( uname -m)
12
12
if [[ $arch == ' x86_64' ]]; then
13
- shortarch=' x86 '
13
+ shortarch=' x64 '
14
14
else
15
15
shortarch=$arch
16
16
fi
17
17
if [[ $( uname -s) == ' Linux' ]]; then
18
18
os=linux
19
19
installer=' sudo yum -y'
20
20
shellrc=' .bashrc'
21
+ if [ -f /etc/os-release ]; then
22
+ . /etc/os-release
23
+ case " $ID -$VERSION_ID " in
24
+ " amzn-2" * )
25
+ echo " error: Unsupported OS $( uname -s) "
26
+ return 1
27
+ ;;
28
+ " centos-7" * )
29
+ echo " error: Unsupported OS $( uname -s) "
30
+ return 1
31
+ ;;
32
+ " centos-8" * )
33
+ echo " error: Unsupported OS $( uname -s) "
34
+ return 1
35
+ ;;
36
+ " rhel-7" * )
37
+ echo " error: Unsupported OS $( uname -s) "
38
+ return 1
39
+ ;;
40
+ " rhel-8" * )
41
+ distro=" rhel8"
42
+ ;;
43
+ " rhel-9" * )
44
+ distro=" rhel9"
45
+ ;;
46
+ " rocky-8" * )
47
+ distro=" rocky8"
48
+ ;;
49
+ " rocky-9" * )
50
+ distro=" rocky9"
51
+ ;;
52
+ esac
53
+ else
54
+ echo " error: Unsupported OS $( uname -s) "
55
+ return 1
56
+ fi
21
57
elif [[ $( uname -s) == ' Darwin' ]]; then
22
58
os=macos
23
59
installer=' brew'
@@ -61,12 +97,7 @@ echo "Using python $python_version"
61
97
62
98
# Check nodejs version
63
99
# https://nodejs.org/en/about/previous-releases
64
- if [[ $os == ' macos' ]]; then
65
- required_nodejs_version=20.19.0
66
- else
67
- # linux
68
- required_nodejs_version=16.20.2
69
- fi
100
+ required_nodejs_version=20.19.0
70
101
# required_nodejs_version=18.20.2
71
102
# On Amazon Linux 2 and nodejs 18.20.2 I get the following errors:
72
103
# node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
@@ -107,7 +138,10 @@ if [[ $nodejs_version != $required_nodejs_version ]]; then
107
138
nodedir=node-v${required_nodejs_version} -darwin-${shortarch}
108
139
fi
109
140
tarball=${nodedir} .tar.xz
110
- wget https://nodejs.org/dist/v${required_nodejs_version} /$tarball
141
+ if ! wget https://nodejs.org/dist/v${required_nodejs_version} /$tarball ; then
142
+ echo " error: Couldn't download nodejs from https://nodejs.org/dist/v${required_nodejs_version} /$tarball ."
143
+ return 1
144
+ fi
111
145
tar -xf $tarball
112
146
rm $tarball
113
147
cat >> ~ /$shellrc << EOF
@@ -117,6 +151,7 @@ export PATH=$HOME/$nodedir/bin:\$PATH
117
151
EOF
118
152
source ~ /$shellrc
119
153
popd
154
+ nodejs_version=$required_nodejs_version
120
155
fi
121
156
122
157
echo " Using nodejs version $nodejs_version "
@@ -138,6 +173,7 @@ if [[ $cdk_version != $CDK_VERSION ]]; then
138
173
if ! npm install -g --force aws-cdk@$CDK_VERSION ; then
139
174
sudo npm install -g --force aws-cdk@$CDK_VERSION
140
175
fi
176
+ cdk_version=$CDK_VERSION
141
177
fi
142
178
echo " Using CDK $cdk_version "
143
179
0 commit comments