Skip to content

Commit

Permalink
fix(portal): do not overwrite portal config file during upgrade
Browse files Browse the repository at this point in the history
How to test the fix:

Using the terraform code from PR
#24:

* build local RPMs for two versions:

----
cd apim/4.x/
mkdir -p rpms/4.{3.1,4.3}
./build.sh -v 4.3.1
rm graviteeio-apim-4x-4.3.1-1.noarch.rpm
mv *.rpm rpms/4.3.1/
./build.sh -v 4.4.3
rm graviteeio-apim-4x-4.4.3-1.noarch.rpm
mv *.rpm rpms/4.4.3/
----

* then run a redhat 9 VM in Azure:

----
cd ../../test/terraform_linux_vm/redhat
export TF_VAR_allowed_ips="$(curl -s 'https://ipv4.seeip.org')"
export TF_VAR_username=graviteeio
terraform apply -auto-approve
----

* copy your local RPMs to the remote machine following connexion instruction as output from terraform

----
scp ... -r ../../../apim/4.x/rpms graviteeio@<VM ip>:.
----

* connect to the VM with ssh following instruction from terraform output and get into current tmux session

----
ssh .... graviteeio@<VM ip>
tmux attach
----

* install first version of built RPMs:

----
./install_redhat_graviteeio.sh install_graviteeio_from_local_rpms rpms/4.3.1/
----

* check that APIM works as expected:
** from the remote machine via ./install_redhat_graviteeio.sh test_graviteeio
** by using SSH tunnet from your browser in http://localhost:8084/ for the console (user/pass == admin/admin) and to the portal with http://localhost:8085/
* do the upgrade in VM:

----
for rpm in rpms/4.4.3/*.rpm; do sudo yum upgrade -y "${rpm}"; done
sudo systemctl daemon-reload
sudo systemctl restart graviteeio-apim-gateway graviteeio-apim-rest-api
sleep 45 #wait backend start
sudo systemctl restart nginx
----

* check again that console and portal continue to work as expected.

Note, the reproduce the issue, rather than local RPM install, do:

----
./install_redhat_graviteeio.sh install_graviteeio_from_repository 4.3.1
----

check all good and then:

----
sudo yum upgrade -y "graviteeio-apim-4x-4.4.3"
sudo systemctl daemon-reload
sudo systemctl restart graviteeio-apim-gateway graviteeio-apim-rest-api
sleep 45 #wait backend start
sudo systemctl restart nginx
----

Now console still works, but portal is broken.

TT-4996
APIM-6148
  • Loading branch information
passionne committed Aug 1, 2024
1 parent 494346e commit 4852e01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apim/4.x/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ build_portal_ui() {
--url "${URL}" \
--description "${DESC}: Portal UI" \
--depends nginx \
--config-files "${TEMPLATE_DIR}/opt/graviteeio/apim/graviteeio-apim-portal-ui/assets/" \
--config-files "/opt/graviteeio/apim/graviteeio-apim-portal-ui/assets/config.json" \
--verbose \
-n ${PKGNAME}-portal-ui-4x
}
Expand Down

0 comments on commit 4852e01

Please sign in to comment.