Skip to content

Commit 7eeedbd

Browse files
authored
Merge pull request #2 from morningman/doris-ui
[CodeRefactor] Modify build.sh and add license for files in doris-ui/
2 parents 659db56 + ecc83e0 commit 7eeedbd

110 files changed

Lines changed: 1491 additions & 341 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ meta
2626
fe_plugins/*/target
2727
fe_plugins/output
2828
fe/mocked
29+
fe/src/main/resources/static/static
2930

3031

3132
#ignore eclipse project file & idea project file

‎build.sh‎

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Usage: $0 <options>
5050
Optional options:
5151
--be build Backend
5252
--fe build Frontend
53+
--fe-ui build Frontend web ui with npm
5354
--clean clean and build target
5455
--with-mysql enable MySQL support(default)
5556
--without-mysql disable MySQL support
@@ -63,6 +64,7 @@ Usage: $0 <options>
6364
$0 --be --without-mysql --without-lzo build Backend with both MySQL and LZO disable
6465
$0 --fe --clean clean and build Frontend
6566
$0 --fe --be --clean clean and build both Frontend and Backend
67+
$0 --fe --fe-ui build Frontend with web UI
6668
"
6769
exit 1
6870
}
@@ -73,6 +75,7 @@ OPTS=$(getopt \
7375
-o 'h' \
7476
-l 'be' \
7577
-l 'fe' \
78+
-l 'fe-ui' \
7679
-l 'clean' \
7780
-l 'with-mysql' \
7881
-l 'without-mysql' \
@@ -98,17 +101,20 @@ if [ $# == 1 ] ; then
98101
# defuat
99102
BUILD_BE=1
100103
BUILD_FE=1
104+
BUILD_FE_UI=1
101105
CLEAN=0
102106
RUN_UT=0
103107
else
104108
BUILD_BE=0
105109
BUILD_FE=0
110+
BUILD_FE_UI=0
106111
CLEAN=0
107112
RUN_UT=0
108113
while true; do
109114
case "$1" in
110115
--be) BUILD_BE=1 ; shift ;;
111116
--fe) BUILD_FE=1 ; shift ;;
117+
--fe-ui) BUILD_FE_UI=1; shift ;;
112118
--clean) CLEAN=1 ; shift ;;
113119
--ut) RUN_UT=1 ; shift ;;
114120
--with-mysql) WITH_MYSQL=ON; shift ;;
@@ -134,12 +140,13 @@ if [ ${CLEAN} -eq 1 -a ${BUILD_BE} -eq 0 -a ${BUILD_FE} -eq 0 ]; then
134140
fi
135141

136142
echo "Get params:
137-
BUILD_BE -- $BUILD_BE
138-
BUILD_FE -- $BUILD_FE
139-
CLEAN -- $CLEAN
140-
RUN_UT -- $RUN_UT
141-
WITH_MYSQL -- $WITH_MYSQL
142-
WITH_LZO -- $WITH_LZO
143+
BUILD_BE -- $BUILD_BE
144+
BUILD_FE -- $BUILD_FE
145+
BUILD_FE_UI -- $BUILD_FE_UI
146+
CLEAN -- $CLEAN
147+
RUN_UT -- $RUN_UT
148+
WITH_MYSQL -- $WITH_MYSQL
149+
WITH_LZO -- $WITH_LZO
143150
"
144151

145152
# Clean and build generated code
@@ -175,15 +182,36 @@ cd ${DORIS_HOME}/docs
175182
./build_help_zip.sh
176183
cd ${DORIS_HOME}
177184

178-
which npm
179-
# Clean and build Frontend
180-
if [ ${BUILD_FE} -eq 1 ] ; then
185+
function build_ui() {
186+
# check NPM env here, not in env.sh.
187+
# Because UI should be considered a non-essential component at runtime.
188+
# Only when the compilation is required, check the relevant compilation environment.
189+
NPM=npm
190+
if ! ${NPM} --version; then
191+
echo "Error: npm is not found"
192+
exit 1
193+
fi
194+
if [[ ! -z ${CUSTOM_NPM_REGISTRY} ]]; then
195+
${NPM} config set registry ${CUSTOM_NPM_REGISTRY}
196+
npm_reg=`${NPM} get registry`
197+
echo "NPM version: npm_reg"
198+
fi
181199
echo "Build Frontend UI"
182200
cd ${DORIS_HOME}/doris-ui
183-
npm install
184-
npm run build
201+
${NPM} install
202+
$NPM run build
203+
rm -rf ${DORIS_HOME}/fe/src/main/resources/static/
185204
mkdir -p ${DORIS_HOME}/fe/src/main/resources/static
186205
cp -r ${DORIS_HOME}/doris-ui/dist/* ${DORIS_HOME}/fe/src/main/resources/static
206+
}
207+
208+
# FE ui must be built before building FE
209+
if [ ${BUILD_FE_UI} -eq 1 ] ; then
210+
build_ui
211+
fi
212+
213+
# Clean and build Frontend
214+
if [ ${BUILD_FE} -eq 1 ] ; then
187215
echo "Build Frontend"
188216
cd ${DORIS_HOME}/fe
189217
if [ ${CLEAN} -eq 1 ]; then

‎doris-ui/.postcssrc.js‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
module.exports = {
219
"plugins": {
320
"postcss-import": {},

‎doris-ui/build/build.js‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
'use strict'
219
require('./check-versions')()
320

‎doris-ui/build/check-versions.js‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
'use strict'
219
const chalk = require('chalk')
320
const semver = require('semver')

‎doris-ui/build/utils.js‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
'use strict'
219
const path = require('path')
320
const config = require('../config')

‎doris-ui/build/vue-loader.conf.js‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
'use strict'
219
const utils = require('./utils')
320
const config = require('../config')

‎doris-ui/build/webpack.base.conf.js‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
'use strict'
219
const path = require('path')
320
const utils = require('./utils')

‎doris-ui/build/webpack.dev.conf.js‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
'use strict'
219
const utils = require('./utils')
320
const webpack = require('webpack')

‎doris-ui/build/webpack.prod.conf.js‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
'use strict'
219
const path = require('path')
320
const utils = require('./utils')

0 commit comments

Comments
 (0)