-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-app.sh
executable file
·31 lines (23 loc) · 1.16 KB
/
create-app.sh
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
#!/bin/sh
PROJECT_NAME=$1
TEMPLATE_PATH=`dirname $(realpath ${BASH_SOURCE[0]})`
TEMPLATE_NAME=`basename ${TEMPLATE_PATH}`
function createApp() {
grails create-webapp ${PROJECT_NAME}-app
cd ${PROJECT_NAME}-app
rm -rf .gitignore buildSrc/ settings.gradle gradle*
cp ${TEMPLATE_PATH}/apps/${TEMPLATE_NAME}-app/build.gradle .
cp ${TEMPLATE_PATH}/apps/${TEMPLATE_NAME}-app/gradle.properties .
cp ${TEMPLATE_PATH}/apps/${TEMPLATE_NAME}-app/grails-app/conf/application.yml ./grails-app/conf
sed -i '' -e "s/${TEMPLATE_NAME}/${PROJECT_NAME}/" ./grails-app/conf/application.yml
cp ${TEMPLATE_PATH}/apps/${TEMPLATE_NAME}-app/grails-app/conf/logback.xml ./grails-app/conf
cp ${TEMPLATE_PATH}/apps/${TEMPLATE_NAME}-app/grails-app/views/index.gsp ./grails-app/views
# Add skaffold
cp ${TEMPLATE_PATH}/apps/${TEMPLATE_NAME}-app/example-values-dev.yaml .
cp -r ${TEMPLATE_PATH}/apps/${TEMPLATE_NAME}-app/chart ./chart
for x in $(grep -l ${TEMPLATE_NAME} $(find . -name "*.yaml" -o -name "*.tpl")); do
sed -i '' -e "s/${TEMPLATE_NAME}/${PROJECT_NAME}/" $x
done
sed -i '' -e "s/${TEMPLATE_NAME}/${PROJECT_NAME}/" ./chart/templates/_helpers.tpl
}
createApp