-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for task-level options propagated to all commands
the initial goal was to allow setting task-level secrets, however, to keep things consistent with other options it was extended to support all the options. The solution has a limitation and command options can't reset boolean options defined on task level. This is because we don't have a way to distinguish between default values (i.e. false for bool) and false set for real.
- Loading branch information
Showing
5 changed files
with
169 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
user: umputun | ||
|
||
targets: | ||
remark42: | ||
hosts: [{name: "h1", host: "h1.example.com"}, {host: "h2.example.com"}] | ||
|
||
|
||
tasks: | ||
- name: deploy-remark42 | ||
options: | ||
secrets: ["SEC11", "SEC12"] | ||
no_auto: true | ||
ignore_errors: true | ||
commands: | ||
- name: wait | ||
script: sleep 5 | ||
|
||
- name: copy configuration | ||
copy: {"src": "/local/remark42.yml", "dst": "/srv/remark42.yml", "mkdir": true} | ||
|
||
- name: some local command | ||
options: {local: true} | ||
script: | | ||
ls -la /srv | ||
du -hcs /srv | ||
- name: git | ||
options: {no_auto: true, sudo: true} | ||
before: "echo before git" | ||
after: "echo after git" | ||
onerror: "echo onerror git" | ||
script: | | ||
git clone https://example.com/remark42.git /srv || true # clone if doesn't exists, but don't fail if exists | ||
cd /srv | ||
git pull | ||
- name: docker | ||
options: {no_auto: true, secrets: ["SEC1", "SEC2"]} | ||
script: | | ||
docker pull umputun/remark42:latest | ||
docker stop remark42 || true | ||
docker rm remark42 || true | ||
docker run -d --name remark42 -p 8080:8080 umputun/remark42:latest | ||
env: | ||
FOO: bar | ||
BAR: qux |