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

Add build-env:create-project command #3

Merged
merged 5 commits into from
Mar 11, 2017
Merged

Conversation

greg-1-anderson
Copy link
Member

@greg-1-anderson greg-1-anderson commented Jan 31, 2017

@stevector
Copy link
Collaborator

@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

@greg-1-anderson
Copy link
Member Author

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.

@greg-1-anderson
Copy link
Member Author

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 bash, and there are some variables that are not calculated &/or passed all the way through to the methods that use them. None of this code has been executed yet.

@stevector
Copy link
Collaborator

Sounds good, let know if you want to talk through any of the pieces.

@greg-1-anderson greg-1-anderson changed the title Rough-out a create-project command Add build-env:create-project command Feb 15, 2017

// 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)";
Copy link
Collaborator

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.

Copy link
Member Author

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.

// 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/)";
Copy link
Collaborator

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

Copy link
Member Author

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.

Copy link
Member Author

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.

@stevector
Copy link
Collaborator

@greg-1-anderson, we'll need to decide how to handle sites that don't have access to multidev.

@greg-1-anderson
Copy link
Member Author

@stevector The original template site README advises to switch to dev for everything by editing your circle.yml. We could auto-degrade to that on site creation if multidev was not available.

Do you happen to know how to detect multi-dev capable sites via Terminus? We could check the service level via terminus site:info, and hardcode the non-multi-dev service levels if there is nothing more direct.

@stevector
Copy link
Collaborator

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.

@greg-1-anderson
Copy link
Member Author

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.

@greg-1-anderson
Copy link
Member Author

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.

greg-1-anderson referenced this pull request in podllc/drupal-starter-pantheon Feb 27, 2017
$target_project = "$target_org/$target";
$remote_url = "[email protected]:${target_project}.git";

$branch = ''; // TODO: allow non-master here?
Copy link
Collaborator

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

Copy link
Member Author

@greg-1-anderson greg-1-anderson Feb 28, 2017

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.

$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')
Copy link
Collaborator

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

Copy link
Member Author

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.

@greg-1-anderson
Copy link
Member Author

@stevector I pushed a commit to allow org/project:dev-branch, but I haven't tested it yet.

// Set the target environment to sftp mode prior to installation
$this->connectionSet($env, 'sftp');

$command_line = "drush site-install --yes";
Copy link
Collaborator

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.

@greg-1-anderson
Copy link
Member Author

OMG passing tests! With Circle CI inception!

@greg-1-anderson greg-1-anderson force-pushed the create-project branch 2 times, most recently from 30e4123 to 079236d Compare March 7, 2017 18:12
…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'.
@greg-1-anderson
Copy link
Member Author

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.

@greg-1-anderson greg-1-anderson merged commit 766b7e9 into master Mar 11, 2017
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.

2 participants