-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add build-env:create-project command #3
Conversation
@greg-1-anderson, shall we bring over the circle.yml pieces so that this functionality itself can be tested? We'd need a new github user like the @stevectorbot account I used over in https://github.com/stevector/pantheon-create-project |
Yes, I think it would be a good idea to have some circle tests that use create-project to clone pantheon-systems/example-drops-8-composer and set up new GitHub, Pantheon and Circle projects with the create-project command. It would probably be too meta to submitting a PR to the new GitHub account and hang out until the test passed. However, I think we could test the other commands in this tool by directly creating a multidev account and walking through all of the steps that the example.circle.yml does, and confirm the results. |
Note also, though, that this PR is still a little ways from "done". There are a couple entire methods that still need to be ported from |
Sounds good, let know if you want to talk through any of the pieces. |
src/Commands/BuildToolsCommand.php
Outdated
|
||
// Create a new README file to point to this project's Circle tests and the dev site on Pantheon | ||
$circleBadge = "[![CircleCI](https://circleci.com/gh/$source.svg?style=svg)](https://circleci.com/gh/{$target_project})"; | ||
$pantheonBadge = "[![Pantheon {$target}](https://img.shields.io/badge/pantheon-{$target}-yellow.svg)](https://admin.dashboard.pantheon.io/sites/{$site_uuid}#dev/code)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command use the regular dashboard instead of the admin dashboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right. Thanks.
src/Commands/BuildToolsCommand.php
Outdated
// Create a new README file to point to this project's Circle tests and the dev site on Pantheon | ||
$circleBadge = "[![CircleCI](https://circleci.com/gh/$source.svg?style=svg)](https://circleci.com/gh/{$target_project})"; | ||
$pantheonBadge = "[![Pantheon {$target}](https://img.shields.io/badge/pantheon-{$target}-yellow.svg)](https://admin.dashboard.pantheon.io/sites/{$site_uuid}#dev/code)"; | ||
$siteBadge = "[![Dev Site {$target}](https://img.shields.io/badge/site-{$target}-blue.svg)](http://dev-{$target}.pantheonsite.io/)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two of the generated shields failed here: https://github.com/stevectorbot/stevectorbot-40
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you cannot have dashes in the badge text. Will need to decide what to do about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converting dashes to underscores works--although underscores render as spaces, it's probably close enough for badge purposes.
@greg-1-anderson, we'll need to decide how to handle sites that don't have access to multidev. |
@stevector The original template site README advises to switch to Do you happen to know how to detect multi-dev capable sites via Terminus? We could check the service level via |
I'd really rather not try to rely on service level since we have so many Sandbox testing sites that we've manually flipped to multidev. I don't see a Terminus command for this specifically but I'm sure one could be written. |
Is there any sort of web service API or other way to remotely detect if multidev is available? As a fallback, we could try to create one, but that would be slow and inelegant. |
Maybe the best thing to do, failing an infallible way to detect multidev capability, would be to have an option to select whether the user wishes to use multidev or not. We could perhaps use the service level to provide the default value if the user does not explicitly specify it. |
2823ed6
to
778b88d
Compare
src/Commands/BuildToolsCommand.php
Outdated
$target_project = "$target_org/$target"; | ||
$remote_url = "[email protected]:${target_project}.git"; | ||
|
||
$branch = ''; // TODO: allow non-master here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was talking with an agency today about Lightning. It'd be nice to run this command against https://github.com/pantheon-systems/example-drops-8-composer/pull/33/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would be pantheon-systems/example-drops-8-composer:dev-lightning-fist-2
.
src/Commands/BuildToolsCommand.php
Outdated
$remote_url = "[email protected]:${target_project}.git"; | ||
|
||
$branch = ''; // TODO: allow non-master here? | ||
$version = ''; // TODO: allow version selection here? (e.g. '~2' or '^1.5') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just have $source_project
be passed in fully formed rather than construct it from multiple variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was thinking about going that route too. Sounds like a good plan.
@stevector I pushed a commit to allow |
// Set the target environment to sftp mode prior to installation | ||
$this->connectionSet($env, 'sftp'); | ||
|
||
$command_line = "drush site-install --yes"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this branch a month ago but forgot to open the PR apparently: pantheon-systems/example-drops-8-composer#60
Different repos (WordPress, Acquia Lightning, etc) may have totally different install steps. I think we should let the given repo provide its own CMS installation instructions.
6a3e2c8
to
8af84dc
Compare
OMG passing tests! With Circle CI inception! |
30e4123
to
079236d
Compare
079236d
to
1815d95
Compare
…d-env:merge wait for the code sync to finish before exiting, to avoid follow-on calls to the merge target from failing.
…t in build-env:merge. Delete .git directories before running 'git add'.
I'm going to merge this PR as an EXPERIMENTAL feature; backwards compatibility is not guaranteed until the command is completed, at which point I will tag version 1.3.0. This will make it easy for folks to try this command, while still giving us the latitude to make breaking changes to get the API / options right. |
Ported from https://github.com/stevector/pantheon-create-project.
See #7