-
Notifications
You must be signed in to change notification settings - Fork 7
/
buildStripesPlatform.groovy
48 lines (35 loc) · 1.34 KB
/
buildStripesPlatform.groovy
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
#!/usr/bin/env groovy
/*
* Build stripes platform.
*/
def call(String okapiUrl, String tenant, String branch='') {
def foliociLib = new org.folio.foliociCommands()
if (!(branch =~ /^(r|R)\d{1}-\d{4}(-(rc|RC|hotfix-\d{1}))?$/)) {
sh 'rm -f yarn.lock'
}
sh 'yarn install'
// publish generated yarn.lock for possible debugging
sh 'mkdir -p ci'
sh 'cp yarn.lock ci/yarn.lock'
sh 'bzip2 ci/yarn.lock'
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false,
keepAll: true, reportDir: 'ci',
reportFiles: 'yarn.lock.bz2',
reportName: "Yarn Lock",
reportTitles: "Yarn Lock"])
// list yarn FOLIO deps
sh 'yarn list --pattern @folio'
// generate platform mod descriptors
// foliociLib.genStripesModDescriptors("${env.WORKSPACE}/artifacts/md")
sh 'yarn build-module-descriptors --strict'
// build webpack with stripes-cli. See STCLI-66 re: PREFIX env
sh "yarn build --okapi $okapiUrl --tenant $tenant ./output"
// generate tenant stripes module list
writeFile file: 'md2install.sh', text: libraryResource('org/folio/md2install.sh')
sh 'chmod +x md2install.sh'
sh './md2install.sh --outputfile stripes-install.json ./ModuleDescriptors'
sh 'rm -f md2install.sh'
// publish stripes bundle for debugging
// archiveWebpack('./output')
// end stage
}