-
Notifications
You must be signed in to change notification settings - Fork 2
167 lines (144 loc) · 4.39 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Build oJob.io
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
backup:
runs-on: ubuntu-latest
#permissions:
# contents: write
# pull-requests: write
steps :
# --------------------------
- name: Cache OpenAF runtime
uses: actions/cache@v4
with:
key : oaf-t8
path: /tmp/oaf
# --------------------
- name: Backup oJob.io
uses: openaf/ojob-action@v6
env :
OS_OJOBIO: ${{ secrets.OS_OJOBIO }}
with:
dist : t8
def : |
todo:
- Backup ojob.io
ojob:
opacks :
- openaf: 20231222
- S3 : 20231112
catch : printErrnl("[" + job.name + "] "); if (isDef(exception.javaException)) exception.javaException.printStackTrace(); else printErr(exception)
logToConsole: true # to change when finished
loadLibs :
- s3.js
owraps :
- Format
include:
- s3.yaml
jobs:
# ---------------------
- name : Backup ojob.io
exec : |
args._file = io.createTempFile("ojobio", ".zip")
// Checking backup download info
var _info = $rest().head("https://ojob.io/_output.zip")
log("Downloading " + ow.format.toBytesAbbreviation(_info.response["content-length"]) + " modified on " + _info.response["last-modified"] + "...")
args._date = new Date(_info.response["last-modified"])
// Downloading backup
$rest().get2File(args._file, "https://ojob.io/_output.zip")
args._target = "ojobio/ojobio_" + ow.format.fromDate(args._date, "yyyyMMdd-HHmm") + ".zip"
args.bucket = "nmaback"
args.objectName = args._target
args.localPath = args._file
to :
- (secget ): OS_OJOBIO
((secEnv)): true
- S3 Put object
build:
needs : backup
runs-on: ubuntu-latest
#permissions:
# contents: write
# pull-requests: write
steps :
# --------------------------
- name: Cache OpenAF runtime
uses: actions/cache@v4
with:
key : oaf-t8
path: /tmp/oaf
# -------------------------
#- uses: actions/checkout@v2
# --------------------------
- name: Install oJobIO opack
uses: openaf/ojob-action@v6
with:
dist: t8
def : |
todo:
- Install aux packs
- Copy files
- Run Setup oJobIO
- Run Rebuild
jobs:
- name: Install aux packs
lang: shell
exec: |
/tmp/oaf/opack install ojobio
/tmp/oaf/opack install ojob-common
wget https://ojob.io/_output.zip
- name: Copy files
lang: shell
exec: |
cp -R /tmp/oaf/oJobIO/* .
ls -lad *
find imgs | wc
find ojobs | wc
echo "__threadPoolFactor=16;" > ~/.openaf_profile
- name: Run Setup oJobIO
lang: shell
typeArgs:
shellPrefix: setupOJobIO
exec: |
/tmp/oaf/ojob setupOJobIO.yaml
find ojobs | wc
- name: Run Rebuild
lang: shell
typeArgs:
shellPrefix: rebuild
exec: |
/tmp/oaf/ojob rebuild.yaml NAME=ojob.io URL=ojob.io PROTO=https
# -----------------------
- name: Copy build result
uses: openaf/ojob-action@v6
env :
OS_OJOBIO: ${{ secrets.OS_OJOBIO }}
with:
dist : t8
def : |
ojob:
opacks:
- S3
include:
- s3.yaml
todo:
- (if ): |
io.fileExists("output/oafp.yaml") && io.fileExists("output/oaf/versions.yaml")
((then)):
- Copy build result
((else)):
- (fail): -1
jobs:
- name: Copy build result
to :
- (secget) : OS_OJOBIO
((secEnv)): true
- name: S3 Sync folder
args:
squash : remote
localPath: output
bucket : ojob.io
execute : true