mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Screenshots are more or less working (server-side). Resize not implemented yet. Temporarily breaks APK uploads.
This commit is contained in:
parent
5be2b8f7d5
commit
48726669dc
9 changed files with 435 additions and 185 deletions
44
lib/cli.js
44
lib/cli.js
|
@ -43,6 +43,9 @@ program
|
|||
, 'group timeout'
|
||||
, Number
|
||||
, 600)
|
||||
.option('-r, --storage-url <url>'
|
||||
, 'URL to storage client'
|
||||
, String)
|
||||
.action(function() {
|
||||
var serials = cliutil.allUnknownArgs(arguments)
|
||||
, options = cliutil.lastArg(arguments)
|
||||
|
@ -53,6 +56,9 @@ program
|
|||
if (!options.connectPush) {
|
||||
this.missingArgument('--connect-push')
|
||||
}
|
||||
if (!options.storageUrl) {
|
||||
this.missingArgument('--storage-url')
|
||||
}
|
||||
|
||||
require('./roles/provider')({
|
||||
name: options.name
|
||||
|
@ -71,6 +77,7 @@ program
|
|||
, '--ports', ports.join(',')
|
||||
, '--public-ip', options.publicIp
|
||||
, '--group-timeout', options.groupTimeout
|
||||
, '--storage-url', options.storageUrl
|
||||
])
|
||||
}
|
||||
, endpoints: {
|
||||
|
@ -107,6 +114,9 @@ program
|
|||
, 'group timeout'
|
||||
, Number
|
||||
, 600)
|
||||
.option('-r, --storage-url <url>'
|
||||
, 'URL to storage client'
|
||||
, String)
|
||||
.action(function(serial, options) {
|
||||
if (!options.connectSub) {
|
||||
this.missingArgument('--connect-sub')
|
||||
|
@ -120,6 +130,9 @@ program
|
|||
if (!options.ports) {
|
||||
this.missingArgument('--ports')
|
||||
}
|
||||
if (!options.storageUrl) {
|
||||
this.missingArgument('--storage-url')
|
||||
}
|
||||
|
||||
require('./roles/device')({
|
||||
serial: serial
|
||||
|
@ -132,6 +145,7 @@ program
|
|||
}
|
||||
, heartbeatInterval: options.heartbeatInterval
|
||||
, groupTimeout: options.groupTimeout * 1000 // change to ms
|
||||
, storageUrl: options.storageUrl
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -426,8 +440,8 @@ program
|
|||
})
|
||||
|
||||
program
|
||||
.command('storage-temp')
|
||||
.description('start temp storage')
|
||||
.command('cache-apk')
|
||||
.description('apk cache')
|
||||
.option('-p, --port <port>'
|
||||
, 'port (or $PORT)'
|
||||
, Number
|
||||
|
@ -463,6 +477,29 @@ program
|
|||
})
|
||||
})
|
||||
|
||||
program
|
||||
.command('storage-temp')
|
||||
.description('start temp storage')
|
||||
.option('-p, --port <port>'
|
||||
, 'port (or $PORT)'
|
||||
, Number
|
||||
, process.env.PORT || 7100)
|
||||
.option('--public-ip <ip>'
|
||||
, 'public ip for global access'
|
||||
, String
|
||||
, ip())
|
||||
.option('--save-dir <dir>'
|
||||
, 'where to save files'
|
||||
, String
|
||||
, os.tmpdir())
|
||||
.action(function(options) {
|
||||
require('./roles/storage/temp')({
|
||||
port: options.port
|
||||
, publicIp: options.publicIp
|
||||
, saveDir: options.saveDir
|
||||
})
|
||||
})
|
||||
|
||||
program
|
||||
.command('migrate')
|
||||
.description('migrates the database to the latest version')
|
||||
|
@ -593,6 +630,8 @@ program
|
|||
, '--connect-push', options.bindDevPull
|
||||
, '--group-timeout', options.groupTimeout
|
||||
, '--public-ip', options.publicIp
|
||||
, '--storage-url'
|
||||
, util.format('http://localhost:%d/', options.storagePort)
|
||||
].concat(cliutil.allUnknownArgs(args)))
|
||||
|
||||
// auth-mock
|
||||
|
@ -625,7 +664,6 @@ program
|
|||
, procutil.fork(__filename, [
|
||||
'storage-temp'
|
||||
, '--port', options.storagePort
|
||||
, '--connect-push', options.bindDevPull
|
||||
])
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue