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

feature: Add command to start projects in development mode #99

Merged
merged 9 commits into from
Jan 27, 2020

Conversation

ticean
Copy link
Member

@ticean ticean commented Jan 27, 2020

Resolves #97, #83
Impact: minor
Type: feature

Issue

There was no make command to start projects in development mode.

Solution

This continues the work that @trojanh started in #97. Thanks for the submission @trojanh!

Add make init-dev and make dev-<project-name> command to start projects in development mode.

This makes some additions to create init tasks that will configure project(s) for "development mode", which means that docker-compose.dev.yml is symlinked to docker-compose.override.yml in the project directory. The dev overrides configure the project to build and mount local code into the project. That's usually slower.

The README contains workflow suggestions.

I removed the global dev target that was originally proposed, but left the per-project dev-<project> tasks undocumented in the README. Is stopping enough? The README shows documents stopping (same as dev-<project>) but the explicit operations make it clear to user what's happening. Happy to document it in the README if we're confident the workflow will work for everyone and not trigger more support cases.

Breaking changes

None.

Testing

We had some discussion in #98. I think there was some confusion around the expected workflow. So here are testing instructions for a few cases:

Start Everything in Dev Mode

You probably don't want to do this anymore! It's slow and takes more resources.

  1. git clone [email protected]:reactioncommerce/reaction-development-platform.git
  2. cd reaction-development-platform
  3. make init-dev
  4. Make sure docker-compose.override.yml file gets created in the respective projects
  5. Make sure the docker-compose runs using the local files and not using the image from Dockerhub

Switch a Single Project into Dev Mode

Using instructions from README.

  1. git clone [email protected]:reactioncommerce/reaction-development-platform.git
  2. cd reaction-development-platform
  3. make init
  4. Make sure all projects start in "production" mode, using pre-built images and no code mounts.
  5. Follow README instructions to switch to dev mode.
  6. Make sure docker-compose.override.yml file gets created in the respective projects
  7. Make sure the docker-compose runs using the local files and not using the image from Dockerhub

Switch a Single Project into Dev Mode

Using experimental make dev-<project> target. It's undocumented in README until we have high confidence that it works well.

  1. git clone [email protected]:reactioncommerce/reaction-development-platform.git
  2. cd reaction-development-platform
  3. make init
  4. Make sure all projects start in "production" mode, using pre-built images and no code mounts.
  5. Run make dev-<project>
  6. Make sure docker-compose.override.yml file gets created in the respective projects
  7. Make sure the docker-compose runs using the local files and not using the image from Dockerhub

Switch a Single Project into Production Mode

  1. Follow above instructions to ensure a project is in dev mode.
  2. Follow README instructions to switch to prod mode.
  3. Make sure docker-compose.override.yml file is removed in the respective projects
  4. Make sure the docker-compose runs using Dockerhub image and does not mount code.

trojanh and others added 9 commits January 22, 2020 20:37
There's a lot of bootstrapping required on a new installation before we get to starting the apps. All of that bootstrapping's done in the init-* tasks. This adds `init-dev` and per-project examples that can initialize the whole development platform, or a single project, in dev mode.

Signed-off-by: Ticean Bennett <[email protected]>
Signed-off-by: Ticean Bennett <[email protected]>
Signed-off-by: Ticean Bennett <[email protected]>
Copy link
Member

@kieckhafer kieckhafer left a comment

Choose a reason for hiding this comment

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

👍 was able to start up in dev mode, and unlink and link individual projects. Nice work!

@ticean
Copy link
Member Author

ticean commented Jan 27, 2020

🎉 Thanks @trojanh @focusaurus and @kieckhafer!

@ticean ticean merged commit 6d9b7af into release-v3.0.0 Jan 27, 2020
@ticean ticean deleted the development-mode branch January 27, 2020 22:57
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.

3 participants