Skip to content

Commit 21bdf2a

Browse files
committed
Paymeter: bump php to 8.4
1 parent 2551cb4 commit 21bdf2a

File tree

2 files changed

+41
-13
lines changed

2 files changed

+41
-13
lines changed

ct/paymenter.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,24 @@ function update_script() {
2828
msg_error "No ${APP} Installation Found!"
2929
exit
3030
fi
31+
CURRENT_PHP=$(php -v 2>/dev/null | awk '/^PHP/{print $2}' | cut -d. -f1,2)
32+
if [[ "$CURRENT_PHP" != "8.4" ]]; then
33+
msg_info "Migrating PHP $CURRENT_PHP to 8.4"
34+
$STD curl -fsSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
35+
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
36+
$STD sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
37+
$STD apt-get update
38+
$STD apt-get remove -y php"${CURRENT_PHP//./}"*
39+
$STD apt-get install -y \
40+
php8.4 \
41+
php8.4-{common,cli,gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm}
42+
msg_ok "Migrated PHP $CURRENT_PHP to 8.4"
43+
fi
3144
RELEASE=$(curl -fsSL https://api.github.com/repos/paymenter/paymenter/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
3245
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
3346
msg_info "Updating ${APP} to ${RELEASE}"
3447
echo "${RELEASE}" >/opt/${APP}_version.txt
35-
cd /opt/paymenter
48+
cd /opt/paymenter || exit
3649
$STD php artisan p:upgrade --no-interaction
3750
msg_ok "Updated Successfully"
3851
else
@@ -48,4 +61,4 @@ description
4861
msg_ok "Completed Successfully!\n"
4962
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
5063
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
51-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}"
64+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}"

install/paymenter-install.sh

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,36 @@ $STD apt-get install -y \
1919
software-properties-common \
2020
apt-transport-https \
2121
ca-certificates \
22-
gnupg \
23-
php8.2 \
24-
php8.2-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip} \
22+
gnupg2 \
2523
mariadb-server \
2624
nginx \
2725
redis-server
28-
$STD curl -fsSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2926
msg_ok "Installed Dependencies"
3027

28+
msg_info "Adding PHP8.4 Repository"
29+
$STD curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
30+
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
31+
$STD sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
32+
$STD apt-get update
33+
msg_ok "Added PHP8.4 Repository"
34+
35+
msg_info "Installing PHP"
36+
$STD apt-get remove -y php8.2*
37+
$STD apt-get install -y \
38+
php8.4 \
39+
php8.4-{common,cli,gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm}
40+
msg_info "Installed PHP"
41+
42+
msg_info "Installing Composer"
43+
$STD curl -fsSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
44+
msg_ok "Installed Composer"
45+
3146
msg_info "Installing Paymenter"
3247
RELEASE=$(curl -fsSL https://api.github.com/repos/paymenter/paymenter/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
33-
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
48+
echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt
3449
mkdir -p /opt/paymenter
35-
cd /opt/paymenter
36-
curl -fsSL "https://github.com/paymenter/paymenter/releases/download/${RELEASE}/paymenter.tar.gz" -o $(basename "https://github.com/paymenter/paymenter/releases/download/${RELEASE}/paymenter.tar.gz")
50+
cd /opt/paymenter || exit
51+
curl -fsSL "https://github.com/paymenter/paymenter/releases/download/${RELEASE}/paymenter.tar.gz" -o paymenter.tar.gz
3752
$STD tar -xzvf paymenter.tar.gz
3853
chmod -R 755 storage/* bootstrap/cache/
3954
msg_ok "Installed Paymenter"
@@ -47,10 +62,10 @@ mysql -u root -e "CREATE DATABASE $DB_NAME;"
4762
mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
4863
mysql -u root -e "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'localhost' WITH GRANT OPTION;"
4964
{
50-
echo "Paymenter Database Credentials"
51-
echo "Database: $DB_NAME"
52-
echo "Username: $DB_USER"
53-
echo "Password: $DB_PASS"
65+
echo "Paymenter Database Credentials"
66+
echo "Database: $DB_NAME"
67+
echo "Username: $DB_USER"
68+
echo "Password: $DB_PASS"
5469
} >>~/paymenter_db.creds
5570
cp .env.example .env
5671
$STD composer install --no-dev --optimize-autoloader --no-interaction

0 commit comments

Comments
 (0)