forked from redhat-openshift-ecosystem/openshift-preflight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
41 lines (38 loc) · 1.48 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Vagrant.configure("2") do |config|
config.vm.box = "generic/fedora36"
config.vm.synced_folder ".", "/home/vagrant/preflight"
config.vm.network :forwarded_port, guest: 22, host: 2322, id: "ssh"
config.vm.provision "shell", inline: <<-SHELL
dnf -y update
dnf -y install \
podman \
buildah \
jq \
make \
bats \
device-mapper-devel \
glib2-devel \
libassuan-devel \
libseccomp-devel \
git \
bzip2 \
go-md2man \
runc \
crun \
containers-common \
openscap-containers
curl -L https://go.dev/dl/go1.21.3.linux-amd64.tar.gz --output go1.21.3.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.3.linux-amd64.tar.gz
rm go1.21.3.linux-amd64.tar.gz
curl -L https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz --output oc.tar.gz
tar -C /usr/local/bin -xzf oc.tar.gz
rm oc.tar.gz
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.33.0
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
chmod +x operator-sdk_${OS}_${ARCH} && sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk
echo "PATH=/usr/local/go/bin:$PATH" >> /home/vagrant/.bashrc
echo "PATH=/usr/local/go/bin:$PATH" >> /root/.bashrc
SHELL
end