Skip to content

Commit

Permalink
OnBoarding fix nodejs installation (#3502)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertomonteromiguel authored Nov 21, 2024
1 parent 1df7344 commit 6c4ddd1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion utils/_context/_scenarios/auto_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def __init__(
include_ubuntu_22_arm64=True,
include_ubuntu_23_04_amd64=True,
include_ubuntu_23_04_arm64=True,
include_ubuntu_23_10_amd64=True,
include_ubuntu_23_10_amd64=False,
include_ubuntu_23_10_arm64=True,
include_ubuntu_24_amd64=True,
include_ubuntu_24_arm64=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,26 @@
echo "After stop updates. System service apt-daily.service status"
sudo systemctl list-units --all apt-daily.service || true

#There are some old machines that need to change the repositories because there are not available anymore
lsb_release=/etc/lsb-release
must_update_repositories="false"
if [ -e "$lsb_release" ]; then
if grep -q 'Ubuntu 21.04' "$lsb_release"; then
echo "Configuring ubuntu 21.04 repositories"
sudo sed -i -r 's/ports.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo sed -i -r 's/ubuntu-ports/ubuntu/g' /etc/apt/sources.list
sudo sed -i -r 's/us-east-1.ec2.//g' /etc/apt/sources.list
echo 'apt_preserve_sources_list: true' | sudo tee -a /etc/cloud/cloud.cfg
sudo apt-get update
must_update_repositories="true"
elif grep -q 'Ubuntu 23.10' "$lsb_release"; then
#Why this works for arm machine but not for amd64?
must_update_repositories="true"
fi
fi
if [ "$must_update_repositories" == "true" ]; then
echo "Configuring archive ubuntu repositories"
sudo sed -i -r 's/ports.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo sed -i -r 's/ubuntu-ports/ubuntu/g' /etc/apt/sources.list
sudo sed -i -r 's/us-east-1.ec2.//g' /etc/apt/sources.list
echo 'apt_preserve_sources_list: true' | sudo tee -a /etc/cloud/cloud.cfg
sudo apt-get update
fi

sudo apt-get -y update

#Install some basic tools (microvm doesn't have them by default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lang_variant:
install:
- os_type: linux
os_distro: deb
remote-command: sudo apt-get install -y nodejs
remote-command: sudo apt-get update && sudo apt-get install -y nodejs

- os_type: linux
os_distro: rpm
Expand Down Expand Up @@ -47,9 +47,7 @@ weblog:
#centos 7: node 16
#rhel_7_amd64: I can't isntall in a standard way
#amazon_linux2: Using the amazon-linux-extras - Error: Package: 1:nodejs-16.20.2-1.el7.x86_64 (epel)
#ubuntu 23.04 arm. nodejs package not found
excluded_os_branches: [ubuntu22_amd64, ubuntu22_arm64, ubuntu21, ubuntu20_arm64, ubuntu20_amd64, centos_7_amd64, rhel_7_amd64, amazon_linux2]
excluded_os_names: [Ubuntu_23_04_arm64]

install:
- os_type: linux
Expand Down

0 comments on commit 6c4ddd1

Please sign in to comment.