Skip to content

Conversation

chirimoya
Copy link

@chirimoya chirimoya commented Oct 1, 2025

With the changes of symfony-cli/symfony-cli#645 and this new Sulu specific upsun template, it is now much easier to create and deploy a new Sulu project on upsun.

Examples:

Basic Sulu project:
symfony new sulu-beta --skeleton=sulu --version=3.0.0-beta-1 --upsun

With Varnish (requires additional config update in the skeleton)
symfony new sulu-beta --skeleton=sulu --version=3.0.0-beta-1 --upsun --service=varnish

Redis as session storage (to scale the application):
symfony new sulu-beta --skeleton=sulu --version=3.0.0-beta-1 --upsun --service=redissession:redis-persistent

@chirimoya chirimoya marked this pull request as draft October 1, 2025 15:57
@chirimoya chirimoya changed the title [WIP] Add support for bootstrapping Sulu projects Add support for bootstrapping Sulu projects Oct 1, 2025
@chirimoya chirimoya marked this pull request as ready for review October 1, 2025 16:01
Copy link
Contributor

@tucksaun tucksaun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a big chunk of duplication with the original Symfony template (which makes totally sense) but should this mean partials should be introduced with the use of include?

Comment on lines 8 to 13
{{- $hasVarnish := false -}}
{{- range $service := $.Services -}}
{{- if eq $service.Type "varnish" -}}
{{- $hasVarnish = true -}}
{{- end -}}
{{- end -}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to merge the two loops over $.Services and move routes after services (because keys order in the YAML does not matter)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use a single initial loop to gather the needed information. I’d prefer to keep the original order in the YAML file for better DX and readability.

@chirimoya chirimoya force-pushed the feature/sulu-upsun-template branch from 6918b43 to 023992d Compare October 2, 2025 08:52
@chirimoya
Copy link
Author

I see a big chunk of duplication with the original Symfony template (which makes totally sense) but should this mean partials should be introduced with the use of include?

@tucksaun could you provide an example of how include would work? I’m not sure how to implement it. Thanks.

Copy link
Contributor

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rebase and consider this change:

-                "/var": { source: storage, source_path: var }
+                "/var/cache": { source: instance, source_path: var/cache }
+                "/var/cache/prod/pools/app": { source: storage, source_path: var/cache/prod/pools/app }
                 "/public/uploads": { source: storage, source_path: public/uploads }
-                {{ if file_exists "templates/debug/source_code.html.twig" -}}
-                "/data": { source: storage, source_path: "data" }
-                {{- end }}

Also, I see many whitespace control have changed position.
I'd like this file to be as much in sync with the flex-one as possible.
Could you figure out how these differences could minimized?

About "include" as suggested by @tucksaun, this can be done later on.

@chirimoya chirimoya force-pushed the feature/sulu-upsun-template branch 2 times, most recently from cdf76c8 to 8b9e55d Compare October 14, 2025 15:32
@chirimoya chirimoya force-pushed the feature/sulu-upsun-template branch 11 times, most recently from 03aa915 to 239172a Compare October 17, 2025 19:43
@chirimoya chirimoya force-pushed the feature/sulu-upsun-template branch 3 times, most recently from 7e04f93 to 16a5003 Compare October 20, 2025 15:29
@chirimoya chirimoya force-pushed the feature/sulu-upsun-template branch from 16a5003 to f685a3a Compare October 20, 2025 15:31
@chirimoya
Copy link
Author

please rebase and consider this change:

-                "/var": { source: storage, source_path: var }
+                "/var/cache": { source: instance, source_path: var/cache }
+                "/var/cache/prod/pools/app": { source: storage, source_path: var/cache/prod/pools/app }
                 "/public/uploads": { source: storage, source_path: public/uploads }
-                {{ if file_exists "templates/debug/source_code.html.twig" -}}
-                "/data": { source: storage, source_path: "data" }
-                {{- end }}

@nicolas-grekas ... are you sure these changes work properly on upsun? I’m getting a Permission denied error during deployment. For Symfony projects as well. The var/cache/prod folder is owned by the root user. Could that be causing the issue?

Otherwise, the template should be ready now. Since I’m not an upsun expert, it might make sense for someone with more experience to review and challenge the template. I did my best, but I have limited experience in this area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants