[GeoNode-devel] Practices on maintaining a geonode project, PR: "Align to GeoNode master 4.2.0"

Giovanni Allegri giovanni.allegri at geosolutionsgroup.com
Tue Aug 8 02:18:56 PDT 2023


Toni, would you mind opening a Discussion
<https://github.com/GeoNode/geonode-project/discussions> inside the
geonode-project repo?

On Tue, Aug 8, 2023 at 9:56 AM Toni Schönbuchner <
toni.schoenbuchner at csgis.de> wrote:

> Dear Giovanni,
>
> this sounds like a great idea.
> As you saying this will not solve all problems on updating like in case
> one needs to change or extend settings.py
> However. The .env file might be a good starting point.
>
> There is something similar for docker:
> https://github.com/Rillke/Docker-env-file-update/tree/master
>
> Some time ago I’ve translated the provided bash script to python that I
> can share:
> https://gist.github.com/t-book/bfeaaa3b550558797b3c16567f8a5c88
>
>
> *Given a fresh .env_template like*
>
> # This is a comment that should be copied as is
> # This is a comment that should be copied as is
> # This is a comment that should be copied as is
>
>
> COMPOSE_PROJECT_NAME=geonode
> DOCKERHOST=123.123.124
> DOCKER_HOST_IP=
> # See https://github.com/containers/podman/issues/13889
> # DOCKER_BUILDKIT=0
> DOCKER_ENV=production
> ALLOWED_HOSTS=["*“]
>
> *A custom_local_env like:*
>
> COMPOSE_PROJECT_NAME=geonode
> DOCKERHOST=
> # See https://github.com/containers/podman/issues/13889
> ALLOWED_HOSTS=["localhost", "127.0.0.1“]
> NOT_IN_TEMPLATE=ABC
>
>
> *The generated output would be*
>
> # This is a comment that should be copied as is
> # This is a comment that should be copied as is
> # This is a comment that should be copied as is
>
>
> COMPOSE_PROJECT_NAME=geonode
>
> # Updated by tonischonbuchner on 2023-08-08 09:36:41
> DOCKERHOST=123.123.124
>
> # Added by tonischonbuchner on 2023-08-08 09:36:42
> DOCKER_HOST_IP=
> # See https://github.com/containers/podman/issues/13889
>
> # Added by tonischonbuchner on 2023-08-08 09:36:42
> # DOCKER_BUILDKIT=0
>
> # Added by tonischonbuchner on 2023-08-08 09:36:44
> DOCKER_ENV=production
>
> # Updated by tonischonbuchner on 2023-08-08 09:36:45
> ALLOWED_HOSTS=["localhost", "127.0.0.1"]
>
>
> *Where the script *
>
>    - Creates a new env file based on both files
>    - Copies lines that do not exist in local file but in the template
>    file as is
>    - If the var exists in both, it asks to update the value from template
>    to local
>    - Leaves a comment on changed or added lines
>
> What is missing is handling vars that exist in the local file but not in
> the template.
> Currently the script informs but does not copy them (should be easy to
> change).
>
> This is far from perfect, not once battled tested and more of a POC.
> But maybe can help others to build upon.
>
> Best regards
>
> Toni
>
>
>   1. Re: Practices on maintaining a geonode project, PR: "Align to
>      GeoNode master 4.2.0" (Giovanni Allegri)
>
> *Von: *Giovanni Allegri <giovanni.allegri at geosolutionsgroup.com>
> *Betreff: **Aw: [GeoNode-devel] Practices on maintaining a geonode
> project, PR: "Align to GeoNode master 4.2.0"*
> *Datum: *7. August 2023 um 14:31:46 MESZ
> *An: *Florian Hoedt <florian.hoedt at thuenen.de>
> *Kopie: *Toni Schönbuchner <toni.schoenbuchner at csgis.de>, geonode-devel <
> geonode-devel at lists.osgeo.org>
>
>
> Thanks for raising this point, and for sharing your solutions.
>
> Keeping a project aligned to GeoNode (and the GeoNode-project itself) can
> be really troublesome. We also don't have a one-fits-all solution.
>
> The idea of the create_env.py command was to start creating a set of
> utilities to help with the creation and the upgrade of downstream projects.
> It was only the first step, and the PR from Alessio improves it.
> The next step wanted to be a utility that could track changes and guide
> the user in the procedure of updating an existing project, starting from
> the .env file which is the principal target of most of the changes.
> A very rough idea would be:
>
>
>    1. when a new project is created the commit for the geonode-project
>    template is written to the .env file by the create_env.py utility
>    2. the upgrade utility retrieves the commit
>    3. it compares the .env.sample commit with the target branch to which
>    you want to upgrade the project
>    4. it tries to extend the current .env file with any new env var, and
>    marks them with a specific comment (similar to the fuzzy translation
>    strings)
>    5. any var in the existing .env file that doesn't match the new
>    .env.sample will be marked with a specific comment
>
> The same utility could generate the list of changed files between the
> original commit and the target branch.
>
> I'm aware that this doesn't solve all the issues, but it would help a lot.
> What do you think?
> Hey, I'm not saying that we will do it! :) That would be a nice feature,
> but at the moment we don't have plans for it.
>
> Giovanni
>
> _______________________________________________
> geonode-devel mailing list
> geonode-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-devel
>


-- 

==

GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.
==

Dott. Giovanni Allegri

Technical Lead / Project Manager


GeoSolutions Group
phone: +39 0584 962313
cell:     +39 345 2815774

fax:      +39 0584 1660272

https://www.geosolutionsgroup.com/
http://twitter.com/geosolutions_it
-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-devel/attachments/20230808/c946c97e/attachment-0001.htm>


More information about the geonode-devel mailing list