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

Improve setup flow #30

Merged
merged 11 commits into from
Jan 21, 2018
Merged

Improve setup flow #30

merged 11 commits into from
Jan 21, 2018

Conversation

marktopper
Copy link
Member

@marktopper marktopper commented Jan 20, 2018

Closes #24

This adds the option to migrate, seed, publish assets, re-migrate, re-seed, re-publish assets, un-migrate, un-seed and un-publish assets on installation/updating and uninstallation of a hook.

Events

Install

The installation of a hook will run the specific migrations from the hook, along with the hooks seeders and publish-ing the assets.

The migrations can be skipped using the --no-migrate option command-line.
The seeding can be skipped using the --no-seed option command-line.
The publishing of assets can be skipped using the --no-publish option command-line.

Update

The updating of a hook will re-run the un-migrated migrations from the specific hooks along with running all the hooks seeders and publish-ing any non-manually-updated assets.

The migrations can be skipped using the --no-migrate option command-line.
The seeding can be skipped using the --no-seed option command-line.
The publishing of assets can be skipped using the --no-publish option command-line.

Uninstall

The uninstallation of a hook will rollback the migrated migrations from the specific hooks along with running all the hooks un-seeders and un-publishing all the hooks assets.

The migrations can be skipped using the --no-unmigrate option command-line.
The seeding can be skipped using the --no-unseed option command-line.
The publishing of assets can be skipped using the --no-unpublish option command-line.

Changed assets

Any assets that have been changed from the original assets from the hook, will not be overwritten on updating of the hook. Not even if the hook has an update to that file itself.

However, you can tell the system to overwrite the assets anyway using the --force option command-line.

Composer File

The composer file is the key to all this. The hook will have to specify the migrations, seeders, un-seeders and assets paths inside the composer.json file.
You can see an example hook using the migrations, seeders, un-seeders, and assets here.

@marktopper
Copy link
Member Author

The assets has a key and a value inside the composer.json file as you can see below.

"assets": {
    "resources/assets": "public/vendor/migration-hook/assets"
}

The key (resources/assets) is the current location of the assets within the hook folder while the value (public/vendor/migration-hook/assets) is the location to place the assets inside the base application folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant