Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
1781905f
Commit
1781905f
authored
Dec 28, 2020
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add .gitllab-ci.yml
parent
c1344777
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
146 additions
and
7 deletions
+146
-7
.gitlab-ci.yml
.gitlab-ci.yml
+97
-0
clean.js
internals/webpack/clean.js
+43
-1
webpack.base.babel.js
internals/webpack/webpack.base.babel.js
+3
-3
webpack.prod.babel.js
internals/webpack/webpack.prod.babel.js
+2
-2
package.json
package.json
+1
-1
No files found.
.gitlab-ci.yml
0 → 100644
View file @
1781905f
variables
:
TARGET_REPO_2021
:
"
F:/CIV_CI/CivWebPublish2021_CIVWeb5/CivWebPublish2021/"
TARGET_REPO_2020
:
"
F:/CIV_CI/CivWebPublish2021_CIVWeb5/CivWebPublish2020"
TARGET_REPO_2019
:
"
F:/CIV_CI/CivWebPublish2021_CIVWeb5/CivWebPublish/"
before_script
:
-
chcp 65001
-
'
git
config
core.autocrlf
false'
stages
:
-
install
-
package
-
push
install
:
stage
:
install
script
:
-
npm install
cache
:
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
node_modules/
only
:
refs
:
-
master
variables
:
-
$NPM_INSTALL == "true"
when
:
manual
package
:
stage
:
package
script
:
-
echo "${CI_PROJECT_DIR}"
-
npm run build --releasepath=../CivWebPublish2021
cache
:
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
node_modules/
only
:
-
master
when
:
manual
push_2021
:
variables
:
GIT_STRATEGY
:
none
stage
:
push
script
:
-
'
cd
"${TARGET_REPO_2021}"'
-
'
git
reset
--hard
head'
-
'
git
clean
-fd'
-
'
git
remote
set-url
origin
"https://${GIT_ACCESS_USER}:${GIT_ACCESS_PASSWORD}@g.civnet.cn:8443/CivPublish/CivWebPublish2021.git"'
-
'
git
pull
origin
map'
-
'
robocopy
"${CI_PROJECT_DIR}/../CivWebPublish2021/civmanage"
"${TARGET_REPO_2021}/civmanage"
/S
;
IF
((${LASTEXITCODE}
-le
8))
{cmd
/c
"exit
/b
0"}'
-
'
git
add
.
;
git
reset
HEAD
Web.config
CityInterface/Web.config
CityWebFW/Web.config
;
git
commit
-m
"auto
package
civmanage."'
#- 'git push origin map'
only
:
-
master
when
:
manual
push_2020
:
variables
:
GIT_STRATEGY
:
none
stage
:
push
script
:
-
'
cd
"${TARGET_REPO_2020}"'
-
'
git
reset
--hard
head'
-
'
git
clean
-fd'
-
'
git
remote
set-url
origin
"https://${GIT_ACCESS_USER}:${GIT_ACCESS_PASSWORD}@g.civnet.cn:8443/CivPublish/CivWebPublish2020.git"'
-
'
git
pull
origin
map'
-
'
robocopy
"${CI_PROJECT_DIR}/../CivWebPublish2021/civmanage"
"${TARGET_REPO_2020}/civmanage"
/S
;
IF
((${LASTEXITCODE}
-le
8))
{cmd
/c
"exit
/b
0"}'
-
'
git
add
.
;
git
reset
HEAD
Web.config
CityInterface/Web.config
CityWebFW/Web.config
;
git
commit
-m
"auto
package
civmanage."'
#- 'git push origin map'
only
:
-
master
when
:
manual
push_2019
:
variables
:
GIT_STRATEGY
:
none
stage
:
push
script
:
-
'
cd
"${TARGET_REPO_2019}"'
-
'
git
reset
--hard
head'
-
'
git
clean
-fd'
-
'
git
remote
set-url
origin
"https://${GIT_ACCESS_USER}:${GIT_ACCESS_PASSWORD}@g.civnet.cn:8443/CivPublish/CivWebPublish.git"'
-
'
git
pull
origin
map'
-
'
robocopy
"${CI_PROJECT_DIR}/../CivWebPublish2021/civmanage"
"${TARGET_REPO_2019}/civmanage"
/S
;
IF
((${LASTEXITCODE}
-le
8))
{cmd
/c
"exit
/b
0"}'
-
'
git
add
.
;
git
reset
HEAD
Web.config
CityInterface/Web.config
CityWebFW/Web.config
;
git
commit
-m
"auto
package
civmanage."'
#- 'git push origin map'
only
:
-
master
when
:
manual
internals/webpack/clean.js
View file @
1781905f
const
rm
=
require
(
'rimraf'
);
const
rm
=
require
(
'rimraf'
);
const
path
=
require
(
'path'
);
const
path
=
require
(
'path'
);
rm
(
process
.
env
.
npm_config_releasepath
?
path
.
resolve
(
process
.
env
.
npm_config_releasepath
,
'CivManage'
):
`./CivManage`
,
err
=>
{
const
webpack
=
require
(
'webpack'
);
const
chalk
=
require
(
'chalk'
);
const
ora
=
require
(
'ora'
)
const
webpackConfig
=
require
(
'./webpack.prod.babel'
)
const
spinner
=
ora
(
'building for production...'
);
// const Diff = require('diff');
/* eslint-disable */
spinner
.
start
()
rm
(
process
.
env
.
npm_config_releasepath
?
path
.
resolve
(
process
.
env
.
npm_config_releasepath
,
'civmanage'
,
)
:
`./civmanage`
,
err
=>
{
if
(
err
)
throw
err
if
(
err
)
throw
err
// eslint-disable-next-line no-shadow
webpack
(
webpackConfig
,
function
(
err
,
stats
)
{
spinner
.
stop
()
if
(
err
)
throw
err
process
.
stdout
.
write
(
`
${
stats
.
toString
({
colors
:
true
,
color
:
true
,
progress
:
true
,
modules
:
false
,
children
:
false
,
chunks
:
true
,
chunkModules
:
true
})
}
\n\n`
)
if
(
stats
.
hasErrors
())
{
console
.
log
(
chalk
.
red
(
' Build failed with errors.
\
n'
))
process
.
exit
(
1
)
}
console
.
log
(
chalk
.
cyan
(
' Build complete.
\
n'
))
console
.
log
(
chalk
.
yellow
(
' Tip: built files are meant to be served over an HTTP server.
\
n'
+
' Opening index.html over file:// won
\'
t work.
\
n'
))
})
})
})
internals/webpack/webpack.base.babel.js
View file @
1781905f
...
@@ -8,8 +8,8 @@ module.exports = options => ({
...
@@ -8,8 +8,8 @@ module.exports = options => ({
entry
:
options
.
entry
,
entry
:
options
.
entry
,
output
:
Object
.
assign
(
output
:
Object
.
assign
(
{
{
path
:
process
.
env
.
npm_config_releasepath
?
path
.
resolve
(
process
.
env
.
npm_config_releasepath
,
'
CivManage'
):
path
.
resolve
(
process
.
cwd
(),
'CivM
anage'
),
path
:
process
.
env
.
npm_config_releasepath
?
path
.
resolve
(
process
.
env
.
npm_config_releasepath
,
'
civmanage'
):
path
.
resolve
(
process
.
cwd
(),
'civm
anage'
),
publicPath
:
process
.
env
.
PUBLIC_PATH
||
'/
CivM
anage/'
,
publicPath
:
process
.
env
.
PUBLIC_PATH
||
'/
civm
anage/'
,
},
},
options
.
output
,
options
.
output
,
),
// Merge with env dependent settings
),
// Merge with env dependent settings
...
@@ -116,7 +116,7 @@ module.exports = options => ({
...
@@ -116,7 +116,7 @@ module.exports = options => ({
// Inline files smaller than 10 kB
// Inline files smaller than 10 kB
limit
:
10
*
1024
,
limit
:
10
*
1024
,
outputPath
:
'assets/'
,
outputPath
:
'assets/'
,
name
:
'[name].[ext]'
//
name: '[name].[ext]'
},
},
},
},
// {
// {
...
...
internals/webpack/webpack.prod.babel.js
View file @
1781905f
...
@@ -19,8 +19,8 @@ module.exports = require('./webpack.base.babel')({
...
@@ -19,8 +19,8 @@ module.exports = require('./webpack.base.babel')({
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
//[chunkhash:8] [chunkhash:8]
//[chunkhash:8] [chunkhash:8]
output
:
{
output
:
{
filename
:
'static/[name].js'
,
filename
:
'static/[name].
[chunkhash:8].
js'
,
chunkFilename
:
'static/[name].chunk.js'
,
chunkFilename
:
'static/[name].
[chunkhash:8].
chunk.js'
,
},
},
optimization
:
{
optimization
:
{
...
...
package.json
View file @
1781905f
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
"analyze"
:
"node ./internals/scripts/analyze.js"
,
"analyze"
:
"node ./internals/scripts/analyze.js"
,
"npmcheckversion"
:
"node ./internals/scripts/npmcheckversion.js"
,
"npmcheckversion"
:
"node ./internals/scripts/npmcheckversion.js"
,
"preinstall"
:
"npm run npmcheckversion"
,
"preinstall"
:
"npm run npmcheckversion"
,
"build"
:
"cross-env NODE_ENV=production
webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout
"
,
"build"
:
"cross-env NODE_ENV=production
node internals/webpack/clean.js
"
,
"build:inspect"
:
"cross-env NODE_ENV=production node --inspect-brk ./node_modules/webpack/bin/webpack.js --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout"
,
"build:inspect"
:
"cross-env NODE_ENV=production node --inspect-brk ./node_modules/webpack/bin/webpack.js --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout"
,
"build:clean"
:
"node ./internals/webpack/clean.js"
,
"build:clean"
:
"node ./internals/webpack/clean.js"
,
"start"
:
"cross-env NODE_ENV=development node server"
,
"start"
:
"cross-env NODE_ENV=development node server"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment