Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Symfony CLI support for bootstrapping Sulu projects#645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@chirimoya
Copy link
Contributor

@chirimoyachirimoya commentedSep 9, 2025
edited
Loading

This pull request introduces initial support for creating new Sulu projects using the Symfony CLI.

e.g.symfony new my-project --sulusymfony new my-project --skeleton=sulu

@chirimoya
Copy link
ContributorAuthor

@nicolas-grekas one question just to make sure I understood the code correctly that handles template selection for the cloud configuration: I need to contribute a new Sulu template tohttps://github.com/symfonycorp/cloud-templates in theupsun/ directory (e.g.upsun/sulu.yaml), so that it is automatically matched by thehas_composer_package requirement in the YAML template, correct? Also, what would be the best way to test it before merging?

@tucksaun
Copy link
Member

Because this might open the possibility to use others skeletons I would instead go with a string flag to specify the skeleton repository to use. This would let the user specify any repo and we could add some shortcut assymfony orsulu. The default value would besymfony.
For sulu usage this would mean asymfony new --skeleton=sulu my-project

WDYT?

@tucksaun
Copy link
Member

I need to contribute a new Sulu template tohttps://github.com/symfonycorp/cloud-templates in theupsun/ directory (e.g.upsun/sulu.yaml), so that it is automatically matched by thehas_composer_package requirement in the YAML template, correct?

Correct but only if you need specifics. If you don't the generic Symfony template might be sufficient

Also, what would be the best way to test it before merging?

If you are ok with building the CLI locally, you can editgithub.com/symfony-cli/symfony-cli/commands.templatesGitRepository constant and change the value with your fork instead.

@chirimoyachirimoyaforce-pushed thefeature/symfony-cli-sulu-support branch from1cdab05 to032ba36CompareSeptember 19, 2025 14:16
@chirimoya
Copy link
ContributorAuthor

chirimoya commentedSep 19, 2025
edited
Loading

For sulu usage this would mean asymfony new --skeleton=sulu my-project

@tucksaun thanks for your feedback! I’ve refactored the code according to your suggestions.

In the meantime, I’ve figured out how to test the upsun templates and forked the template repository (https://github.com/chirimoya/cloud-templates/tree/feature/sulu-upsun-template/upsun). So far it looks good, but I’m running into some challenges with the template definition and could use some input:

  • We normally use MySQL, but the Docker Compose detection of services and their mapping to upsun services doesn’t seem to work with MySQL. I’m not sure how to fix that.
  • We’d like to set up a proper production configuration that also includes Varnish, but I’m facing a couple of issues:

Any suggestions on how to solve these issues? /cc@nicolas-grekas

@chirimoyachirimoyaforce-pushed thefeature/symfony-cli-sulu-support branch from032ba36 to8e1eaf0CompareSeptember 19, 2025 14:44
@tucksaun
Copy link
Member

  • We normally use MySQL, but the Docker Compose detection of services and their mapping to upsun services doesn’t seem to work with MySQL. I’m not sure how to fix that.

You might need to debug whatparseCloudServices is returning (you can usedumper.Dump to start introspecting it)

IIRC on SymfonyCloud one trick that was working was to use a "public" URL but protected with credentials.

@chirimoya
Copy link
ContributorAuthor

  • How can we combine the Docker Compose detection with predefined services?

@tucksaun ... do you have any suggestions on how to solve this issue? By “predefined services,” I am referring to Varnish. Most projects I know don’t use Varnish for local development, but we highly recommend it for production.

@tucksaun
Copy link
Member

@chirimoya I'm not sure to understand your question because if I got it correctly by “predefined services” you are mostly referring to Varnish in production, but in such case the CLI is out of its scope here and won't be in use, so no interaction with “predefined services” whatsoever 🤔

@chirimoya
Copy link
ContributorAuthor

chirimoya commentedSep 25, 2025
edited
Loading

@tucksaun ... by “predefined services” I’m referring to thecloudServices used during the upsun project initialization. They are parsed either from the CLI or from the Docker file within theparseCloudServices. The question is whether we can define additional services somewhere, e.g. Varnish for a Sulu project?

@chirimoyachirimoya marked this pull request as draftOctober 1, 2025 15:57
@chirimoyachirimoya changed the title[WIP] Add Symfony CLI support for bootstrapping Sulu projectsAdd Symfony CLI support for bootstrapping Sulu projectsOct 1, 2025
@chirimoyachirimoya marked this pull request as ready for reviewOctober 1, 2025 16:00
@chirimoyachirimoyaforce-pushed thefeature/symfony-cli-sulu-support branch 2 times, most recently from33df8dc toe563228CompareOctober 2, 2025 12:11
Copy link
Contributor

@fabpotfabpot left a comment

Choose a reason for hiding this comment

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

It looks good to me.
I'd like to better understand Oracle MySQL support here though.

}elseifstrings.Contains(strings.ToLower(service.Image),"mysql") {
dbType="oracle-mysql"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this part. Can you explain?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The previous implementation was not able to distinguish between MariaDB and MySQL because only the port was taken into consideration. And it’s connected to how Upsun handles MariaDB/MySQL:https://docs.upsun.com/add-services/mysql.html

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I may also need to mention this to make the changes clearer: handling service types likeoracle-mysql andredis-persistent in upsun required adding theEndpoint property to theCloudService struct, since the endpoint does not match the service type.

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it beelse if strings.Contains(strings.ToLower(service.Image), "oracle-mysql") { then here?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Don't think so. This method is about parsing the Dockercompose.yaml file and finding the matching upsun services. The Docker image name for Oracle MySQL ismysql. The matching service name on upsun isoracle-mysql. I know it's quite confusing. Seehttps://docs.upsun.com/add-services/mysql.html

Until now, only the port was taken into consideration. So everything matching port 3306 was defined as upsun servicemysql. Butmysql within upsun actually refers tomariadb. Especially with the version section, things got a bit messy. In our case, it tried to interpret the service as MariaDB with version 8.0 of MySQL. I hope my fix will improve the mapping from Docker to upsun.

@chirimoyachirimoyaforce-pushed thefeature/symfony-cli-sulu-support branch 2 times, most recently fromae27471 toca330faCompareOctober 16, 2025 08:04
@chirimoya
Copy link
ContributorAuthor

@tucksaun@fabpot ... any idea why the pipeline is failing? I’m not sure which change caused it. Any suggestions?

@fabpot
Copy link
Contributor

@tucksaun@fabpot ... any idea why the pipeline is failing? I’m not sure which change caused it. Any suggestions?

Nothing you can do, it's a BC break upstream:platformsh/platformsh-docs#5067 (comment)

@nicolas-grekas
Copy link
Contributor

PR unlocked by mergingsymfonycorp/cloud-templates#43

@fabpotfabpotforce-pushed thefeature/symfony-cli-sulu-support branch fromca330fa to61f7d22CompareNovember 8, 2025 10:13
@fabpot
Copy link
Contributor

Thank you@chirimoya.

@fabpotfabpot merged commitafef23c intosymfony-cli:mainNov 8, 2025
2 checks passed
@chirimoya
Copy link
ContributorAuthor

@fabpot Thanks!

@chirimoyachirimoya deleted the feature/symfony-cli-sulu-support branchNovember 10, 2025 10:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@chirimoya@tucksaun@fabpot@nicolas-grekas

[8]ページ先頭

©2009-2025 Movatter.jp