{% import "_includes/forms" as forms %} {% set cols = { site: { type: 'heading', heading: "Site"|t('blitz'), thin: true, }, repositoryPath: { type: 'singleline', heading: "Repository Path"|t('blitz'), info: "The folder path to an existing local repository. This can be set to an environment variable, or begin with an alias such as `@root`."|t('blitz'), placeholder: "@root/path/to/repo", }, branch: { type: 'singleline', heading: "Branch"|t('blitz'), placeholder: deployer.defaultBranch, }, remote: { type: 'singleline', heading: "Remote"|t('blitz'), placeholder: deployer.defaultRemote, }, } %} {% set rows = [] %} {% for site in craft.app.sites.getAllSites() %} {% set rows = rows|merge({ (site.uid): { site: site.name, repositoryPath: deployer.gitRepositories[site.uid]['repositoryPath']|default(''), branch: deployer.gitRepositories[site.uid]['branch']|default(''), remote: deployer.gitRepositories[site.uid]['remote']|default(''), } }) %} {% endfor %} {% set info %} {{ 'Cached files will be commited and pushed to existing Git repositories using the specified settings. Git must already be installed on the server and the repositories must already exist in the provided paths. Learn more'|t('blitz', {url: 'https://putyourlightson.com/plugins/blitz#remote-deployment'})|raw }} {% endset %} {{ forms.editableTableField({ label: "Git Repositories"|t('blitz'), instructions: "Choose which repositories to commit and push to for each site."|t('blitz') ~ info, name: 'gitRepositories', id: 'gitRepositories', cols: cols, rows: rows, staticRows: true, errors: deployer.getErrors('gitRepositories'), required: true, }) }} {{ forms.textField({ label: "Commit Message"|t('blitz'), instructions: "The commit message will be parsed for twig tags."|t('blitz'), name: 'commitMessage', value: deployer.commitMessage, errors: deployer.getErrors('commitMessage'), required: true, }) }} {{ forms.textField({ label: "Username"|t('blitz'), instructions: "The username of the Git account."|t('blitz'), name: 'username', value: deployer.username, errors: deployer.getErrors('username'), required: true, }) }} {% set info %} {{ 'Personal access tokens are used in place of a password when performing Git operations. They can be created through your Git service provider. Learn more'|t('blitz', {url: 'https://putyourlightson.com/plugins/blitz#remote-deployment'})|raw }} {% endset %} {{ forms.autosuggestField({ label: "Personal Access Token"|t('blitz'), instructions: "A personal access token for the Git account."|t('blitz') ~ info, suggestEnvVars: true, name: 'personalAccessToken', value: deployer.personalAccessToken, errors: deployer.getErrors('personalAccessToken'), required: true, }) }} {{ forms.textField({ label: "Name"|t('blitz'), instructions: "The name to use when performing the commit."|t('blitz'), name: 'name', value: deployer.name, errors: deployer.getErrors('name'), required: true, }) }} {{ forms.textField({ label: "User Email"|t('blitz'), instructions: "The email address to use when performing the commit."|t('blitz'), name: 'email', value: deployer.email, errors: deployer.getErrors('email'), required: true, }) }} {{ forms.textareaField({ label: "Commands Before"|t('blitz'), instructions: "Commands to run before the Git commit."|t('blitz'), name: 'commandsBefore', value: deployer.commandsBefore, rows: 3, }) }} {{ forms.textareaField({ label: "Commands After"|t('blitz'), instructions: "Commands to run after the Git commit."|t('blitz'), name: 'commandsAfter', value: deployer.commandsAfter, rows: 3, }) }}