Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
202e9b6d
Commit
202e9b6d
authored
9 years ago
by
Allen Gilliland
Browse files
Options
Downloads
Patches
Plain Diff
move build script back to bash
parent
c6d096f3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/build
+47
-25
47 additions, 25 deletions
bin/build
with
47 additions
and
25 deletions
bin/build
+
47
−
25
View file @
202e9b6d
#! /usr/bin/perl
use
strict
;
use
warnings
;
use
Env
qw
(
$
CI
);
sub
version
{
return
if
$
CI
;
#!/usr/bin/env bash
# Generate the resources/version.properties file
version
()
{
# Skip on CircleCI since this is interactive
if
[
!
$
CI
];
then
VERSION_INFO
=
$
(.
/
bin
/
version
)
IFS
=
'
,
'
read
-
a
info
<<<
$
{
VERSION_INFO
}
echo
"
Tagging uberjar with version
'
$VERSION_INFO
'
...
"
# Ok, now generate the appropriate version.properties file.
echo
"
tag=${info[0]}
"
>
resources
/
version
.
properties
echo
"
hash=${info[1]}
"
>>
resources
/
version
.
properties
echo
"
branch=${info[2]}
"
>>
resources
/
version
.
properties
echo
"
date=${info[3]}
"
>>
resources
/
version
.
properties
fi
}
my
(
$
tag
,
$
hash
,
$
branch
,
$
date
)
=
split
'
'
,
(
`./bin/version`
or
die
$!
);
frontend
()
{
echo
"
Running
'
npm install
'
to download javascript dependencies...
"
&&
npm
install
&&
open
my
$
file
,
'
>resources/version.properties
'
or
die
$!
;
print
$
file
(
"
tag=$tag
\n
"
.
"
hash=$hash
\n
"
.
"
branch=$branch
\n
"
.
"
date=$date
\n
"
);
close
$
file
;
echo
"
Running
'
webpack -p
'
to assemble and minify frontend assets...
"
&&
.
/
node_modules
/
webpack
/
bin
/
webpack
.
js
-
p
}
sub
frontend
{
system
(
'
npm
'
,
'
install
'
)
==
0
or
die
$!
;
system
(
'
./node_modules/webpack/bin/webpack.js
'
,
'
-p
'
)
==
0
or
die
$!
;
sample
-
dataset
()
{
if
[
-
f
resources
/
sample
-
dataset
.
db
.
mv
.
db
];
then
echo
"
Sample Dataset already generated.
"
else
echo
"
Running
'
lein generate-sample-dataset
'
to generate the sample dataset...
"
lein
generate
-
sample
-
dataset
fi
}
sub
sample_dataset
{
(
system
(
'
lein
'
,
'
generate-sample-dataset
'
)
==
0
or
die
$!
)
unless
-
f
'
resources/sample-dataset.db.mv.db
'
;
uberjar
()
{
echo
"
Running
'
lein uberjar
'
...
"
lein
uberjar
}
sub
uberjar
{
system
(
'
lein
'
,
'
uberjar
'
)
==
0
or
die
$!
;
all
()
{
version
&&
frontend
&&
sample
-
dataset
&&
uberjar
}
@ARGV
=
(
'
version
'
,
'
frontend
'
,
'
sample_dataset
'
,
'
uberjar
'
)
unless
@ARGV
;
map
{
eval
$
_
}
@ARGV
;
# Default to running all but let someone specify one or more sub-tasks to run instead if desired
# e.g.
# ./bin/build # do everything
# ./bin/build version # just update version.properties
# ./bin/build version uberjar # just update version.properties and build uberjar
if
[
"
$1
"
];
then
for
cmd
in
"
$@
"
;
do
$
cmd
done
else
all
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment