1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 10:19:30 +02:00

use amazon s3 instead of storage-temp

This commit is contained in:
hogehoge-banana 2015-08-24 17:39:21 +09:00
parent afa8e7b25e
commit 9299487670
3 changed files with 279 additions and 6 deletions

View file

@ -731,6 +731,33 @@ program
})
})
program
.command('storage-s3')
.description('start s3 storage')
.option('-p, --port <port>'
, 'port (or $PORT)'
, Number
, process.env.PORT || 7100)
.option('--bucket <bucketname>'
, 'your s3 bucket name'
, String)
.option('--profile <name>'
, 'your aws credentions profile name'
, String
, 'stf-storage')
.option('--endpoint <endpoint>'
, 'your buckets endpoint'
, String
, 's3-ap-northeast-1.amazonaws.com')
.action(function(options) {
require('./units/storage/amazons3')({
port: options.port
, profile: options.profile
, Bucket: options.bucket
, endpoint: options.endpoint
})
})
program
.command('storage-plugin-image')
.description('start storage image plugin')
@ -942,6 +969,19 @@ program
, String)
.option('--mute-master'
, 'whether to mute master volume when devices are being used')
.option('--use-s3'
, 'use amazon s3')
.option('--s3-bucket <bucketname>'
, 'your bucket name'
, String)
.option('--s3-profile <s3profile>'
, 'aws credential Profile name'
, String
, 'stf-storage')
.option('--s3-endpoint <s3endpoint>'
, 's3 endpoint'
, String
, 's3-ap-northeast-1.amazonaws.com')
.action(function() {
var log = logger.createLogger('cli:local')
, args = arguments
@ -951,7 +991,7 @@ program
// Each forked process waits for signals to stop, and so we run over the
// default limit of 10. So, it's not a leak, but a refactor wouldn't hurt.
process.setMaxListeners(20)
function run() {
var procs = [
// app triproxy
@ -1058,11 +1098,22 @@ program
])
// storage
, procutil.fork(__filename, [
'storage-temp'
, '--port', options.storagePort
])
, (function() {
if (!options.useS3) {
return procutil.fork(__filename, [
'storage-temp'
, '--port', options.storagePort
]);
} else {
return procutil.fork(__filename, [
'storage-s3'
, '--port', options.storagePort
, '--bucket', options.s3Bucket
, '--profile', options.s3Profile
, '--endpoint', options.s3Endpoint
])
}
})()
// image processor
, procutil.fork(__filename, [
'storage-plugin-image'