Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
ma-impl
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eccochu
ma-impl
Commits
7200b03e
Commit
7200b03e
authored
9 years ago
by
Eike Cochu
Browse files
Options
Downloads
Patches
Plain Diff
updated build script, gitignores and gitkeeps
parent
e690f8d0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
build.sh
+106
-66
106 additions, 66 deletions
build.sh
docker/.gitignore
+2
-0
2 additions, 0 deletions
docker/.gitignore
vipra-ui/app/js/config.js
+1
-1
1 addition, 1 deletion
vipra-ui/app/js/config.js
vm/.gitignore
+3
-1
3 additions, 1 deletion
vm/.gitignore
vm/webroot/.gitkeep
+0
-0
0 additions, 0 deletions
vm/webroot/.gitkeep
with
112 additions
and
68 deletions
build.sh
+
106
−
66
View file @
7200b03e
...
@@ -11,28 +11,84 @@ BUILD_VIPRA_UI=1
...
@@ -11,28 +11,84 @@ BUILD_VIPRA_UI=1
BUILD_VIPRA_BACKEND
=
1
BUILD_VIPRA_BACKEND
=
1
# set to 1 to deploy backend after build completed
# set to 1 to deploy backend after build completed
DEPLOY_AFTER_BUILD
=
1
DEPLOY_
BACKEND_
AFTER_BUILD
=
1
# copy backend to docker
# copy backend to docker
DEPLOY_TO_DOCKER
=
1
DEPLOY_
BACKEND_
TO_DOCKER
=
1
# copy backend to vagrant
# copy backend to vagrant
DEPLOY_TO_VAGRANT
=
0
DEPLOY_
BACKEND_
TO_VAGRANT
=
0
# copy exploded WAR instead of *.war file
# copy exploded WAR instead of *.war file
DEPLOY_EXPLODED_WAR
=
1
DEPLOY_
BACKEND_
EXPLODED_WAR
=
1
# copy to ROOT, overwrite context path
# copy to ROOT, overwrite context path
DEPLOY_TO_ROOT
=
1
DEPLOY_BACKEND_TO_ROOT
=
1
# set to 1 to deploy frontend after build completed
DEPLOY_FRONTEND_AFTER_BUILD
=
1
# copy frontend to docker
DEPLOY_FRONTEND_TO_DOCKER
=
1
# copy frontend to vagrant
DEPLOY_FRONTEND_TO_VAGRANT
=
0
#######################################################################################
#######################################################################################
PROJECT
=
"vipra"
WAR_FILE
=
"
$PROJECT
.war"
DIR
=
"
$(
dirname
"
$(
readlink
-f
"
$0
"
)
"
)
"
DIR
=
"
$(
dirname
"
$(
readlink
-f
"
$0
"
)
"
)
"
DOCKER_PATH
=
"
$DIR
/docker/webapps"
VAGRANT_PATH
=
"
$DIR
/vm/webapps"
WAR_FILE
=
"vipra.war"
VIPRA_BACKEND
=
"
$DIR
/vipra-backend"
VIPRA_CMD
=
"
$DIR
/vipra-cmd"
VIPRA_UI
=
"
$DIR
/vipra-ui"
VIPRA_UTIL
=
"
$DIR
/vipra-util"
DOCKER_WEBAPPS
=
"
$DIR
/docker/webapps"
VAGRANT_WEBAPPS
=
"
$DIR
/vm/webapps"
DOCKER_WEBROOT
=
"
$DIR
/docker/webroot"
VAGRANT_WEBROOT
=
"
$DIR
/vm/webroot"
WAR_PATH
=
"
$DIR
/vipra-backend/target/
$WAR_FILE
"
WAR_PATH
=
"
$DIR
/vipra-backend/target/
$WAR_FILE
"
EXPLODED_WAR_PATH
=
"
$DIR
/vipra-backend/target/vipra"
EXPLODED_WAR_PATH
=
"
$DIR
/vipra-backend/target/vipra"
UI_PATH
=
"
$DIR
/vipra-ui/public"
LOG
=
"
$DIR
/build.log"
LOG
=
"
$DIR
/build.log"
rm
-f
$LOG
rm
-f
$LOG
if
[
$#
-gt
0
]
;
then
BUILD_DTM
=
0
BUILD_VIPRA_UTIL
=
0
BUILD_VIPRA_CMD
=
0
BUILD_VIPRA_UI
=
0
BUILD_VIPRA_BACKEND
=
0
while
test
$#
-gt
0
do
case
"
$1
"
in
dtm
)
BUILD_DTM
=
1
;;
util
)
BUILD_VIPRA_UTIL
=
1
;;
cmd
)
BUILD_VIPRA_CMD
=
1
;;
ui
)
BUILD_VIPRA_UI
=
1
;;
backend
)
BUILD_VIPRA_BACKEND
=
1
;;
clean
)
CLEAN
=
1
;;
esac
shift
done
fi
if
[
$CLEAN
-eq
1
]
;
then
rm
-rf
$VIPRA_BACKEND
/target
rm
-rf
$VIPRA_CMD
/target
rm
-rf
$VIPRA_UI
/public
rm
-rf
$VIPRA_UTIL
/target
rm
-rf
$DOCKER_WEBAPPS
/
*
rm
-rf
$DOCKER_WEBROOT
/
*
rm
-rf
$VAGRANT_WEBAPPS
/
*
rm
-rf
$VAGRANT_WEBROOT
/
*
touch
$DOCKER_WEBAPPS
/.gitkeep
touch
$DOCKER_WEBROOT
/.gitkeep
touch
$VAGRANT_WEBAPPS
/.gitkeep
touch
$VAGRANT_WEBROOT
/.gitkeep
fi
# check commands
# check commands
if
[
$BUILD_DTM
-eq
1
]
;
then
if
[
$BUILD_DTM
-eq
1
]
;
then
...
@@ -51,45 +107,24 @@ if [ $BUILD_VIPRA_UI -eq 1 ]; then
...
@@ -51,45 +107,24 @@ if [ $BUILD_VIPRA_UI -eq 1 ]; then
GULP
=
$(
command
-v
gulp 2>/dev/null
)
||
{
echo
>
&2
"gulp not found"
;
exit
1
;
}
GULP
=
$(
command
-v
gulp 2>/dev/null
)
||
{
echo
>
&2
"gulp not found"
;
exit
1
;
}
fi
fi
# functions
function
deploy
{
cd
$1
rm
-rf
ROOT ROOT.war
$PROJECT
$WAR_FILE
cp
-r
$2
$3
echo
"-------------------------------"
>>
$LOG
echo
"deploying vipra-backend (
$3
)"
|
tee
-a
$LOG
echo
"-------------------------------"
>>
$LOG
}
# build dtm
# build dtm
echo
""
>>
$LOG
if
[
$BUILD_DTM
-eq
1
]
;
then
echo
"-------------------------------"
>>
$LOG
if
[
$BUILD_DTM
-ne
1
]
;
then
echo
"compiling dtm > skipped"
|
tee
-a
$LOG
else
echo
"compiling dtm"
|
tee
-a
$LOG
echo
"compiling dtm"
|
tee
-a
$LOG
echo
"-------------------------------"
>>
$LOG
cd
$DIR
/dtm_release/dtm
cd
dtm_release/dtm
make
>>
$LOG
2>&1
make
>>
$LOG
2>&1
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"error"
echo
"error"
exit
1
exit
1
fi
fi
cd
../..
cd
$DIR
fi
fi
# build vipra-util
# build vipra-util
echo
""
>>
$LOG
if
[
$BUILD_VIPRA_UTIL
-eq
1
]
;
then
echo
"-------------------------------"
>>
$LOG
if
[
$BUILD_VIPRA_UTIL
-ne
1
]
;
then
echo
"compiling vipra-util > skipped"
|
tee
-a
$LOG
else
echo
"compiling vipra-util"
|
tee
-a
$LOG
echo
"compiling vipra-util"
|
tee
-a
$LOG
echo
"-------------------------------"
>>
$LOG
$MVN
-f
$DIR
/vipra-util/pom.xml
install
>>
$LOG
2>&1
$MVN
-f
./vipra-util/pom.xml
install
>>
$LOG
2>&1
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"error"
echo
"error"
exit
1
exit
1
...
@@ -98,14 +133,9 @@ fi
...
@@ -98,14 +133,9 @@ fi
# build vipra-cmd
# build vipra-cmd
echo
""
>>
$LOG
if
[
$BUILD_VIPRA_CMD
-eq
1
]
;
then
echo
"-------------------------------"
>>
$LOG
if
[
$BUILD_VIPRA_CMD
-ne
1
]
;
then
echo
"compiling vipra-cmd > skipped"
|
tee
-a
$LOG
else
echo
"compiling vipra-cmd"
|
tee
-a
$LOG
echo
"compiling vipra-cmd"
|
tee
-a
$LOG
echo
"-------------------------------"
>>
$LOG
$MVN
-f
$DIR
/vipra-cmd/pom.xml package
>>
$LOG
2>&1
$MVN
-f
./vipra-cmd/pom.xml package
>>
$LOG
2>&1
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"error"
echo
"error"
exit
1
exit
1
...
@@ -114,33 +144,37 @@ fi
...
@@ -114,33 +144,37 @@ fi
# build vipra-ui
# build vipra-ui
echo
""
>>
$LOG
if
[
$BUILD_VIPRA_UI
-eq
1
]
;
then
echo
"-------------------------------"
>>
$LOG
if
[
$BUILD_VIPRA_UI
-ne
1
]
;
then
echo
"compiling vipra-ui > skipped"
|
tee
-a
$LOG
else
echo
"compiling vipra-ui"
|
tee
-a
$LOG
echo
"compiling vipra-ui"
|
tee
-a
$LOG
echo
"-------------------------------"
>>
$LOG
cd
$DIR
/vipra-ui
cd
./vipra-ui
./build.sh
>>
$LOG
2>&1
./build.sh
>>
$LOG
2>&1
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"error"
echo
"error"
exit
1
exit
1
fi
fi
cd
..
cd
$DIR
SRC
=
$UI_PATH
/
*
if
[
$DEPLOY_FRONTEND_TO_DOCKER
-eq
1
]
;
then
rm
-rf
$DOCKER_WEBROOT
/
*
cp
-r
$SRC
$DOCKER_WEBROOT
touch
$DOCKER_WEBROOT
/.gitkeep
fi
if
[
$DEPLOY_FRONTEND_TO_VAGRANT
-eq
1
]
;
then
rm
-rf
$VAGRANT_WEBROOT
/
*
cp
-r
$SRC
$VAGRANT_WEBROOT
touch
$VAGRANT_WEBROOT
/.gitkeep
fi
fi
fi
# build vipra-backend
# build vipra-backend
echo
""
>>
$LOG
if
[
$BUILD_VIPRA_BACKEND
-eq
1
]
;
then
echo
"-------------------------------"
>>
$LOG
if
[
$BUILD_VIPRA_BACKEND
-ne
1
]
;
then
echo
"compiling vipra-backend > skipped"
|
tee
-a
$LOG
else
echo
"compiling vipra-backend"
|
tee
-a
$LOG
echo
"compiling vipra-backend"
|
tee
-a
$LOG
echo
"-------------------------------"
>>
$LOG
$MVN
-f
$DIR
/vipra-backend/pom.xml package
>>
$LOG
2>&1
$MVN
-f
./vipra-backend/pom.xml package
>>
$LOG
2>&1
$MVN
-f
$DIR
/vipra-backend/pom.xml compile war:exploded
>>
$LOG
2>&1
$MVN
-f
./vipra-backend/pom.xml compile war:exploded
>>
$LOG
2>&1
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"error"
echo
"error"
exit
1
exit
1
...
@@ -148,23 +182,29 @@ else
...
@@ -148,23 +182,29 @@ else
SRC
=
$WAR_PATH
SRC
=
$WAR_PATH
TARGET
=
$WAR_FILE
TARGET
=
$WAR_FILE
if
[
$DEPLOY_TO_ROOT
-eq
1
]
;
then
if
[
$DEPLOY_BACKEND_TO_ROOT
-eq
1
]
;
then
TARGET
=
"ROOT.war"
TARGET
=
"ROOT.war"
fi
fi
if
[
$DEPLOY_EXPLODED_WAR
-eq
1
]
;
then
if
[
$DEPLOY_BACKEND_EXPLODED_WAR
-eq
1
]
;
then
SRC
=
$EXPLODED_WAR_PATH
SRC
=
$EXPLODED_WAR_PATH
TARGET
=
$PROJECT
TARGET
=
"vipra"
if
[
$DEPLOY_TO_ROOT
-eq
1
]
;
then
if
[
$DEPLOY_
BACKEND_
TO_ROOT
-eq
1
]
;
then
TARGET
=
"ROOT"
TARGET
=
"ROOT"
fi
fi
fi
fi
if
[
$DEPLOY_TO_DOCKER
-eq
1
]
;
then
if
[
$DEPLOY_BACKEND_TO_DOCKER
-eq
1
]
;
then
deploy
$DOCKER_PATH
$SRC
$TARGET
rm
-rf
$DOCKER_WEBAPPS
/
*
cp
-r
$SRC
$DOCKER_WEBAPPS
/
$TARGET
touch
$DOCKER_WEBAPPS
/.gitkeep
fi
fi
if
[
$DEPLOY_TO_VAGRANT
-eq
1
]
;
then
if
[
$DEPLOY_BACKEND_TO_VAGRANT
-eq
1
]
;
then
deploy
$VAGRANT_PATH
$SRC
$TARGET
rm
-rf
$VAGRANT_WEBAPPS
/
*
cp
-r
$SRC
$VAGRANT_WEBAPPS
/
$TARGET
touch
$VAGRANT_WEBAPPS
/.gitkeep
fi
fi
fi
fi
...
...
This diff is collapsed.
Click to expand it.
docker/.gitignore
0 → 100644
+
2
−
0
View file @
7200b03e
webapps/*
webroot/*
\ No newline at end of file
This diff is collapsed.
Click to expand it.
vipra-ui/app/js/config.js
+
1
−
1
View file @
7200b03e
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
* ^^^^^
* ^^^^^
* this is the restUrl
* this is the restUrl
*/
*/
restUrl
:
'
/
/
'
+
location
.
hostname
+
'
:8080/
rest
'
restUrl
:
'
/rest
'
};
};
})();
})();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
vm/.gitignore
+
3
−
1
View file @
7200b03e
data/
data/
\ No newline at end of file
webapps/*
webroot/*
\ No newline at end of file
This diff is collapsed.
Click to expand it.
vm/webroot/.gitkeep
0 → 100644
+
0
−
0
View file @
7200b03e
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