Best way to preserve custom portal

Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:23:53 +0000.
Sender:Tor Inge Skaar.
Date:Wednesday, 16 September 2015 10:03:40 UTC+1.

I have an issue where my customized portal templates are overwritten when upgrading Tyk-Analytics. This happens because apt is upgrading it automatically from an internal repo.

I tried having my own customized template files being prefixed with, in my case, my org slug. But having multiple files in the templates directory defining “indexPage” makes Tyk Analytics crash when trying to start.

I could change the preinst script of the debian package of Tyk-Analytics to backup existing templates when doing upgrades and then restore them in the postinst script, but this feels like a dirty hack…

Any suggestions?

Thanks
Tor Inge Skaar

Imported Google Group message.
Sender:Martin Buhr.
Date:Wednesday, 16 September 2015 10:55:31 UTC+1.

Maybe overload the folder using a file mount?

I.e. put your custom templates into /var/tyk_templates
Then mount that into your Tyk Dashboard install dir to override the templates/portal folder with the one containing your custom files.
On install, unmount the folder, do the install, and remount it.

Saves you having to mess with file copies and backups, it seems to work ok (i think this is what docker does when it mounts external volumes into the container):

~ $ mkdir orig && touch ~/orig/iamhere
~ $ ls orig/
iamhere

~ $ mkdir override && touch ~/override/no-iamhere
~ $ sudo mount -o bind ~/override ~/orig
~ $ ls orig/
no-iamhere

~ $ sudo umount ~/orig
~ $ ls orig
iamhere

Maybe easier?

Cheers,
Martin

Imported Google Group message.
Sender:Tor Inge Skaar.
Date:Wednesday, 16 September 2015 11:59:36 UTC+1.

Thanks, I give that a try.

Tor

  • show quoted text -