I currently have a development-production branch set up with my anvil app according to this tutorial: Anvil Docs | Apps in development and production
A client of mine would like to white label the app; they want a clone of the app with changes in logo and some design layout. We want to set a client-production branch for this client and any changes on the development branch can also be pushed to this client-production branch and the app on the client-production branch still have their design elements different from the development and production branch.
I’ve tried set up the client-production branch as a remote branch of the development branch but it doesnt work; changes in the client-production branch have to be in the development branch as well
How can I achieve the dev => prod, dev => client-prod set up?
Thanks a lot!
I don’t know if I really understand what you asked, but I usually want that my development branch opens different options for filtering in pages or show different pages, start in different forms, etc. and I think that is kind of the same your asking.
What I do is create both options and just display one if it’s currently executing from branch “dev” or the other if it’s published.
Exemple: The source for a image component could be bind to a property in the form called logo_source
that could be:
@property
def logo_source(self):
if app.branch == 'published':
return 'source_for_the_client-prod_image'
return 'sorce_for_the_development_image'
That’s what I usually do for opening different forms, showing options that should only be visible while developing / debugging, etc.
Be mindful that app.branch
refers to the branch used so "published"
could be another string for you. You could also use an elif to be more precise in which branch to show which image. There’s also the new app.environment
if you change branches but not the environment (requires at least Individual plan).
I don’t think there is an automatic way.
Every time you merge from dev
to prod
, you will need to merge from dev
to client-prod
(and to client2-prod
, client3-prod
, etc.)
You can also create two different apps that use a third app with the common core as a dependency.
1 Like