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
c8434682
Commit
c8434682
authored
9 years ago
by
Cam Saül
Committed by
Tom Robinson
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Better error-checking for ./bin/build
parent
71a7c069
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/build
+25
-47
25 additions, 47 deletions
bin/build
with
25 additions
and
47 deletions
bin/build
+
25
−
47
View file @
c8434682
#!/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
}
#! /usr/bin/perl
use
strict
;
use
warnings
;
use
Env
qw
(
$
CI
);
sub
version
{
return
if
$
CI
;
frontend
()
{
echo
"
Running
'
npm install
'
to download javascript dependencies...
"
&&
npm
install
&&
my
(
$
tag
,
$
hash
,
$
branch
,
$
date
)
=
split
'
'
,
(
`./bin/version`
or
die
$!
);
echo
"
Running
'
webpack -p
'
to assemble and minify frontend assets...
"
&&
.
/
node_modules
/
webpack
/
bin
/
webpack
.
js
-
p
open
my
$
file
,
'
>resources/version.properties
'
or
die
$!
;
print
$
file
(
"
tag=$tag
\n
"
.
"
hash=$hash
\n
"
.
"
branch=$branch
\n
"
.
"
date=$date
\n
"
);
close
$
file
;
}
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
frontend
{
system
(
'
npm
'
,
'
install
'
)
==
0
or
die
$!
;
system
(
'
./node_modules/webpack/bin/webpack.js
'
,
'
-p
'
)
==
0
or
die
$!
;
}
uberjar
()
{
echo
"
Running
'
lein uberjar
'
...
"
lein
uberjar
sub
sample_dataset
{
(
system
(
'
lein
'
,
'
generate-sample-dataset
'
)
or
die
$!
)
unless
-
f
'
resources/sample-dataset.db.mv.db
'
;
}
all
()
{
version
&&
frontend
&&
sample
-
dataset
&&
uberjar
sub
uberjar
{
system
'
lein
'
,
'
uberjar
'
or
die
$!
;
}
# 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
@ARGV
=
(
'
version
'
,
'
frontend
'
,
'
sample_dataset
'
,
'
uberjar
'
)
unless
@ARGV
;
map
{
eval
$
_
}
@ARGV
;
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