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 setup:codespaces command #35

Open
wants to merge 10 commits into
base: 2.x
Choose a base branch
from

Conversation

walangitan
Copy link

Description

Adds a setup:codespaces command that does the following:

  1. Symlink /var/www/html to the /web directory on a site.
  2. Start apache and forward port 80.
  3. Download the database.
  4. Import the database.
  5. Build the theme.
  6. Clear the cache.

Motivation / Context

https://github.com/ChromaticHQ/chromatichq.com/pull/3472/ has issues when executing other robo commands from another robofile, returning a $result object instead of a string that we need for our database imports.

Testing Instructions / How This Has Been Tested

Testing in the https://github.com/ChromaticHQ/chromatichq.com/pull/3472/ codespace.

Screenshots

TBD

Documentation

TBD

@walangitan walangitan self-assigned this Sep 28, 2021
@walangitan walangitan requested review from markdorison and adamzimmermann and removed request for markdorison September 28, 2021 14:50
Copy link
Contributor

@adamzimmermann adamzimmermann left a comment

Choose a reason for hiding this comment

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

I'm not sure if you are looking for final approval on this, or just a review, so I'll just leave a comment for now.

I'm guessing you want to finish the parent PR while using this as a dev branch and then merge this and tag it for release?

@adamzimmermann
Copy link
Contributor

Overall this is looking great so far! 💯

$result = $this->taskExec('rm')->args($dbPath)->run();

$this->io()->section('Building theme.');
$result = $this->taskExec('composer robo theme:build')->run();
Copy link
Contributor

Choose a reason for hiding this comment

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

This and the db download line above will work for simple sites, but multi-sites will require some special cases. I am OK with merging this assuming we want to address that in a future update.

Copy link
Author

Choose a reason for hiding this comment

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

I can log a ticket about updating this to support multi-sites, as well as some other caveats that may need to be created to support running a multi-site in codespaces.

src/Robo/Plugin/Commands/DevelopmentModeCommands.php Outdated Show resolved Hide resolved
Copy link
Member

@agarzola agarzola left a comment

Choose a reason for hiding this comment

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

@walangitan This PR appears to perform all the tasks we need it to complete. However, I did notice in the web VSCode terminal that the process does not appear to exit:

image

@adamzimmermann @markdorison Is there something we need to run here to explicitly exit the process once a task has completed? As far as I can tell, the new setupCodespaces() function looks like just any other, so I doubt there is anything else we’re missing here, but I ask just in case.

@markdorison
Copy link
Contributor

@adamzimmermann @markdorison Is there something we need to run here to explicitly exit the process once a task has completed?

No, not that I am aware of. 😕

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