Skip to content

Commit

Permalink
Parametrize Archivematica version in test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
replaceafill committed Oct 9, 2024
1 parent 2b7e6d5 commit 0c9756d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
18 changes: 10 additions & 8 deletions tests/archivematica/EL9/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ function get_env_boolean() {

search_enabled=$(get_env_boolean "SEARCH_ENABLED" "true")
local_repository=$(get_env_boolean "LOCAL_REPOSITORY" "false")
am_version=${AM_VERSION:-1.17}
am_packages_url="https://packages.archivematica.org/${am_version}.x"

echo "~~~~~~~~ DEBUG ~~~~~~~~~~~~~~~~~~~~~~~~~~~"
while read -r line; do echo "$line=${!line}"; done < <(compgen -v | grep -v '[^[:lower:]_]' | grep -v '^_$')
Expand All @@ -35,32 +37,32 @@ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
#

if [ "${local_repository}" == "true" ] ; then
sudo -u root bash -c 'cat << EOF > /etc/yum.repos.d/archivematica.repo
sudo -u root bash -c "cat << EOF > /etc/yum.repos.d/archivematica.repo
[archivematica]
name=archivematica
baseurl=file:///am-packbuild/rpms/EL9/_yum_repository/
enabled=1
gpgcheck=0
EOF'
EOF"
else
sudo -u root bash -c 'cat << EOF > /etc/yum.repos.d/archivematica.repo
sudo -u root bash -c "cat << EOF > /etc/yum.repos.d/archivematica.repo
[archivematica]
name=archivematica
baseurl=https://packages.archivematica.org/1.17.x/rocky9
baseurl=${am_packages_url}/rocky9
gpgcheck=1
gpgkey=https://packages.archivematica.org/GPG-KEY-archivematica-sha512
enabled=1
EOF'
EOF"
fi

sudo -u root bash -c 'cat << EOF >> /etc/yum.repos.d/archivematica-extras.repo
sudo -u root bash -c "cat << EOF >> /etc/yum.repos.d/archivematica-extras.repo
[archivematica-extras]
name=archivematica-extras
baseurl=https://packages.archivematica.org/1.17.x/rocky9-extras
baseurl=${am_packages_url}/rocky9-extras
gpgcheck=1
gpgkey=https://packages.archivematica.org/GPG-KEY-archivematica-sha512
enabled=1
EOF'
EOF"

sudo -u root yum update -y
sudo -u root yum install -y epel-release policycoreutils-python-utils yum-utils
Expand Down
9 changes: 6 additions & 3 deletions tests/archivematica/jammy/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ function get_env_boolean() {

search_enabled=$(get_env_boolean "SEARCH_ENABLED" "true")
local_repository=$(get_env_boolean "LOCAL_REPOSITORY" "false")
am_version=${AM_VERSION:-1.17}
am_packages_url="https://packages.archivematica.org/${am_version}.x"
am_keyring_path="/etc/apt/keyrings/archivematica-${am_version}.x.gpg"

echo "~~~~~~~~ DEBUG ~~~~~~~~~~~~~~~~~~~~~~~~~~~"
while read -r line; do echo "$line=${!line}"; done < <(compgen -v | grep -v '[^[:lower:]_]' | grep -v '^_$')
Expand All @@ -39,15 +42,15 @@ sudo debconf-set-selections <<< "archivematica-mcp-server archivematica-mcp-serv
sudo debconf-set-selections <<< "archivematica-mcp-server archivematica-mcp-server/mysql/app-pass password demo-am"
sudo debconf-set-selections <<< "archivematica-mcp-server archivematica-mcp-server/app-password-confirm password demo-am"

curl -fsSL https://packages.archivematica.org/1.17.x/key.asc | sudo gpg --dearmor -o /etc/apt/keyrings/archivematica-1.17.x.gpg
sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/archivematica-1.17.x.gpg] http://packages.archivematica.org/1.17.x/ubuntu-externals jammy main" > /etc/apt/sources.list.d/archivematica-externals.list'
curl -fsSL "${am_packages_url}/key.asc" | sudo gpg --dearmor -o "${am_keyring_path}"
sudo sh -c "echo 'deb [arch=amd64 signed-by=${am_keyring_path}] ${am_packages_url}/ubuntu-externals jammy main' > /etc/apt/sources.list.d/archivematica-externals.list"

if [ "${local_repository}" == "true" ] ; then
sudo -u root bash -c 'cat << EOF > /etc/apt/sources.list.d/archivematica.list
deb file:/am-packbuild/debs/jammy/_deb_repository ./
EOF'
else
sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/archivematica-1.17.x.gpg] http://packages.archivematica.org/1.17.x/ubuntu jammy main" > /etc/apt/sources.list.d/archivematica.list'
sudo sh -c "echo 'deb [arch=amd64 signed-by=${am_keyring_path}] ${am_packages_url}/ubuntu jammy main' > /etc/apt/sources.list.d/archivematica.list"
fi

sudo apt-get -o Acquire::AllowInsecureRepositories=true update
Expand Down

0 comments on commit 0c9756d

Please sign in to comment.