-
Notifications
You must be signed in to change notification settings - Fork 1
Deploy actions
Mougrim edited this page Jul 6, 2023
·
16 revisions
To see deploy actions you can run mougrim-deployer.php help deploy.
To see deploy action info you can run mougrim-deployer.php help deploy <action>. For example replace <action> to switch.
Action init have next options:
-
--application-path- destination path. -
--user- linux user. -
--group- linux group.
This action init project directory:
- Create application directory (
--application-pathparam value). - Create versions directory. For example if
--application-path=/project, then versions directory/project/versions.
For this directories owner user <user> and owner group <group>.
Action deploy have next options:
-
--tag- git tag. -
--skip-git- skip git checkout tag, and other work with git for debug or dev deploy. -
--skip-deploy-files- skip deploy files to version dir for debug or dev deploy. -
--application-path- destination path. -
--user- linux user. -
--group- linux group. -
--before-deploy-script- scripts, run after git checkout tag, not template. This param multiple. -
--after-deploy-script- scripts, run after deploy to new tag, as template. This param multiple. -
--template-files- files, which needs process as templates. This param multiple.Available variables, passed to template:- parameters from config;
- parameters from request;
-
versions-path- versions dir path; -
version-path- new version dir path; -
current-link-path- current link path.
If we have param variable=value, and templateText {{ variable }} other text, then template converted toText value other text. You can use nested parameters, for example{{ template-parameters.nested-variable }}Template path is also template, for exampleversion-path=/project/versions/v1.0.0and template path{{ version-path }}/bin/script.shwill replaces to/project/versions/v1.0.0/bin/script.sh. -
--template-parameters- Custom template parameters, passed to templates - files in 'template-files' and commands names.
This action do next steps:
- Checkout git tag (
--tagparam value). - Run before deploy scripts (
--before-deploy-scriptparams values). - Create version folder. For example if you deploy tag
v1.3.2, and--application-path=/project, then deploy action create directory/project/versions/v1.3.2. If directory exists, then you need input yes for remove directory, or no for cancel deploy. - Deploy project to version directory.
- Process template files (
--template-filesparams values). - Run after deploy scripts (
--after-deploy-scriptparams values).
Action switch have next options:
-
--tag- git tag. -
--application-path- destination path. -
--user- linux user. -
--group- linux group. -
--after-switch-script- scripts, run after switch to new tag, as template. This param multiple. -
--template-parameters- Custom template parameters, passed to templates - files in 'template-files' and commands names.
This action switch project to new version:
- Create new links in project root directory to files (and directories) in current link, if in new version new files exists.
- Switch current link to new version.
- Remove old links in project root directory, if in new version destination files (and directories) not exists.
- Run after switch scripts (
--after-switch-scriptparams values). For example you can chose--after-switch-script='sudo service nginx reload'
Action index is default action. This action run next actions:
-
init; -
deploy; -
switch;
This action have same options with init, deploy and switch actions.
For deploy files in dev environment you can use dev action. This action same with index, but force add param --skip-git and param --tag have default value dev.