Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bae7a2b1
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,发现更多精彩内容 >>
提交
bae7a2b1
编写于
11月 08, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cleanup build folder
上级
605139f4
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
0 addition
and
725 deletion
+0
-725
build/tfs/darwin/enqueue.js
build/tfs/darwin/enqueue.js
+0
-29
build/tfs/darwin/enqueue.ts
build/tfs/darwin/enqueue.ts
+0
-41
build/tfs/linux/frozen-check.ts
build/tfs/linux/frozen-check.ts
+0
-49
build/tfs/linux/ia32/Dockerfile
build/tfs/linux/ia32/Dockerfile
+0
-53
build/tfs/linux/ia32/run-agent.sh
build/tfs/linux/ia32/run-agent.sh
+0
-15
build/tfs/linux/ia32/xvfb.init
build/tfs/linux/ia32/xvfb.init
+0
-53
build/tfs/linux/new_package.json.template
build/tfs/linux/new_package.json.template
+0
-6
build/tfs/linux/repoapi_client.sh
build/tfs/linux/repoapi_client.sh
+0
-365
build/tfs/linux/x64/Dockerfile
build/tfs/linux/x64/Dockerfile
+0
-46
build/tfs/linux/x64/run-agent.sh
build/tfs/linux/x64/run-agent.sh
+0
-15
build/tfs/linux/x64/xvfb.init
build/tfs/linux/x64/xvfb.init
+0
-53
未找到文件。
build/tfs/darwin/enqueue.js
已删除
100644 → 0
浏览文件 @
605139f4
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
const
child_process_1
=
require
(
"
child_process
"
);
const
azure
=
require
(
"
azure-storage
"
);
function
queueSigningRequest
(
quality
,
commit
)
{
const
retryOperations
=
new
azure
.
ExponentialRetryPolicyFilter
();
const
queueSvc
=
azure
.
createQueueService
(
process
.
env
[
'
AZURE_STORAGE_ACCOUNT_2
'
],
process
.
env
[
'
AZURE_STORAGE_ACCESS_KEY_2
'
])
.
withFilter
(
retryOperations
);
queueSvc
.
messageEncoder
=
new
azure
.
QueueMessageEncoder
.
TextBase64QueueMessageEncoder
();
const
message
=
`
${
quality
}
/
${
commit
}
`
;
return
new
Promise
((
c
,
e
)
=>
queueSvc
.
createMessage
(
'
sign-darwin
'
,
message
,
err
=>
err
?
e
(
err
)
:
c
()));
}
async
function
main
(
quality
)
{
const
commit
=
child_process_1
.
execSync
(
'
git rev-parse HEAD
'
,
{
encoding
:
'
utf8
'
}).
trim
();
console
.
log
(
`Queueing signing request for '
${
quality
}
/
${
commit
}
'...`
);
await
queueSigningRequest
(
quality
,
commit
);
// console.log('Waiting on signed build...');
// await waitForSignedBuild(quality, commit);
// console.log('Found signed build!');
}
main
(
process
.
argv
[
2
]).
catch
(
err
=>
{
console
.
error
(
err
);
process
.
exit
(
1
);
});
build/tfs/darwin/enqueue.ts
已删除
100644 → 0
浏览文件 @
605139f4
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
execSync
}
from
'
child_process
'
;
import
*
as
azure
from
'
azure-storage
'
;
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
'
]
!
)
.
withFilter
(
retryOperations
);
queueSvc
.
messageEncoder
=
new
azure
.
QueueMessageEncoder
.
TextBase64QueueMessageEncoder
();
const
message
=
`
${
quality
}
/
${
commit
}
`
;
return
new
Promise
<
void
>
((
c
,
e
)
=>
queueSvc
.
createMessage
(
'
sign-darwin
'
,
message
,
err
=>
err
?
e
(
err
)
:
c
()));
}
async
function
main
(
quality
:
string
):
Promise
<
void
>
{
const
commit
=
execSync
(
'
git rev-parse HEAD
'
,
{
encoding
:
'
utf8
'
}).
trim
();
console
.
log
(
`Queueing signing request for '
${
quality
}
/
${
commit
}
'...`
);
await
queueSigningRequest
(
quality
,
commit
);
// console.log('Waiting on signed build...');
// await waitForSignedBuild(quality, commit);
// console.log('Found signed build!');
}
main
(
process
.
argv
[
2
]).
catch
(
err
=>
{
console
.
error
(
err
);
process
.
exit
(
1
);
});
\ No newline at end of file
build/tfs/linux/frozen-check.ts
已删除
100644 → 0
浏览文件 @
605139f4
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
DocumentClient
}
from
'
documentdb
'
;
interface
Config
{
id
:
string
;
frozen
:
boolean
;
}
function
createDefaultConfig
(
quality
:
string
):
Config
{
return
{
id
:
quality
,
frozen
:
false
};
}
function
getConfig
(
quality
:
string
):
Promise
<
Config
>
{
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`
,
parameters
:
[
{
name
:
'
@quality
'
,
value
:
quality
}
]
};
return
new
Promise
<
Config
>
((
c
,
e
)
=>
{
client
.
queryDocuments
(
collection
,
query
).
toArray
((
err
,
results
)
=>
{
if
(
err
&&
err
.
code
!==
409
)
{
return
e
(
err
);
}
c
(
!
results
||
results
.
length
===
0
?
createDefaultConfig
(
quality
)
:
results
[
0
]
as
any
as
Config
);
});
});
}
getConfig
(
process
.
argv
[
2
])
.
then
(
config
=>
{
console
.
log
(
config
.
frozen
);
process
.
exit
(
0
);
})
.
catch
(
err
=>
{
console
.
error
(
err
);
process
.
exit
(
1
);
});
\ No newline at end of file
build/tfs/linux/ia32/Dockerfile
已删除
100644 → 0
浏览文件 @
605139f4
FROM
microsoft/vsts-agent:ubuntu-14.04-standard
MAINTAINER
Joao Moreno <joao.moreno@microsoft.com>
ARG
DEBIAN_FRONTEND=noninteractive
RUN
dpkg
--add-architecture
i386
RUN
apt-get update
# Dependencies
RUN
apt-get
install
-y
build-essential
RUN
apt-get
install
-y
gcc-multilib g++-multilib
RUN
apt-get
install
-y
git
RUN
apt-get
install
-y
zip
RUN
apt-get
install
-y
rpm
RUN
apt-get
install
-y
createrepo
RUN
apt-get
install
-y
python-gtk2
RUN
apt-get
install
-y
jq
RUN
apt-get
install
-y
xvfb
RUN
apt-get
install
-y
fakeroot
RUN
apt-get
install
-y
libgtk2.0-0:i386
RUN
apt-get
install
-y
libgconf-2-4:i386
RUN
apt-get
install
-y
libnss3:i386
RUN
apt-get
install
-y
libasound2:i386
RUN
apt-get
install
-y
libxtst6:i386
RUN
apt-get
install
-y
libfuse2
RUN
apt-get
install
-y
libnotify-bin
RUN
apt-get
install
-y
libnotify4:i386
RUN
apt-get
install
-y
libx11-dev:i386
RUN
apt-get
install
-y
libxkbfile-dev:i386
RUN
apt-get
install
-y
libxss1:i386
RUN
apt-get
install
-y
libx11-xcb-dev:i386
RUN
apt-get
install
-y
libgl1-mesa-glx:i386 libgl1-mesa-dri:i386
RUN
apt-get
install
-y
libxkbfile-dev
RUN
apt-get
install
-y
bc bsdmainutils
RUN
apt-get
install
-y
libgirepository-1.0-1:i386 gir1.2-glib-2.0:i386 gir1.2-secret-1:i386 libsecret-1-dev:i386
RUN
apt-get
install
-y
dpkg-dev:i386
# Xvfb
# Thanks https://medium.com/@griggheo/running-headless-selenium-webdriver-tests-in-docker-containers-342fdbabf756
ADD
xvfb.init /etc/init.d/xvfb
RUN
chmod
+x /etc/init.d/xvfb
RUN
update-rc.d xvfb defaults
# dbus
RUN
ln
-sf
/bin/dbus-daemon /usr/bin/dbus-daemon
# nvm
ENV
NVM_DIR /usr/local/nvm
RUN
curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
# for libsecret
ENV
PKG_CONFIG_PATH /usr/lib/i386-linux-gnu/pkgconfig
CMD
(service xvfb start; service dbus start; export DISPLAY=:10; ./start.sh)
\ No newline at end of file
build/tfs/linux/ia32/run-agent.sh
已删除
100755 → 0
浏览文件 @
605139f4
#!/bin/bash
if
[
!
-f
pat
]
;
then
echo
"Error: file pat not found"
exit
1
fi
docker run
\
-e
VSTS_ACCOUNT
=
"monacotools"
\
-e
VSTS_TOKEN
=
"
$(
cat
pat
)
"
\
-e
VSTS_AGENT
=
"tb-lnx-ia32-local"
\
-e
VSTS_POOL
=
"linux-ia32"
\
-e
VSTS_WORK
=
"/var/vsts/work"
\
--name
"tb-lnx-ia32-local"
\
-it
joaomoreno/vscode-vso-agent-ia32:latest
\ No newline at end of file
build/tfs/linux/ia32/xvfb.init
已删除
100644 → 0
浏览文件 @
605139f4
#!/bin/bash
#
# /etc/rc.d/init.d/xvfbd
#
# chkconfig: 345 95 28
# description: Starts/Stops X Virtual Framebuffer server
# processname: Xvfb
#
### BEGIN INIT INFO
# Provides: xvfb
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start xvfb at boot time
# Description: Enable xvfb provided by daemon.
### END INIT INFO
[
"
${
NETWORKING
}
"
=
"no"
]
&&
exit
0
PROG
=
"/usr/bin/Xvfb"
PROG_OPTIONS
=
":10 -ac"
PROG_OUTPUT
=
"/tmp/Xvfb.out"
case
"
$1
"
in
start
)
echo
"Starting : X Virtual Frame Buffer "
$PROG
$PROG_OPTIONS
>>
$PROG_OUTPUT
2>&1 &
disown
-ar
;;
stop
)
echo
"Shutting down : X Virtual Frame Buffer"
killproc
$PROG
RETVAL
=
$?
[
$RETVAL
-eq
0
]
&&
/bin/rm
-f
/var/lock/subsys/Xvfb
/var/run/Xvfb.pid
echo
;;
restart|reload
)
$0
stop
$0
start
RETVAL
=
$?
;;
status
)
status Xvfb
RETVAL
=
$?
;;
*
)
echo
$"Usage:
$0
(start|stop|restart|reload|status)"
exit
1
esac
exit
$RETVAL
\ No newline at end of file
build/tfs/linux/new_package.json.template
已删除
100644 → 0
浏览文件 @
605139f4
{
"name": "PACKAGENAME",
"version": "PACKAGEVERSION",
"repositoryId": "REPOSITORYID",
"sourceUrl": "PACKAGEURL"
}
\ No newline at end of file
build/tfs/linux/repoapi_client.sh
已删除
100755 → 0
浏览文件 @
605139f4
#!/bin/bash -e
# This is a VERY basic script for Create/Delete operations on repos and packages
#
cmd
=
$1
docDir
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
# chrmarti: Changed to script's directory.
packageJsonTemplate
=
$docDir
/new_package.json.template
repoJsonTemplate
=
$docDir
/new_repo.json.template
function
Bail
{
echo
"ERROR:
$@
"
exit
1
}
function
BailIfFileMissing
{
file
=
"
$1
"
if
[
!
-f
"
$file
"
]
;
then
Bail
"File
$file
does not exist"
fi
}
function
Usage
{
echo
"USAGE: Manage repos and packages in an apt repository"
echo
"
$0
-config FILENAME -listrepos | -listpkgs | -addrepo FILENAME | -addpkg FILENAME |"
echo
"-addpkgs FILENAME | -check ID | -delrepo REPOID | -delpkg PKGID"
echo
-e
"
\t
-config FILENAME : JSON file containing API server name and creds"
echo
-e
"Package Operations:"
echo
-e
"
\t
-listpkgs [REGEX] : List packages, optionally filter by REGEX"
echo
-e
"
\t
-addpkg FILENAME : Add package to repo using the specified JSON file"
echo
-e
"
\t
-addpkgs FILENAME : Add packages to repo using urls contained in FILENAME"
echo
-e
"
\t
-check ID : Check upload operation by ID"
echo
-e
"
\t
-delpkg PKGID : Delete the specified package by ID"
echo
-e
"File Operations:"
echo
-e
"
\t
-uploadfile FILENAME: Upload FILENAME (does not publish) "
echo
-e
"
\t
-addfile FILENAME : Upload FILENAME AND publish to the repo"
echo
-e
"
\t
-listfiles : List uploaded files"
echo
-e
"
\t
-delfile FILEID : Delete uploaded file by ID"
echo
-e
"Repository Operations:"
echo
-e
"
\t
-listrepos : List repositories"
echo
-e
"
\t
-addrepo FILENAME : Create a new repo using the specified JSON file"
echo
-e
"
\t
-delrepo REPOID : Delete the specified repo by ID"
exit
1
}
function
ParseFromJson
{
if
[
-z
"
$secretContents
"
]
;
then
Bail
"Unable to parse value because no JSON contents were specified"
elif
[
-z
"
$1
"
]
;
then
Bail
"Unable to parse value from JSON because no key was specified"
fi
# Write value directly to stdout to be used by caller
echo
$secretContents
| jq
"
$1
"
|
tr
-d
'"'
}
function
ParseConfigFile
{
configFile
=
"
$1
"
if
[
-z
"
$configFile
"
]
;
then
echo
"Must specify -config option"
Usage
fi
BailIfFileMissing
"
$configFile
"
secretContents
=
$(
cat
"
$configFile
"
)
server
=
$(
ParseFromJson .server
)
protocol
=
$(
ParseFromJson .protocol
)
port
=
$(
ParseFromJson .port
)
repositoryId
=
$(
ParseFromJson .repositoryId
)
user
=
$(
ParseFromJson .username
)
pass
=
$(
ParseFromJson .password
)
baseurl
=
"
$protocol
://
$user
:
$pass
@
$server
:
$port
"
}
# List Repositories
function
ListRepositories
{
echo
"Fetching repo list from
$server
..."
curl
-k
"
$baseurl
/v1/repositories"
|
sed
's/,/,\n/g'
|
sed
's/^"/\t"/g'
echo
""
}
# List packages, using $1 as a regex to filter results
function
ListPackages
{
echo
"Fetching package list from
$server
"
curl
-k
"
$baseurl
/v1/packages"
|
sed
's/{/\n{/g'
| egrep
"
$1
"
|
sed
's/,/,\n/g'
|
sed
's/^"/\t"/g'
echo
""
}
# Create a new Repo using the specified JSON file
function
AddRepo
{
repoFile
=
$1
if
[
-z
$repoFile
]
;
then
Bail
"Error: Must specify a JSON-formatted file. Reference
$repoJsonTemplate
"
fi
if
[
!
-f
$repoFile
]
;
then
Bail
"Error: Cannot create repo -
$repoFile
does not exist"
fi
packageUrl
=
$(
grep
"url"
$repoFile
|
head
-n
1 |
awk
'{print $2}'
|
tr
-d
','
)
echo
"Creating new repo on
$server
[
$packageUrl
]"
curl
-i
-k
"
$baseurl
/v1/repositories"
--data
@
$repoFile
-H
"Content-Type: application/json"
echo
""
}
# Upload AND publish the file
function
AddFile
{
packageFile
=
$1
# Validity checks are performed by UploadFile
echo
"Uploading package to
$server
[
$packageFile
]"
response
=
$(
UploadFile
$packageFile
"true"
)
id
=
$(
echo
$response
| jq
-r
".id"
)
# Parse package metadata first to confirm it's a valid deb/rpm
# Needs to be performed in this function so we can use it to publish the package
jsonFile
=
$(
WritePackageInfoToFile
$packageFile
)
sed
-i
"s/REPOSITORYID/
$repositoryId
/g"
$jsonFile
# Replace the url field with fileId
sed
-i
"s/PACKAGEURL/
$id
/g"
$jsonFile
sed
-i
"s/sourceUrl/fileId/g"
$jsonFile
AddPackage
$jsonFile
rm
-f
$jsonFile
echo
""
}
# Upload a file
function
UploadFile
{
packageFile
=
$1
quick
=
$2
if
[
-z
$packageFile
]
;
then
Bail
"Error: Must specify the path to a file to upload "
fi
if
[
!
-f
$packageFile
]
;
then
Bail
"Error: Cannot upload -
$packageFile
does not exist"
fi
# Additional validation and output if quick mode isn't enabled
# Basically, if this is part of a publish operation, these steps are handled elsewhere
if
[
"
$quick
"
!=
"true"
]
;
then
# Parse package metadata first to confirm it's a valid deb/rpm
jsonFile
=
$(
WritePackageInfoToFile
$packageFile
)
rm
-f
$jsonFile
echo
"Uploading package to
$server
[
$packageFile
]"
fi
curl
-s
-k
-X
POST
-F
file
=
@
$packageFile
"
$baseurl
/v1/files"
echo
""
}
function
ListFiles
{
curl
-s
-k
"
$baseurl
/v1/files"
| jq
}
function
DeleteFile
{
fileId
=
$1
if
[
-z
"
$fileId
"
]
;
then
Bail
"Error: Must specify an ID to delete"
fi
curl
-s
-X
DELETE
"
$baseurl
/v1/files/
$fileId
"
}
# Upload a single package using the specified JSON file
function
AddPackage
{
packageFile
=
$1
if
[
-z
$packageFile
]
;
then
Bail
"Error: Must specify a JSON-formatted file. Reference
$packageJsonTemplate
"
fi
if
[
!
-f
$packageFile
]
;
then
Bail
"Error: Cannot add package -
$packageFile
does not exist"
fi
packageUrl
=
$(
grep
"sourceUrl"
$packageFile
|
head
-n
1 |
awk
'{print $2}'
)
echo
"Adding package to
$server
[
$packageUrl
]"
curl
-i
-k
"
$baseurl
/v1/packages"
--data
@
$packageFile
-H
"Content-Type: application/json"
echo
""
}
# Gets the package name and version and writes it to a file
function
WritePackageInfoToFile
{
packageFile
=
$1
tmpOut
=
$(
mktemp
)
if
[
-z
"
$packageFile
"
]
;
then
Bail
"Error: Must specify path to a deb/rpm package"
elif
[
!
-f
"
$packageFile
"
]
;
then
Bail
"Error: Specified file
$packageFile
does not exist"
fi
if
dpkg
-I
$packageFile
>
$tmpOut
2> /dev/null
;
then
>
&2
echo
"File is deb format"
pkgName
=
$(
grep
"^
\s
*Package:"
$tmpOut
|
awk
'{print $2}'
)
pkgVer
=
$(
grep
"^
\s
*Version:"
$tmpOut
|
awk
'{print $2}'
)
elif
rpm
-qpi
$packageFile
>
$tmpOut
2> /dev/null
;
then
>
&2
echo
"File is rpm format"
pkgName
=
$(
egrep
"^Name"
$tmpOut
|
tr
-d
':'
|
awk
'{print $2}'
)
pkgVer
=
$(
egrep
"^Version"
$tmpOut
|
tr
-d
':'
|
awk
'{print $2}'
)
else
rm
-f
$tmpOut
Bail
"File is not a valid deb/rpm package
$url
"
fi
rm
-f
$tmpOut
if
[
-z
"
$pkgName
"
]
;
then
Bail
"Unable to parse package name for
$url
"
elif
[
-z
"
$pkgVer
"
]
;
then
Bail
"Unable to parse package version number for
$url
"
fi
# Create Package .json file
outJson
=
$(
mktemp
)
escapedUrl
=
$(
echo
"
$url
"
|
sed
's/\//\\\//g'
|
sed
's/\&/\\\&/g'
)
cp
$packageJsonTemplate
$outJson
sed
-i
"s/PACKAGENAME/
$pkgName
/g"
$outJson
sed
-i
"s/PACKAGEVERSION/
$pkgVer
/g"
$outJson
# Return path to json file
echo
$outJson
}
# Upload a single package by dynamically creating a JSON file using a provided URL
function
AddPackageByUrl
{
url
=
$(
echo
"
$1
"
)
if
[
-z
"
$url
"
]
;
then
Bail
"Unable to publish package because no URL was specified"
fi
tmpFile
=
$(
mktemp
)
if
!
wget
-q
"
$url
"
-O
$tmpFile
;
then
rm
-f
$tmpFile
Bail
"Unable to download URL
$url
"
fi
jsonFile
=
$(
WritePackageInfoToFile
$tmpFile
)
# Create Package .json file
escapedUrl
=
$(
echo
"
$url
"
|
sed
's/\//\\\//g'
|
sed
's/\&/\\\&/g'
)
sed
-i
"s/PACKAGEURL/
$escapedUrl
/g"
$jsonFile
sed
-i
"s/REPOSITORYID/
$repositoryId
/g"
$jsonFile
# Perform Upload
AddPackage
$jsonFile
# Cleanup
rm
-f
$jsonFile
}
# Upload multiple packages by reading urls line-by-line from the specified file
function
AddPackages
{
urlFile
=
$1
if
[
-z
$urlFile
]
;
then
Bail
"Must specify a flat text file containing one or more URLs"
fi
if
[
!
-f
$urlFile
]
;
then
Bail
"Cannot add packages. File
$urlFile
does not exist"
fi
for
url
in
$(
cat
$urlFile
)
;
do
if
[
-n
"
$url
"
]
;
then
AddPackageByUrl
"
$url
"
fi
sleep
5
done
}
# Check upload by ID
function
CheckUpload
{
id
=
$1
if
[
-z
"
$id
"
]
;
then
Bail
"Must specify an ID"
fi
curl
-s
-k
$baseurl
/v1/packages/queue/
$id
| jq
echo
""
}
# Delete the specified repo
function
DeleteRepo
{
repoId
=
$1
if
[
-z
$repoId
]
;
then
Bail
"Please specify repository ID. Run -listrepos for a list of IDs"
fi
curl
-I
-k
-X
DELETE
"
$baseurl
/v1/repositories/
$repoId
"
}
# Delete the specified package
function
DeletePackage
{
packageId
=
$1
if
[
-z
$packageId
]
;
then
Bail
"Please specify package ID. Run -listpkgs for a list of IDs"
fi
echo
Removing pkgId
$packageId
from repo
$repositoryId
curl
-I
-k
-X
DELETE
"
$baseurl
/v1/packages/
$packageId
"
}
# Parse params
# Not using getopts because this uses multi-char flags
operation
=
while
((
"$#"
))
;
do
if
[[
"
$1
"
==
"-config"
]]
;
then
shift
configFile
=
"
$1
"
elif
[[
"
$1
"
==
"-listrepos"
]]
;
then
operation
=
ListRepositories
elif
[[
"
$1
"
==
"-listpkgs"
]]
;
then
operation
=
ListPackages
if
[
-n
"
$2
"
]
;
then
shift
operand
=
"
$1
"
fi
elif
[[
"
$1
"
==
"-addrepo"
]]
;
then
operation
=
AddRepo
shift
operand
=
"
$1
"
elif
[[
"
$1
"
==
"-addpkg"
]]
;
then
operation
=
AddPackage
shift
operand
=
"
$1
"
elif
[[
"
$1
"
==
"-addpkgs"
]]
;
then
operation
=
AddPackages
shift
operand
=
"
$1
"
elif
[[
"
$1
"
==
"-addfile"
]]
;
then
operation
=
AddFile
shift
operand
=
"
$1
"
elif
[[
"
$1
"
==
"-uploadfile"
]]
;
then
operation
=
UploadFile
shift
operand
=
"
$1
"
elif
[[
"
$1
"
==
"-listfiles"
]]
;
then
operation
=
ListFiles
elif
[[
"
$1
"
==
"-delfile"
]]
;
then
operation
=
DeleteFile
shift
operand
=
"
$1
"
elif
[[
"
$1
"
==
"-check"
]]
;
then
operation
=
CheckUpload
shift
operand
=
"
$1
"
elif
[[
"
$1
"
==
"-delrepo"
]]
;
then
operation
=
DeleteRepo
shift
operand
=
"
$1
"
elif
[[
"
$1
"
==
"-delpkg"
]]
;
then
operation
=
DeletePackage
shift
operand
=
"
$1
"
else
Usage
fi
shift
done
echo
"Performing
$operation
$operand
"
# Parse config file
ParseConfigFile
"
$configFile
"
# Exit if no operation was specified
if
[
-z
"operation"
]
;
then
Usage
fi
$operation
"
$operand
"
build/tfs/linux/x64/Dockerfile
已删除
100644 → 0
浏览文件 @
605139f4
FROM
microsoft/vsts-agent:ubuntu-14.04-standard
MAINTAINER
Joao Moreno <joao.moreno@microsoft.com>
ARG
DEBIAN_FRONTEND=noninteractive
RUN
apt-get update
# Dependencies
RUN
apt-get
install
-y
build-essential
RUN
apt-get
install
-y
gcc-multilib g++-multilib
RUN
apt-get
install
-y
git
RUN
apt-get
install
-y
dpkg-dev
RUN
apt-get
install
-y
zip
RUN
apt-get
install
-y
rpm
RUN
apt-get
install
-y
createrepo
RUN
apt-get
install
-y
python-gtk2
RUN
apt-get
install
-y
jq
RUN
apt-get
install
-y
xvfb
RUN
apt-get
install
-y
fakeroot
RUN
apt-get
install
-y
libgtk2.0-0
RUN
apt-get
install
-y
libgconf-2-4
RUN
apt-get
install
-y
libnss3
RUN
apt-get
install
-y
libasound2
RUN
apt-get
install
-y
libxtst6
RUN
apt-get
install
-y
libfuse2
RUN
apt-get
install
-y
libnotify-bin
RUN
apt-get
install
-y
libx11-dev
RUN
apt-get
install
-y
libxss1
RUN
apt-get
install
-y
libx11-xcb-dev
RUN
apt-get
install
-y
libxkbfile-dev
RUN
apt-get
install
-y
bc bsdmainutils
RUN
apt-get
install
-y
libsecret-1-dev
# Xvfb
# Thanks https://medium.com/@griggheo/running-headless-selenium-webdriver-tests-in-docker-containers-342fdbabf756
ADD
xvfb.init /etc/init.d/xvfb
RUN
chmod
+x /etc/init.d/xvfb
RUN
update-rc.d xvfb defaults
# dbus
RUN
ln
-sf
/bin/dbus-daemon /usr/bin/dbus-daemon
# nvm
ENV
NVM_DIR /usr/local/nvm
RUN
curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
CMD
(service xvfb start; service dbus start; export DISPLAY=:10; ./start.sh)
\ No newline at end of file
build/tfs/linux/x64/run-agent.sh
已删除
100755 → 0
浏览文件 @
605139f4
#!/bin/bash
if
[
!
-f
pat
]
;
then
echo
"Error: file pat not found"
exit
1
fi
docker run
\
-e
VSTS_ACCOUNT
=
"monacotools"
\
-e
VSTS_TOKEN
=
"
$(
cat
pat
)
"
\
-e
VSTS_AGENT
=
"tb-lnx-x64-local"
\
-e
VSTS_POOL
=
"linux-x64"
\
-e
VSTS_WORK
=
"/var/vsts/work"
\
--name
"tb-lnx-x64-local"
\
-it
joaomoreno/vscode-vso-agent-x64:latest
\ No newline at end of file
build/tfs/linux/x64/xvfb.init
已删除
100644 → 0
浏览文件 @
605139f4
#!/bin/bash
#
# /etc/rc.d/init.d/xvfbd
#
# chkconfig: 345 95 28
# description: Starts/Stops X Virtual Framebuffer server
# processname: Xvfb
#
### BEGIN INIT INFO
# Provides: xvfb
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start xvfb at boot time
# Description: Enable xvfb provided by daemon.
### END INIT INFO
[
"
${
NETWORKING
}
"
=
"no"
]
&&
exit
0
PROG
=
"/usr/bin/Xvfb"
PROG_OPTIONS
=
":10 -ac"
PROG_OUTPUT
=
"/tmp/Xvfb.out"
case
"
$1
"
in
start
)
echo
"Starting : X Virtual Frame Buffer "
$PROG
$PROG_OPTIONS
>>
$PROG_OUTPUT
2>&1 &
disown
-ar
;;
stop
)
echo
"Shutting down : X Virtual Frame Buffer"
killproc
$PROG
RETVAL
=
$?
[
$RETVAL
-eq
0
]
&&
/bin/rm
-f
/var/lock/subsys/Xvfb
/var/run/Xvfb.pid
echo
;;
restart|reload
)
$0
stop
$0
start
RETVAL
=
$?
;;
status
)
status Xvfb
RETVAL
=
$?
;;
*
)
echo
$"Usage:
$0
(start|stop|restart|reload|status)"
exit
1
esac
exit
$RETVAL
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录