README
Internal Repository for reusable application tooling.
Reference
Media Fly
mf
namespace: Methods -
** Authenticate: **
Gets a Media Fly access token
API:
mf.authenticate(Object: {username: <username>, password: <password>});
Returns
Promise
that resolves the Media Fly auth response:
CLI:
No CLI implementation due to request output. Maybe later.
** Build: **
Creates an interactive build.
API:
mf.build(String: name, { input: String path, output: String: path });
Returns a `Promise` instance. >CLI: `./node_modules/.bin/@liveaxle/tooling mf.build --name=<name> -i= |--input=<path> -o|--output=<path>`
** Deploy: **
Uploads content to Media Fly
API:
mf.deploy(String: path to local contents, { destination: String: mediafly folder id, credentials: String: :, // please use environment vars and git-ignored files aws: String: : // can also be supplied in a .env file, same key names as listed. project: String: Media Fly Company Code })
Returns a `Promise` instance. >CLI:
./node_modules/.bin/@liveaxle/tooling mf.deploy --source= --destination: --product=$MF_PRODUCT --credentials=$MF_USER:$MF_PASSWORD --aws=$AWS_ID:$AWS_SECRET --project=$MF_COMPANY_CODE
** Release: **
Creates a Media Fly release according to the development release flow: https://liveaxle.atlassian.net/wiki/spaces/PROC/pages/31686657/Process+-+Development+and+Release
This function aggregates most of the other tooling functions into a flow to abide by the above linked process. As such it requires quite a bit of configuration:
CLI:
./node_modules/.bin/@liveaxle/tooling mf.release \ --credentials=<mf username>:<mf:password> --build.input=<input for build source above> --build.output<output on disk for build artifact> --aws.credentials=<awsAccessKeyId>:<awsSecretAccessKey> --aws.bucket=<bucketname> --aws.data=<data to upload> --cnfl.credentials=<cf email>:<cf password> --source=<space name>:<page id> --copy=<space name>:<parent page id> --bb.credentials=<bb email>:<bb password> --bb.source=owner/repo/branch --bb.remote=owner/repo/branch
Flow:
- Creates an interactive Build
- Deploys build to specificed folder
- Creates confluence test plan
- Creates PR with content from previous steps.
AWS
aws
namespace:
aws.s3
S3 - namespace: ** Upload: **
Uploads an item to s3
API:
aws.s3.upload(String:<name of file/s3 path from point of bucket>, Buffer:, Object:)
>Returns a `Promise` instance
>> CLI:
>```
./node_modules/.bin/@liveaxle/tooling aws.s3.upload --name=<s3 object name> --credentials=<awsAccessKeyId:awsSecretAccessKey> --data=<Buffer/Binary Octet Stream>
>```
---
> ** *Delete:* **
> Deletes an item from s3
>> API:
>```
aws.s3.delete(String:<name of s3 Object>, Object:<configuration>)
>```
> Returns a `Promise` object.
>> CLI:
>
> `./node_modules/.bin/@liveaxle/tooling aws.s3.delete`
>
> ` --name=<s3 object name>`
>
> ` --credentials=<awsAccessKeyId:awsSecretAccessKey>`
---
### Bit Bucket
#### namespace: `bb`
#### Pull Requests - namespace: `bb.pr`
> ** *Create:* **
>>API:
>```
bb.pr.create(config={
source: String<source repository> // expressed as owner/repo/branch - will default to CWD git stats if not defined.
remote: String<source repository> // expressed as owner/repo/branch - will default to CWD git stats if not defined.
title: String<name of the PR> default to local branch
description: String<description of pr>. defaults to looping through each commit
credentials: Object: {username: <email>, password: <password>}
reviewers: [{username: String:<bb username>}] // defaults to LA team
})
>```
>>CLI:
>```
./node_modules/.bin/@liveaxle/tooling bb.pr.create
--credentials=email:password
--source=String:<bibucket repo path> owner/repo/branch - will default to cwd branch
--remote=String:<bitbucket repo path> owner/repo/branch - will default to master
--title=String:<title of the PR> - default to cwd branch name
--description=String:<body for the PR>
>```
---
### Confluence
#### namespace: `cnfl`
#### Pages - namespace: `cnfl.pages`
> ** *Get:* **
Gets a page from Confluence
>> API:
>```
confl.content.get(String:id, Object:{
credentials: {username: <email>, password: <password>}, // required
space: String:<space> // Space containing the requesting
})
>```
>> CLI:
>```
./node_modules/.bin/@liveaxle/tooling cnfl.content.get --id=page/content id --credentials=username:email --space=title of space
>```
---
> ** *Create:* **
Create a page in Confluence
>> API:
>```
confl.content.create(title, Object:{
credentials: {username: <email>, password: <password>}, // required
space: String:<space> // Space containing the requesting,
status: String:<current, trashed, historical, draft> // defaults to current
parent: String:<id of the parent>
body: String:<page body> // wiki markup of page
})
>```
>> CLI:
>```
./node_modules/.bin/@liveaxle/tooling cnfl.content.create --title=<page title> --credentials=username:email --space=title of space --body=<page body> --status=<page publish status> --parent=<parent id>
>```