From afb97e0a895fec0af34494da3514188ba7670d72 Mon Sep 17 00:00:00 2001 From: Glenn Date: Thu, 2 Nov 2023 16:55:29 +0100 Subject: [PATCH] fix: split vagrant provisioning into multiple parts --- Vagrantfile | 2 +- scripts/vagrant-provision/base.sh | 32 ++++++++++++++++ .../build.sh} | 38 ------------------- scripts/vagrant-provision/recording.sh | 22 +++++++++++ 4 files changed, 55 insertions(+), 39 deletions(-) create mode 100644 scripts/vagrant-provision/base.sh rename scripts/{vagrant.provision.sh => vagrant-provision/build.sh} (52%) create mode 100644 scripts/vagrant-provision/recording.sh diff --git a/Vagrantfile b/Vagrantfile index d5596e1..6ea27b7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -30,5 +30,5 @@ Vagrant.configure('2') do |config| machine.vm.network 'forwarded_port', guest: 80, host: 1080, host_ip: '127.0.0.1' end - config.vm.provision 'shell', path: 'scripts/vagrant.provision.sh' + config.vm.provision 'shell', path: 'scripts/vagrant-provision/base.sh' end diff --git a/scripts/vagrant-provision/base.sh b/scripts/vagrant-provision/base.sh new file mode 100644 index 0000000..4a0d514 --- /dev/null +++ b/scripts/vagrant-provision/base.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +set -e +set -u + +USER="$(test -d /vagrant && echo "vagrant" || echo "debian")" +HOSTNAME="$(hostname)" + +export DEBIAN_FRONTEND=noninteractive + +echo "Installing required system packages" +apt-get update --allow-releaseinfo-change +apt-get install -y \ + apt-transport-https \ + ca-certificates \ + git \ + curl \ + wget \ + vim \ + gnupg2 \ + software-properties-common + +# echo "Installing mfm requirements" +# apt-get install -y \ +# fzf \ +# sshfs \ +# httpdirfs \ +# libyaml-0-2 \ +# libyaml-dev \ +# libpcre3-dev \ +# libevent-dev + diff --git a/scripts/vagrant.provision.sh b/scripts/vagrant-provision/build.sh similarity index 52% rename from scripts/vagrant.provision.sh rename to scripts/vagrant-provision/build.sh index a074a0a..6317e22 100644 --- a/scripts/vagrant.provision.sh +++ b/scripts/vagrant-provision/build.sh @@ -9,26 +9,6 @@ HOSTNAME="$(hostname)" export DEBIAN_FRONTEND=noninteractive -echo "Installing required system packages" -apt-get update --allow-releaseinfo-change -apt-get install -y \ - apt-transport-https \ - ca-certificates \ - git \ - curl \ - wget \ - vim \ - gnupg2 \ - software-properties-common - -echo "Installing recording requirements" -apt-get install -y \ - tmux \ - mdp \ - bat \ - asciinema \ - termtosvg - echo "Installing mfm requirements" apt-get install -y \ fzf \ @@ -39,24 +19,6 @@ apt-get install -y \ libpcre3-dev \ libevent-dev -#!/bin/sh - -set -e -set -u - -USER="$(test -d /vagrant && echo "vagrant" || echo "debian")" -CLUSTERS_DIR=/home/$USER/clusters - -# Installation de kompose -if [ ! -f /usr/local/bin/kompose ]; then - DL="$(mktemp)" - curl \ - -L https://github.com/kubernetes/kompose/releases/download/v1.22.0/kompose-linux-amd64 \ - -o "$DL" - chmod +x "$DL" - mv "$DL" /usr/local/bin/kompose -fi - # Installing asdf su - "$USER" -c "git config --global advice.detachedHead false" su - "$USER" -c "rm -rf ~/.asdf" diff --git a/scripts/vagrant-provision/recording.sh b/scripts/vagrant-provision/recording.sh new file mode 100644 index 0000000..416b802 --- /dev/null +++ b/scripts/vagrant-provision/recording.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# install crystal +set -e +set -u + +USER="$(test -d /vagrant && echo "vagrant" || echo "debian")" +HOSTNAME="$(hostname)" + +export DEBIAN_FRONTEND=noninteractive + +echo "Installing required system packages" +apt-get update --allow-releaseinfo-change + +echo "Installing recording requirements" +apt-get install -y \ + tmux \ + mdp \ + bat \ + asciinema \ + termtosvg +