Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: enhance the script, to install leapp-repositoriy from Git #110

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions ci/scripts/install_elevate_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ WORK_DIR="$HOME"
NEW_LEAPP_NAME="leapp-repository-$BRANCH"
NEW_LEAPP_DIR="$WORK_DIR/$NEW_LEAPP_NAME/"
LEAPP_PATH='/usr/share/leapp-repository/repositories/'
LEAPP_GPG_PATH='/etc/leapp/repos.d/system_upgrade/common/files/rpm-gpg'
EXCLUDE_PATH='
/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/files/bundled-rpms
/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/files
Expand All @@ -56,6 +57,11 @@ echo "RHEL_MAJOR_VERSION=$RHEL_MAJOR_VERSION"
echo "WORK_DIR=$WORK_DIR"
echo "EXCLUDED_PATHS=$EXCLUDE_PATH"

echo "Preserve GPG keys if any"
for major in 8 9; do
test -e ${LEAPP_GPG_PATH}/${major} && mv ${LEAPP_GPG_PATH}/${major} ${WORK_DIR}/
done


echo 'Remove old files'
for dir in $(find $LEAPP_PATH -type d);
Expand All @@ -73,8 +79,8 @@ do
fi
done

echo "Download new tarball from https://github.com/$USER/leapp-repository/archive/$BRANCH/leapp-repository-$BRANCH.tar.gz"
curl -s -L https://github.com/$USER/leapp-repository/archive/$BRANCH/leapp-repository-$BRANCH.tar.gz | tar -xz -C $WORK_DIR/
echo "Download new tarball from https://github.com/$USER/leapp-repository/archive/$BRANCH/leapp-repository-$BRANCH.tar.gz"
curl -s -L https://github.com/$USER/leapp-repository/archive/$BRANCH/leapp-repository-$BRANCH.tar.gz | tar -xmz -C $WORK_DIR/ || exit 1

echo 'Deleting files as in spec file'
rm -rf $NEW_LEAPP_DIR/repos/common/actors/testactor
Expand All @@ -89,15 +95,23 @@ else
fi

echo 'Copy new data to system'
cp -r $NEW_LEAPP_DIR/repos/* $LEAPP_PATH
cp -r $NEW_LEAPP_DIR/repos/* $LEAPP_PATH || exit 1

for DIRECTORY in $(find $LEAPP_PATH -mindepth 1 -maxdepth 1 -type d);
do
REPOSITORY=$(basename $DIRECTORY)
if ! [ -e /etc/leapp/repos.d/$REPOSITORY ];then
echo "Enabling repository $REPOSITORY"
ln -s $LEAPP_PATH/$REPOSITORY /etc/leapp/repos.d/$REPOSITORY
ln -s $LEAPP_PATH/$REPOSITORY /etc/leapp/repos.d/$REPOSITORY || exit 1
fi
done

echo "Restore GPG keys if any"
for major in 8 9; do
rm -rf ${LEAPP_GPG_PATH}/${major}
test -e ${WORK_DIR}/${major} && mv ${WORK_DIR}/${major} ${LEAPP_GPG_PATH}/
done

rm -rf $NEW_LEAPP_DIR

exit 0
Loading