-
Notifications
You must be signed in to change notification settings - Fork 4
/
c0144.yml
67 lines (52 loc) · 2.56 KB
/
c0144.yml
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
doc_meta: |
folder: usage
title: working directory
head: |
By default, you will be using current working directory for an execution of your task
Sometimes, we need a protected way or simly we need a jailed execution to where the task up.yml is located, in this case, we could config the working directory to be the refdir and in this case the refdir is out side of current directory
sections:
- title: How it works
content: |
By default, the WorkDir setting is "cwd", which is the current working directory you execute the up command
There are two ways doing it:
* You can configure it in the upconfig.yml
```
version: 1.0.0
Verbose: v
MaxCallLayers: 8
RefDir: .
WorkDir: refdir -> use "refdir" to dictate the execution working directory will be in the refdir instead of current work dir
TaskFile: up.yml
ConfigDir: .
ConfigFile: upconfig.yml
```
* You can use cmd arg in CLI to specify that you want it to be refdir
```
-w, --workdir=WORKDIR working directory: cwd | refdir
eg:
up ngo task -d ./tests/functests -t wip.yml -i dev --configdir=./tests/functests -w refdir
```
- title: Application using current directory as work directory
content: |
Normally, if you intend to do project based work, then you will need to use the default setting: cwd - current work directory as the working directory.
In this case, you cd to the project directory, all the directories in your up.yml will be reletive path to your project directory
- title: Application using refdir
content: |
If the up.yml tasks are wrapped as a service to do something system wide and not relevent to your specific project, all the changes made in the task are confined within the refdir, than the WorkDir should be refdir
For example, you could use below alias: install_apps to install and update all your softwares, this task will manage to install all defined softwares and if it requires to caches some files and temp directories, it will put them into the refdir
```
alias install_apps='up ngo task -d /myapps/install_all_required_softwards -w refdir'
```
So, when you consider publish your own task(s) for other people to use as a standalone tool/cli cmd, you should use this setting
- title: Demo
log: yes
tasks:
-
name: task
desc: main entry
task:
-
func: shell
desc: main job
do:
- pwd