blob: 01d88549905e528661ef9b549607688b6e77211d [file] [log] [blame]
Monty Taylor4a781a72017-07-25 07:28:04 -04001#!/bin/bash
2# Copyright 2017 Red Hat, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17if type apt-get; then
18 # Install https transport - otherwise apt-get HANGS on https urls
19 sudo apt-get update
20 sudo apt-get install apt-transport-https
21 # Install recent NodeJS repo
22 curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
23 echo "deb https://deb.nodesource.com/node_8.x xenial main" | sudo tee /etc/apt/sources.list.d/nodesource.list
24 # Install yarn repo
25 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
26 echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
27 sudo apt-get update
28 sudo DEBIAN_FRONTEND=noninteractive \
29 apt-get -q --option "Dpkg::Options::=--force-confold" --assume-yes \
30 install nodejs yarn
31else
32 sudo curl https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo
33 sudo $(dirname $0)/install-js-repos-rpm.sh
34 sudo yum -y install nodejs yarn
35fi