podman/contrib/cirrus/packer/fah_setup.sh
Ed Santiago 295c531ece cirrus lib.sh: refactor req_env_var()
Existing code was not working due to a bash gotcha ('exit'
from a pipeline). It also had unnecessary duplication.

New version is safer; also includes unit tests run under localunit.

Existing invocations of req_env_var replaced via:

   $ [ edit setup_environment.sh, move one closing quote to its own line ]
   $ perl -ni -e 's/(?<=req_env_var )"(\S+)\s+\$\1"/$1/; if (/req_env_var "$/ .. /^\s*"/) { chomp; s/(?<=\S)\s.*//; if (/^\s*"/) { print "\n" } else { unless (/req_env_var/) { s/^\s+//; print " ";} print;} } else { print }' $(ack -l req_env_var)
   $ [ hand-massage an incorrect instance of '@' in lib.sh:ircmsg() ]

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-05-02 08:14:59 -06:00

22 lines
430 B
Bash

#!/bin/bash
# This script is called by packer on the subject fah VM, to setup the podman
# build/test environment. It's not intended to be used outside of this context.
set -e
# Load in library (copied by packer, before this script was run)
source /tmp/libpod/$SCRIPT_BASE/lib.sh
req_env_var SCRIPT_BASE
install_ooe
ooe.sh sudo atomic host upgrade
ooe.sh sudo rpm-ostree uninstall cloud-init
rh_finalize
echo "SUCCESS!"