From c8bf32d0a99eb9622a2cb93bcb441cdecf052c05 Mon Sep 17 00:00:00 2001 From: John Wass Date: Thu, 29 Jun 2023 10:36:03 -0400 Subject: [PATCH] Move rawhide to fc39 (#881) Updates containers and ansible to properly consider fc39 as rawhide. Adds fc38 as a separate vagrant configuration. --- Containerfile | 2 +- Makefile | 4 +- scripts/vagrant/fc38/Vagrantfile | 70 +++++++++++++++++++++++++++++ scripts/vagrant/rawhide/Vagrantfile | 2 +- 4 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 scripts/vagrant/fc38/Vagrantfile diff --git a/Containerfile b/Containerfile index 672299db9..b51f827e5 100644 --- a/Containerfile +++ b/Containerfile @@ -1,4 +1,4 @@ -ARG image=registry.fedoraproject.org/fedora:38 +ARG image=registry.fedoraproject.org/fedora:39 FROM $image AS build-stage RUN dnf install -y rpm-build rpmdevtools dnf-plugins-core python3-pip nano diff --git a/Makefile b/Makefile index e2f0ec3d1..07aeaf016 100644 --- a/Makefile +++ b/Makefile @@ -135,8 +135,8 @@ check: header-check format lint test fc-rpm: @echo -e "${GRN}--- Fedora RPM generation...${NC}" make -f .copr/Makefile vendor OS_ID=fedora - podman build -t fapolicy-analyzer:38 -f Containerfile . - podman run --rm -it --network=none -v /tmp:/v fapolicy-analyzer:38 /v + podman build -t fapolicy-analyzer:39 -f Containerfile . + podman run --rm -it --network=none -v /tmp:/v fapolicy-analyzer:39 /v # Generate RHEL 8 rpms el8-rpm: diff --git a/scripts/vagrant/fc38/Vagrantfile b/scripts/vagrant/fc38/Vagrantfile new file mode 100644 index 000000000..a79d033d7 --- /dev/null +++ b/scripts/vagrant/fc38/Vagrantfile @@ -0,0 +1,70 @@ +# Copyright Concurrent Technologies Corporation 2021 +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Install any missing plugins +required_plugins = %w( vagrant-vbguest vagrant-proxyconf ) +plugins_to_install = required_plugins.select { |plugin| not Vagrant.has_plugin? plugin } +if not plugins_to_install.empty? + puts "Installing plugins: #{plugins_to_install.join(' ')}" + if system "vagrant plugin install #{plugins_to_install.join(' ')}" + exec "vagrant #{ARGV.join(' ')}" + else + abort "Installation of one or more plugins has failed. Aborting." + end +end + +Vagrant.configure("2") do |config| + config.vm.box = "alvistack/fedora-38" + config.vm.box_version = "20230625.0.0" + + config.ssh.forward_agent = true + config.ssh.forward_x11 = true + + config.vbguest.auto_update = false + config.vm.synced_folder ".", "/vagrant", disabled: true + config.vm.provider "virtualbox" do |vb| + vb.gui = false + vb.memory = "2048" + end + + rpm_url = ENV['rpm_url'] + + config.proxy.enabled = true + config.proxy.http = ENV['http_proxy'] + config.proxy.https = ENV['https_proxy'] + config.proxy.no_proxy = "localhost,127.0.0.1" + + env = "prod" + git_branch = "origin/master" + if ENV['ENV'] == 'dev' + if ENV['GIT_BRANCH'] + git_branch = ENV['GIT_BRANCH'] + end + env = "dev" + config.vbguest.auto_update = true + Dir.mkdir './.shared/' unless File.exists?('./.shared/') + config.vm.synced_folder "./.shared/", "/shared", type: "virtualbox" + config.vm.provision :docker + end + + config.vm.provision "ansible" do |ansible| + ansible.playbook = "../../demo/site.yml" + ansible.extra_vars = { + env: env, + git_branch: git_branch, + rpm_url: rpm_url + } + end +end diff --git a/scripts/vagrant/rawhide/Vagrantfile b/scripts/vagrant/rawhide/Vagrantfile index 7323e81a7..cf0b6d30f 100644 --- a/scripts/vagrant/rawhide/Vagrantfile +++ b/scripts/vagrant/rawhide/Vagrantfile @@ -27,7 +27,7 @@ end Vagrant.configure("2") do |config| config.vm.box = "alvistack/fedora-rawhide" - config.vm.box_version = "20220910.1.1" + config.vm.box_version = "20230618.1.1" config.ssh.forward_agent = true config.ssh.forward_x11 = true