Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
static-ci
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
90de329d169929cefb791ad900c3dd4f7d227ec6
1 parent
6cfb47d8
deploy to pkg dir
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
7 deletions
apps/ci/build.js
apps/ci/deploy.js
apps/ci/gulpfile.js
apps/models/building.js
apps/ci/build.js
View file @
90de329
...
...
@@ -73,7 +73,7 @@ class Build {
}
get
buildPath
()
{
return
path
.
join
(
config
.
buildDir
,
this
.
project
.
name
,
this
.
buildTime
,
this
.
p
roject
.
n
ame
);
return
path
.
join
(
config
.
buildDir
,
this
.
project
.
name
,
this
.
buildTime
,
this
.
p
kgN
ame
);
}
get
rootPath
()
{
...
...
@@ -238,7 +238,7 @@ class Build {
version
:
this
.
version
});
this
.
_log
(
`
>>>>>>>>>
$
{
state
}
>>>>>>>>>>>
`
);
await
Building
.
updateState
(
this
.
bid
,
state
,
this
.
version
);
await
Building
.
updateState
(
this
.
bid
,
state
,
this
.
version
,
this
.
pkgName
);
}
_log
(
line
)
{
...
...
apps/ci/deploy.js
View file @
90de329
...
...
@@ -50,7 +50,7 @@ class Deploy {
self
.
_state
(
'deploy code'
);
sh
.
cd
(
config
.
ci
);
let
child
=
sh
.
exec
(
`
gulp
upQiniu
--
name
=
$
{
self
.
project
.
name
}
--
time
=
$
{
self
.
building
.
buildTime
}
`
,
{
let
child
=
sh
.
exec
(
`
gulp
upQiniu
--
name
=
$
{
self
.
project
.
name
}
--
time
=
$
{
self
.
building
.
buildTime
}
--
pkg
=
$
{
self
.
pkgName
}
`
,
{
async
:
true
});
...
...
apps/ci/gulpfile.js
View file @
90de329
...
...
@@ -11,19 +11,20 @@ gulp.task('upQiniu', () => {
let
name
=
args
[
0
].
replace
(
'--name='
,
''
);
let
time
=
args
[
1
].
replace
(
'--time='
,
''
);
let
pkg
=
args
[
2
].
replace
(
'--pkg='
,
''
);
if
(
!
name
||
!
time
)
{
if
(
!
name
||
!
time
||
!
pkg
)
{
return
;
}
// 找到对应项目对应的版本的静态资源上传至七牛cdn
gulp
.
src
(
path
.
join
(
__dirname
,
`
..
/
..
/
packages
/
$
{
name
}
/${time}/
$
{
name
}
/**`
))
.pipe
(
gulp
.
src
(
path
.
join
(
__dirname
,
`
..
/
..
/
packages
/
$
{
name
}
/${time}/
$
{
pkg
}
/**`
))
.pipe
(
qiniu
({
accessKey
:
'cY9B5ZgON_7McTS5zV5nTeRyQ98MOcVD7W4eGVbE'
,
secretKey
:
'RduqgmK7cAtaQvdIa1ax_zzmMsnv9ac-Ka0uF6wG'
,
bucket
:
'yohocdn'
},
{
dir
:
name
dir
:
pkg
})
);
});
\ No newline at end of file
...
...
apps/models/building.js
View file @
90de329
...
...
@@ -8,13 +8,14 @@ class Building extends Model {
super
(
'buildings'
);
}
async
updateState
(
id
,
state
,
version
)
{
async
updateState
(
id
,
state
,
version
,
pkgName
)
{
await
this
.
update
({
_id
:
id
},
{
$set
:
{
state
:
state
,
version
:
version
,
pkgName
:
pkgName
,
updatedAt
:
new
Date
()
}
});
...
...
Please
register
or
login
to post a comment