-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.exec.yml
More file actions
105 lines (89 loc) · 1.69 KB
/
sample.exec.yml
File metadata and controls
105 lines (89 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
type: exec
name: check out exec 1
steps:
- task: list files
commands:
- ls -la
- task: where I am?
commands:
- pwd
groups:
- e1
- ee
- eee
remote:
- nginx
---
type: exec
name: check out exec 2
steps:
- task: print global environment
commands:
- echo HOSTNAME $HOSTNAME
- echo SHELL $SHELL
- echo PATH $PATH
# error
# - echo cli_name $cli_name
- task: print private environment
environment:
cli_name: Ansishell
data_of_birth: 06 21 2022
shell: $SHELL
host: $HOSTNAME
path: $PATH
ssh_key: $SSH_KEY
commands:
- echo cli_name $cli_name
- echo data_of_birth $data_of_birth
- echo shell $shell
- echo host $host
- echo path $path
- echo ssh_key "$ssh_key"
groups:
- e2
- ee
- eee
local:
- /tmp
remote:
- docker
- irj
---
type: exec
name: check out exec 3
steps:
- task: script 1 with no double newlines
commands:
-
# this code will be run in a single line
function add(){
declare n=0;
n=${1:?'Error first arg is needed'};
echo $(($n + 10));
};
array=(1 2 3);
for i in ${array[*]}; do
echo 'i:' $(add $i);
done;
echo array size ${#array[*]};
- task: script 2 with double newlines
commands:
-
# each part is run separately
function add(){
declare n=0;
n=${1:?"Error first arg is needed"};
echo $(($n + 10));
};
array=(1 2 3);
for i in ${array[*]}; do
echo 'i:' $(add $i);
done
echo array size ${#array[*]};
groups:
- e3
- eee
local:
- .
remote:
- irj