Exemplo n.º 1
0
module.exports = function() {
console.log('\n');
fmt.title('caplin-cli commands');
fmt.field('init', 'Creates a new workspace in the current directory');
fmt.field('create', 'Creates a new file structure based on the selected template');
fmt.field('list', 'Lists the current workspace`s applications and available templates');
fmt.line();
fmt.field('help', 'Prints this list of commands');
fmt.field('version', 'Prints the current caplin-cli version');
console.log('\n');
};
Exemplo n.º 2
0
const startTagRelease = async options => {
	if (options.verbose) {
		fmt.title("GitHub Configuration");
		fmt.field("username", options.username);
		fmt.field("token", options.token);
		fmt.line();
	}

	await setup(options);

	return runWorkflow(options.workflow, options);
};
Exemplo n.º 3
0
var awssum = require('awssum');
var amazon = awssum.load('amazon/amazon');
var S3 = awssum.load('amazon/s3').S3;

var env             = process.env;
var accessKeyId     = env.ACCESS_KEY_ID;
var secretAccessKey = env.SECRET_ACCESS_KEY;
var awsAccountId    = env.AWS_ACCOUNT_ID;

var s3 = new S3({
    'accessKeyId' : accessKeyId,
    'secretAccessKey' : secretAccessKey,
    'region' : amazon.US_EAST_1
});

fmt.field('Region', s3.region() );
fmt.field('EndPoint', s3.host() );
fmt.field('AccessKeyId', s3.accessKeyId().substr(0, 3) + '...' );
fmt.field('SecretAccessKey', s3.secretAccessKey().substr(0, 3) + '...' );
fmt.field('AwsAccountId', s3.awsAccountId() );

var optionsNotFound = {
    BucketName    : 'pie-18',
    ObjectName    : 'not-found.txt',
    Acl           : 'private',
};

s3.PutObjectAcl(optionsNotFound, function(err, data) {
    fmt.msg("putting an object acl to pie-18 - expecting failure (object not found)");
    fmt.dump(err, 'Error');
    fmt.dump(data, 'Data');
var env            = process.env;
var consumerKey    = env.TWITTER_CONSUMER_KEY;
var consumerSecret = env.TWITTER_CONSUMER_SECRET;
var token          = env.TWITTER_TOKEN;
var tokenSecret    = env.TWITTER_TOKEN_SECRET;
// don't need the verifier

var twitter = new Twitter({
    'consumerKey'    : consumerKey,
    'consumerSecret' : consumerSecret
});

twitter.setToken(token);
twitter.setTokenSecret(tokenSecret);

fmt.field('ConsumerKey', twitter.consumerKey()                          );
fmt.field('ConsumerSecret', twitter.consumerSecret().substr(0, 3) + '...'  );
fmt.field('Token', twitter.token()                                );
fmt.field('TokenSecret', twitter.tokenSecret().substr(0, 3) + '...'     );

var data = {
    status : 'Test automated status update from AwsSum : https://github.com/appsattic/node-awssum/',
};

twitter.Update(data, function(err, data) {
    fmt.msg('\ncalling statuses/update - expecting success');
    fmt.dump(err, 'Err');
    fmt.dump(data, 'Data');
});
var awssum = require('awssum');
var oauth = awssum.load('oauth');
var xeroService = awssum.load('xero/xero');

var env            = process.env;
var consumerKey    = env.XERO_CONSUMER_KEY;
var consumerSecret = env.XERO_CONSUMER_SECRET;
var token          = env.XERO_TOKEN;
var tokenSecret    = env.XERO_TOKEN_SECRET;
// don't need the verifier

var xero = new xeroService.Xero({
    'consumerKey'    : consumerKey,
    'consumerSecret' : consumerSecret
});

xero.setToken(token);
xero.setTokenSecret(tokenSecret);

fmt.field('ConsumerKey', xero.consumerKey()     );
fmt.field('ConsumerSecret', xero.consumerSecret() );
fmt.field('Token', xero.token()          );
fmt.field('TokenSecret', xero.tokenSecret()    );

// firstly, request a token
xero.GetItems(function(err, data) {
    fmt.msg('\nget items - expecting success');
    fmt.dump(err, 'Err');
    fmt.dump(data, 'Data');
});
var awssum = require('awssum');
var oauth = awssum.load('oauth');
var xeroService = awssum.load('xero/xero');

var env            = process.env;
var consumerKey    = env.XERO_CONSUMER_KEY;
var consumerSecret = env.XERO_CONSUMER_SECRET;
// don't need the token, tokenSecret or verifier

var xero = new xeroService.Xero({
    'consumerKey'    : consumerKey,
    'consumerSecret' : consumerSecret
});


fmt.field('ConsumerKey', xero.consumerKey() );
fmt.field('ConsumerSecret', xero.consumerSecret() );

xero.RequestToken({ 'OAuthCallback' : 'oob' }, function(err, data) {
    fmt.msg("requesting token - expecting success");
    if ( err ) {
        fmt.dump(err, 'Error');
        process.exit();
    }

    fmt.dump(data, 'Data');
    fmt.msg( 'If you want to verify this token, visit: '
                 + xero.protocol() + '://' + xero.authorizeHost()
                 + xero.authorizePath()
                 + '?oauth_token=' + data.Body.oauth_token
               );
Exemplo n.º 7
0
 client.removeSnapshot(context.params.name, context.params.version, function () {
     fmt.title(client.remote.toString('long'));
     fmt.field(project.formatName(context.params), 'removed');
     next();
 });
var fmt = require('fmt');
var awssum = require('awssum');
var amazon = awssum.load('amazon/amazon');
var ElasticBeanstalk = awssum.load('amazon/elasticbeanstalk').ElasticBeanstalk;

var env             = process.env;
var accessKeyId     = env.ACCESS_KEY_ID;
var secretAccessKey = env.SECRET_ACCESS_KEY;
var awsAccountId    = env.AWS_ACCOUNT_ID;

var eb = new ElasticBeanstalk({
    'accessKeyId'     : accessKeyId,
    'secretAccessKey' : secretAccessKey,
    'region'          : amazon.US_EAST_1,
});

fmt.field('Region', eb.region() );
fmt.field('EndPoint', eb.host() );
fmt.field('AccessKeyId', eb.accessKeyId().substr(0, 3) + '...' );
fmt.field('SecretAccessKey', eb.secretAccessKey().substr(0, 3) + '...' );

eb.ListAvailableSolutionStacks(function(err, data) {
    fmt.msg("listing available solution stacks - expecting success");
    fmt.dump(err, 'Error');
    fmt.dump(data, 'Data');
});
Exemplo n.º 9
0
 client.removeProject(context.params.name, function (msg) {
     msg = msg || 'removed';
     fmt.title(client.remote.toString('long'));
     fmt.field(context.params.name, msg);
     next();
 });
var fmt = require('fmt');
var awssum = require('awssum');
var oauth = awssum.load('oauth');
var yahooService = awssum.load('yahoo/yahoo');

var env            = process.env;
var consumerKey    = env.YAHOO_CONSUMER_KEY;
var consumerSecret = env.YAHOO_CONSUMER_SECRET;
// don't need the token, tokenSecret or verifier

var yahoo = new yahooService.Yahoo({
    'consumerKey'    : consumerKey,
    'consumerSecret' : consumerSecret
});

fmt.field('ConsumerKey', yahoo.consumerKey() );
fmt.field('ConsumerSecret', yahoo.consumerSecret() );

yahoo.RequestToken({ 'OAuthCallback' : 'oob' }, function(err, data) {
    fmt.msg("requesting token - expecting success");
    if ( err ) {
        fmt.dump(err, 'Error');
        process.exit();
    }

    fmt.dump(data, 'Data');
    fmt.msg( 'If you want to verify this token, visit: '
                 + yahoo.protocol() + '://' + yahoo.authorizeHost()
                 + yahoo.authorizePath()
                 + '?oauth_token=' + data.Body.oauth_token
               );