forked from OpenAF/openaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.yaml
79 lines (68 loc) · 2.65 KB
/
build.yaml
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
ojob:
async: true
jobs:
# Build OpenAF
- name : Build OpenAFOS
exec : >
global.path = (isDef(args.path)) ? args.path : ".";
if (isUnDef(args.openafJSON)) args.openafJSON = global.path + "/openaf.json";
if (isUnDef(args.openafDIST)) args.openafDIST = "nightly";
__expr = "withDir=" + global.path + ";withJSON=" + args.openafJSON + ";withDist=" + args.openafDIST;
if (isDef(args.openafVERSION)) __expr += ";withVersion=" + args.openafVERSION;
af.load(global.path + "/buildos.js");
# Repack the recently build openaf
- name : Repack OpenAFOS
deps :
- Build OpenAFOS
exec : >
log("Repacking...");
$sh(ow.format.getJavaHome() + "/bin/java -jar " + global.path + "/openaf.jar --repack")
.exec()
# Copy OpenAF to the right place for use
- name : Copy OpenAF
deps :
- Prepare ojob saved
- Prepare ojob doc
- Build OpenAFOS
- Repack OpenAFOS
exec : >
log("Copying...");
//sh("cp " + global.path + "/openaf.jar " + global.path + "/dist/openaf.jar", "", undefined, true);
io.mkdir(global.path + "/dist");
io.cp(global.path + "/openaf.jar", global.path + "/dist/openaf.jar");
# -----------------------
- name : Prepare ojob doc
deps :
- Repack OpenAFOS
exec : |
sleep(1000, true)
plugin("ZIP")
var zip = new ZIP()
var is = io.readFileStream(global.path + "/docs/ojob-all.yaml")
zip.streamPutFileStream(global.path + "/openaf.jar", "docs/.ojob-all.yaml", is)
is.close()
is = io.readFileStream(global.path + "/docs/ojob-all.yaml")
zip.streamPutFileStream(global.path + "/openaf.jar.orig", "docs/.ojob-all.yaml", is)
is.close()
# -------------------------
- name : Prepare ojob saved
deps :
- Repack OpenAFOS
exec : |
sleep(1000, true)
$sh([ow.format.getJavaHome() + "/bin/java", "-jar", global.path + "/openaf.jar", "-c", "ow.loadOJob();__flags.OJOB_CHECK_JOB_CHANGES=false;oJobRunFile('" + global.path + "/ojob.json');io.writeFileJSON('" + global.path + "/ojob.saved.json',$ch('oJob::jobs').getAll(), '')"])
.exec()
plugin("ZIP")
var zip = new ZIP()
var is = io.readFileStream(global.path + "/ojob.saved.json")
zip.streamPutFileStream(global.path + "/openaf.jar", "ojob.saved.json", is)
is.close()
is = io.readFileStream(global.path + "/ojob.saved.json")
zip.streamPutFileStream(global.path + "/openaf.jar.orig", "ojob.saved.json", is)
is.close()
todo:
- Prepare ojob saved
- Prepare ojob doc
- Build OpenAFOS
- Repack OpenAFOS
- Copy OpenAF