Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Craft CMS project type, docs, and tests closes #3594 #4176

Merged
merged 83 commits into from
Sep 10, 2022

Conversation

khalwat
Copy link
Collaborator

@khalwat khalwat commented Sep 4, 2022

The Problem/Issue/Bug:

There is no built-in Craft CMS project type, and no quickstart documentation for Craft CMS

How this PR Solves The Problem:

This PR adds a Craft CMS project type, tests, and quickstart documentation for people working with Craft CMS

Manual Testing Instructions:

New projects

Composer project

Use this to create a new Craft CMS project from the official Craft starter project or a third-party starter project using Composer.

mkdir my-craft-project
cd my-craft-project
ddev config --project-type=craftcms
ddev composer create -y --no-scripts --no-install craftcms/craft
ddev start
ddev composer install
ddev craft setup/welcome
ddev launch

Manual download

Use this to create a new Craft CMS project using a zipped archive.

mkdir my-craft-project
cd my-craft-project
curl -LO https://craftcms.com/latest-v4.zip
unzip latest-v4.zip && rm latest-v4.zip
ddev config --project-type=craftcms
ddev start
ddev composer install
ddev craft setup
ddev launch

Existing projects

Craft git clone

Use this to migrate an existing Craft CMS project from a git repository and import a database dump.

git clone https://github.com/example/example-site my-craft-project
cd my-craft-project
ddev config --project-type=craftcms
ddev start
ddev composer install
ddev import-db
ddev launch

Automated Testing Overview:

  • Craft CMS webserver test
  • Craft CMS commands test

Related Issue Link(s):

#3594

Release/Deployment notes:

n/a

khalwat and others added 29 commits September 4, 2022 01:47
Add Craft CMS quickstart guide
Add Craft CMS commands test
Add Craft CMS webserver test
Reorder app types alphabetically
Reorder app types alphabetically
Add MailHog-related .env variables
Only set MailHog variables if they don't exist
Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

It's looking great. I haven't tried it out with manual testing yet, but wanted to give the first-runthrough responses to the code so we could discuss.

One thing I'm concerned about and hope to do better here: the .env file management in Laravel is a mess, and ddev doesn't properly manage the file (or try to manage it) and that causes confusion like #3636 - I hope we're doing better here, and would like to do better in general.

Congrats on getting all the tests green! I'll move the test tarballs over to the ddev test repo now.

cmd/ddev/cmd/commands_test.go Show resolved Hide resolved
docs/content/users/quickstart.md Outdated Show resolved Hide resolved
docs/content/users/quickstart.md Outdated Show resolved Hide resolved
docs/content/users/quickstart.md Outdated Show resolved Hide resolved
pkg/ddevapp/.env Outdated Show resolved Hide resolved
pkg/ddevapp/craftcms.go Show resolved Hide resolved
pkg/ddevapp/craftcms.go Show resolved Hide resolved
pkg/ddevapp/craftcms.go Show resolved Hide resolved
pkg/ddevapp/ddevapp_test.go Outdated Show resolved Hide resolved
@rfay
Copy link
Member

rfay commented Sep 7, 2022

The test tarballs are now at https://github.com/drud/ddev_test_tarballs/releases/tag/v1.1 but I changed the cms-4.2.3.zip to craft-cms-4.2.3.zip

pkg/ddevapp/ddevapp_test.go Outdated Show resolved Hide resolved
Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

I seem to have had some unsent comments... here they come.

pkg/ddevapp/ddevapp_test.go Outdated Show resolved Hide resolved
pkg/ddevapp/ddevapp_test.go Outdated Show resolved Hide resolved
docs/content/users/quickstart.md Outdated Show resolved Hide resolved
docs/content/users/quickstart.md Outdated Show resolved Hide resolved
@khalwat
Copy link
Collaborator Author

khalwat commented Sep 8, 2022

This PR is waiting on the addition of a project type action that executes after ddev composer create, so that we can rewrite the .env or env.example / env.example.dev then, rather than inside of the configOverrideAction: craftCmsConfigOverrideAction as we do now.

We will revise the PR and quickstart documentation once this is done (it should be trivial changes on our end).

@rfay has said he's going to look into adding such a project type action.

This will allow us to greatly simplify the quickstart documentation, and will also allow for the resolution of:

#3636 & #3590

@khalwat khalwat requested a review from rfay September 9, 2022 08:10
@khalwat
Copy link
Collaborator Author

khalwat commented Sep 9, 2022

Strike that comment above, after a discussion with @rfay I was able to refactor the code so the setup flow is much cleaner. We may not need the additional project action at all.

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

I manually tested the composer and download options from the docs and it worked flawlessly.

The .env management is doing fine, and the regex approach should be OK.

Thanks for a great contribution, and let me know when you're ready to have it pulled.

@khalwat
Copy link
Collaborator Author

khalwat commented Sep 9, 2022

Thx for all your help @rfay -- I just push some very minor docs changes to clean up the formatting.

But we are ready. Let's do this!

@rfay rfay merged commit af19187 into ddev:master Sep 10, 2022
@rfay
Copy link
Member

rfay commented Sep 10, 2022

Congrats, great work!

bencroker added a commit to bencroker/ddev that referenced this pull request Sep 10, 2022
)

Co-authored-by: Ben Croker <57572400+bencroker@users.noreply.github.com>
bencroker added a commit to bencroker/ddev that referenced this pull request Sep 10, 2022
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.

None yet

3 participants