Skip to content

Commit

Permalink
Merge pull request #8526 from inverse-inc/fix/upgrade-from-before-14.1
Browse files Browse the repository at this point in the history
Add upgrade as easy to download latest upgrade rpm or deb file accord…
  • Loading branch information
JeGoi authored Feb 18, 2025
2 parents 7fd21c0 + 798e27c commit 270b3f9
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ variables:
script:
- ./${UPLOAD_DIR}/deploy-artifacts.sh packetfence-release
- ./${UPLOAD_DIR}/deploy-artifacts.sh packetfence-export
- ./${UPLOAD_DIR}/deploy-artifacts.sh packetfence-upgrade
- ./${UPLOAD_DIR}/deploy-artifacts.sh packetfence-ci-lib
tags:
- shell
Expand Down
31 changes: 31 additions & 0 deletions ci/lib/upload/deploy-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,36 @@ packetfence_release_deploy() {
done
}

# no deploy command because it's just a file
packetfence_upgrade_deploy() {
# EL
for release_name in $(ls $RPM_RESULT_DIR); do
src_dir="$RPM_RESULT_DIR/${release_name}"
dst_repo="$PUBLIC_REPO_BASE_DIR/RHEL$release_name"
dst_dir="$DEPLOY_USER@$DEPLOY_HOST:$dst_repo"
pf_upgrade_rpm_file=$(basename $(ls $src_dir/packetfence-upgrade*))
pf_upgrade_rpm_dest_name=${PF_UPGRADE_RPM_DEST_NAME:-"packetfence-upgrade-${PF_MINOR_RELEASE}.el${release_name}.noarch.rpm"}
declare -p src_dir dst_dir pf_upgrade_rpm_file pf_upgrade_rpm_dest_name

echo "scp (on port $DEPLOY_PORT): ${src_dir}/${pf_upgrade_rpm_file} -> ${dst_dir}/${pf_upgrade_rpm_dest_name}"
scp -P $DEPLOY_PORT "${src_dir}/${pf_upgrade_rpm_file}" "${dst_dir}/${pf_upgrade_rpm_dest_name}" \
|| die "scp failed"
done
# Deb
for release_name in $(ls $DEB_RESULT_DIR); do
src_dir="$DEB_RESULT_DIR/${release_name}"
dst_repo="$DEB_BASE_DIR/debian"
dst_dir="$DEPLOY_USER@$DEPLOY_HOST:$dst_repo"
pf_upgrade_deb_file=$(basename $(ls $src_dir/packetfence-upgrade*))
pf_upgrade_deb_dest_name=${PF_UPGRADE_DEB_DEST_NAME:-"packetfence-upgrade_${PF_MINOR_RELEASE}.deb"}
declare -p src_dir dst_dir pf_upgrade_deb_file pf_upgrade_deb_dest_name

echo "scp (on port $DEPLOY_PORT): ${src_dir}/${pf_upgrade_deb_file} -> ${dst_dir}/${pf_upgrade_deb_dest_name}"
scp -P $DEPLOY_PORT "${src_dir}/${pf_upgrade_deb_file}" "${dst_dir}/${pf_upgrade_deb_dest_name}" \
|| die "scp failed"
done
}

# no deploy command because it's just a file
packetfence_export_deploy() {
# EL
Expand Down Expand Up @@ -205,6 +235,7 @@ case $1 in
deb) deb_deploy ;;
packetfence-release) packetfence_release_deploy ;;
packetfence-export) packetfence_export_deploy ;;
packetfence-upgrade) packetfence_upgrade_deploy ;;
packetfence-ci-lib) packetfence_ci_lib_deploy ;;
ppa) ppa_deploy ;;
website) website_deploy ;;
Expand Down
22 changes: 6 additions & 16 deletions docs/PacketFence_Upgrade_Guide.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -779,26 +779,16 @@ If the previous installation was a cluster, some steps may not be required. The
=== Pre-automation Upgrade Standalone RedHat EL8
Please follow these command lines in order to upgrade database.
Please follow these command line BEFORE starting the full automation upgrade.
.RHEL / CentOS based systems **only**
[source,bash]
----
yum clean all --enablerepo=packetfence
yum update --enablerepo=packetfence
systemctl stop monit
systemctl disable monit
/usr/local/pf/bin/pfcmd service pf stop
systemctl stop packetfence-mariadb
rpm -e --nodeps MariaDB-server
rpm -e --nodeps MariaDB-client
yum localinstall -y https://www.packetfence.org/downloads/PacketFence/RHEL8/14.1/x86_64/RPMS/MariaDB-client-10.11.6-1.el8.x86_64.rpm
yum localinstall -y https://www.packetfence.org/downloads/PacketFence/RHEL8/14.1/x86_64/RPMS/galera-4-26.4.16-1.el8.x86_64.rpm
yum localinstall -y https://www.packetfence.org/downloads/PacketFence/RHEL8/14.1/x86_64/RPMS/MariaDB-server-10.11.6-1.el8.x86_64.rpm
yum localinstall -y https://www.packetfence.org/downloads/PacketFence/RHEL8/14.1/x86_64/RPMS/freeradius-mysql-3.2.6-1.el8.x86_64.rpm
systemctl start packetfence-mariadb
mysql_upgrade -p
addons/upgrade/do-upgrade.sh
yum localinstall https://www.packetfence.org/downloads/PacketFence/RHEL8/packetfence-upgrade-14.1.el8.noarch.rpm
----
Then follow the standard <<PacketFence_Upgrade_Guide.asciidoc#_full_upgrade_for_packetfence_versions_11_1_0_and_later,Full upgrade>>.
=== Pre-automation Upgrade Cluster RedHat EL8
It is the same as <<PacketFence_Upgrade_Guide.asciidoc#_performing_an_upgrade_on_a_cluster>>
Expand Down

0 comments on commit 270b3f9

Please sign in to comment.