Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0d3682e6
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0d3682e6
编写于
10月 02, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix strict null errors in tfs
上级
ddc5eeee
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
13 deletion
+13
-13
build/tfs/common/publish.ts
build/tfs/common/publish.ts
+10
-10
build/tfs/darwin/enqueue.ts
build/tfs/darwin/enqueue.ts
+2
-2
build/tfs/linux/frozen-check.ts
build/tfs/linux/frozen-check.ts
+1
-1
未找到文件。
build/tfs/common/publish.ts
浏览文件 @
0d3682e6
...
...
@@ -43,7 +43,7 @@ function createDefaultConfig(quality: string): Config {
}
function
getConfig
(
quality
:
string
):
Promise
<
Config
>
{
const
client
=
new
DocumentClient
(
process
.
env
[
'
AZURE_DOCUMENTDB_ENDPOINT
'
],
{
masterKey
:
process
.
env
[
'
AZURE_DOCUMENTDB_MASTERKEY
'
]
});
const
client
=
new
DocumentClient
(
process
.
env
[
'
AZURE_DOCUMENTDB_ENDPOINT
'
]
!
,
{
masterKey
:
process
.
env
[
'
AZURE_DOCUMENTDB_MASTERKEY
'
]
});
const
collection
=
'
dbs/builds/colls/config
'
;
const
query
=
{
query
:
`SELECT TOP 1 * FROM c WHERE c.id = @quality`
,
...
...
@@ -73,7 +73,7 @@ interface Asset {
}
function
createOrUpdate
(
commit
:
string
,
quality
:
string
,
platform
:
string
,
type
:
string
,
release
:
NewDocument
,
asset
:
Asset
,
isUpdate
:
boolean
):
Promise
<
void
>
{
const
client
=
new
DocumentClient
(
process
.
env
[
'
AZURE_DOCUMENTDB_ENDPOINT
'
],
{
masterKey
:
process
.
env
[
'
AZURE_DOCUMENTDB_MASTERKEY
'
]
});
const
client
=
new
DocumentClient
(
process
.
env
[
'
AZURE_DOCUMENTDB_ENDPOINT
'
]
!
,
{
masterKey
:
process
.
env
[
'
AZURE_DOCUMENTDB_MASTERKEY
'
]
});
const
collection
=
'
dbs/builds/colls/
'
+
quality
;
const
updateQuery
=
{
query
:
'
SELECT TOP 1 * FROM c WHERE c.id = @id
'
,
...
...
@@ -127,7 +127,7 @@ async function assertContainer(blobService: azure.BlobService, quality: string):
await
new
Promise
((
c
,
e
)
=>
blobService
.
createContainerIfNotExists
(
quality
,
{
publicAccessLevel
:
'
blob
'
},
err
=>
err
?
e
(
err
)
:
c
()));
}
async
function
doesAssetExist
(
blobService
:
azure
.
BlobService
,
quality
:
string
,
blobName
:
string
):
Promise
<
boolean
>
{
async
function
doesAssetExist
(
blobService
:
azure
.
BlobService
,
quality
:
string
,
blobName
:
string
):
Promise
<
boolean
|
undefined
>
{
const
existsResult
=
await
new
Promise
<
azure
.
BlobService
.
BlobResult
>
((
c
,
e
)
=>
blobService
.
doesBlobExist
(
quality
,
blobName
,
(
err
,
r
)
=>
err
?
e
(
err
)
:
c
(
r
)));
return
existsResult
.
exists
;
}
...
...
@@ -150,8 +150,8 @@ interface PublishOptions {
async
function
publish
(
commit
:
string
,
quality
:
string
,
platform
:
string
,
type
:
string
,
name
:
string
,
version
:
string
,
_isUpdate
:
string
,
file
:
string
,
opts
:
PublishOptions
):
Promise
<
void
>
{
const
isUpdate
=
_isUpdate
===
'
true
'
;
const
queuedBy
=
process
.
env
[
'
BUILD_QUEUEDBY
'
];
const
sourceBranch
=
process
.
env
[
'
BUILD_SOURCEBRANCH
'
];
const
queuedBy
=
process
.
env
[
'
BUILD_QUEUEDBY
'
]
!
;
const
sourceBranch
=
process
.
env
[
'
BUILD_SOURCEBRANCH
'
]
!
;
const
isReleased
=
(
quality
===
'
insider
'
||
quality
===
'
exploration
'
)
&&
/^master$|^refs
\/
heads
\/
master$/
.
test
(
sourceBranch
)
&&
/Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/
.
test
(
queuedBy
);
...
...
@@ -179,12 +179,12 @@ async function publish(commit: string, quality: string, platform: string, type:
console
.
log
(
'
SHA256:
'
,
sha256hash
);
const
blobName
=
commit
+
'
/
'
+
name
;
const
storageAccount
=
process
.
env
[
'
AZURE_STORAGE_ACCOUNT_2
'
];
const
storageAccount
=
process
.
env
[
'
AZURE_STORAGE_ACCOUNT_2
'
]
!
;
const
blobService
=
azure
.
createBlobService
(
storageAccount
,
process
.
env
[
'
AZURE_STORAGE_ACCESS_KEY_2
'
])
const
blobService
=
azure
.
createBlobService
(
storageAccount
,
process
.
env
[
'
AZURE_STORAGE_ACCESS_KEY_2
'
]
!
)
.
withFilter
(
new
azure
.
ExponentialRetryPolicyFilter
(
20
));
const
mooncakeBlobService
=
azure
.
createBlobService
(
storageAccount
,
process
.
env
[
'
MOONCAKE_STORAGE_ACCESS_KEY
'
],
`
${
storageAccount
}
.blob.core.chinacloudapi.cn`
)
const
mooncakeBlobService
=
azure
.
createBlobService
(
storageAccount
,
process
.
env
[
'
MOONCAKE_STORAGE_ACCESS_KEY
'
]
!
,
`
${
storageAccount
}
.blob.core.chinacloudapi.cn`
)
.
withFilter
(
new
azure
.
ExponentialRetryPolicyFilter
(
20
));
// mooncake is fussy and far away, this is needed!
...
...
@@ -200,7 +200,7 @@ async function publish(commit: string, quality: string, platform: string, type:
doesAssetExist
(
mooncakeBlobService
,
quality
,
blobName
)
]);
const
promises
=
[];
const
promises
:
Array
<
Promise
<
void
>>
=
[];
if
(
!
blobExists
)
{
promises
.
push
(
uploadBlob
(
blobService
,
quality
,
blobName
,
file
));
...
...
@@ -249,7 +249,7 @@ async function publish(commit: string, quality: string, platform: string, type:
isReleased
:
config
.
frozen
?
false
:
isReleased
,
sourceBranch
,
queuedBy
,
assets
:
[],
assets
:
[]
as
Array
<
Asset
>
,
updates
:
{}
as
any
};
...
...
build/tfs/darwin/enqueue.ts
浏览文件 @
0d3682e6
...
...
@@ -20,7 +20,7 @@ interface Asset {
function
queueSigningRequest
(
quality
:
string
,
commit
:
string
):
Promise
<
void
>
{
const
retryOperations
=
new
azure
.
ExponentialRetryPolicyFilter
();
const
queueSvc
=
azure
.
createQueueService
(
process
.
env
[
'
AZURE_STORAGE_ACCOUNT_2
'
]
,
process
.
env
[
'
AZURE_STORAGE_ACCESS_KEY_2
'
]
)
.
createQueueService
(
process
.
env
[
'
AZURE_STORAGE_ACCOUNT_2
'
]
!
,
process
.
env
[
'
AZURE_STORAGE_ACCESS_KEY_2
'
]
!
)
.
withFilter
(
retryOperations
);
queueSvc
.
messageEncoder
=
new
azure
.
QueueMessageEncoder
.
TextBase64QueueMessageEncoder
();
...
...
@@ -31,7 +31,7 @@ function queueSigningRequest(quality: string, commit: string): Promise<void> {
}
function
isBuildSigned
(
quality
:
string
,
commit
:
string
):
Promise
<
boolean
>
{
const
client
=
new
DocumentClient
(
process
.
env
[
'
AZURE_DOCUMENTDB_ENDPOINT
'
],
{
masterKey
:
process
.
env
[
'
AZURE_DOCUMENTDB_MASTERKEY
'
]
});
const
client
=
new
DocumentClient
(
process
.
env
[
'
AZURE_DOCUMENTDB_ENDPOINT
'
]
!
,
{
masterKey
:
process
.
env
[
'
AZURE_DOCUMENTDB_MASTERKEY
'
]
});
const
collection
=
'
dbs/builds/colls/
'
+
quality
;
const
updateQuery
=
{
query
:
'
SELECT TOP 1 * FROM c WHERE c.id = @id
'
,
...
...
build/tfs/linux/frozen-check.ts
浏览文件 @
0d3682e6
...
...
@@ -20,7 +20,7 @@ function createDefaultConfig(quality: string): Config {
}
function
getConfig
(
quality
:
string
):
Promise
<
Config
>
{
const
client
=
new
DocumentClient
(
process
.
env
[
'
AZURE_DOCUMENTDB_ENDPOINT
'
],
{
masterKey
:
process
.
env
[
'
AZURE_DOCUMENTDB_MASTERKEY
'
]
});
const
client
=
new
DocumentClient
(
process
.
env
[
'
AZURE_DOCUMENTDB_ENDPOINT
'
]
!
,
{
masterKey
:
process
.
env
[
'
AZURE_DOCUMENTDB_MASTERKEY
'
]
});
const
collection
=
'
dbs/builds/colls/config
'
;
const
query
=
{
query
:
`SELECT TOP 1 * FROM c WHERE c.id = @quality`
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录