~bayindirh/vagrant-machines

cf9110e4e851ffd7b59844672ae9e253124aa2a1 — Hakan Bayindir 6 months ago f43f5f6 master
proj: Update ubuntu20.04 InvenioRDM VM.

This commit updates ubuntu20.04-inveniordm-development VM to up to date and makes it compatible with latest installation procedures.
2 files changed, 27 insertions(+), 25 deletions(-)

A CHANGELOG.md
M ubuntu20.04-inveniordm-development/Vagrantfile
A CHANGELOG.md => CHANGELOG.md +6 -0
@@ 0,0 1,6 @@
# vagrant-machines Changelog

**Note:** Please add newest entries on top. Use ISO date format YYYY-MM-DD and markdown formatting.

## 20240301
- feat: Update `ubuntu20.04-inveniordm-development` to be compatible with current InvenioRDM installation.

M ubuntu20.04-inveniordm-development/Vagrantfile => ubuntu20.04-inveniordm-development/Vagrantfile +21 -25
@@ 77,56 77,52 @@ Vagrant.configure(2) do |config|
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
   config.vm.provision "shell", inline: <<-SHELL
    # REMEMBER: You're root user at this point.

    # Let's do some exporting to make scripting easier.
    export DEBIAN_FRONTEND=noninteractive
    
    # Update repositiories before installing anything.
    DEBIAN_FRONTEND=noninteractive apt-get update
    apt-get update

    # Update system to latest packages.
    DEBIAN_FRONTEND=noninteractive apt-get --yes dist-upgrade
    apt-get --yes dist-upgrade

    # Then install the basic packages that we need to work comfortably.
    DEBIAN_FRONTEND=noninteractive apt-get install --yes vim git screen ncftp mc build-essential linux-headers-generic curl dkms
    apt-get install --yes vim git screen ncftp mc build-essential linux-headers-generic curl dkms

    # We need python3-pip to get pip3. It's not installed out of the box.
    # We're also adding some python3 development libraries since we need it.
    DEBIAN_FRONTEND=noninteractive apt-get install --yes python3-pip python3-dev libpython3-dev 
    apt-get install --yes python3-pip python3-dev libpython3-dev 
 
    # We need libcairo2 for developing invenio, so let's install it.
    DEBIAN_FRONTEND=noninteractive apt-get install --yes libcairo2
    apt-get install --yes libcairo2

    # Install pipenv to the vagrant user's environment. We're going to need that.
    sudo --non-interactive --set-home --user vagrant -- pip3 install --user --no-warn-script-location pipenv

    # Next, install the docker engine (CE version).
    # Note: The process skips the packages already installed at this point.
    DEBIAN_FRONTEND=noninteractive apt-get install --yes apt-transport-https gnupg-agent
    apt-get install --yes apt-transport-https gnupg-agent

    # Add Docker's GPG key to the system.
    curl --fail --silent --show-error --location https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    apt-get update
    install -m 0755 -d /etc/apt/keyrings
    curl --fail --silent --show-error --location https://download.docker.com/linux/ubuntu/gpg --output /etc/apt/keyrings/docker.asc
    chmod a+r /etc/apt/keyrings/docker.asc

    # Add Docker's Ubuntu repository to the system.
    add-apt-repository --yes --update "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    # Add the repository to Apt sources:
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

    # Let's update the indexes and get the packages.
    DEBIAN_FRONTEND=noninteractive apt-get update
    DEBIAN_FRONTEND=noninteractive apt-get install --yes docker-ce docker-ce-cli containerd.io
    # Install Docker.
    apt-get update
    apt-get install --yes docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

    # Enable docker service and start it.
    # Enable Docker service and start it.
    systemctl enable docker --now

    # Add vagrant user to docker group so it can use docker too.
    usermod --append --groups docker vagrant

    # Also install docker-compose. It's required.
    curl --fail --silent --show-error --location "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" --output /usr/local/bin/docker-compose
    chmod --change +x /usr/local/bin/docker-compose

    # Install the node 14.x from NodeSoruce binary distribution.
    curl --fail --silent --show-error --location "https://deb.nodesource.com/setup_14.x" | bash -
    DEBIAN_FRONTEND=noninteractive apt-get install --yes nodejs
    
    # Downloading and installing things have ended, clean the downloaded packages.
    DEBIAN_FRONTEND=noninteractive apt-get clean

    # Install invenio-cli to the user, so everything is ready to develop.
    # --no-warn-script-location is used since it's a false warning (due to sudo)
    cd /home/vagrant