-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(pipeline): upgrade node 14 to 16 * chore(packages): upgrade versions * feat: add DigitalOceanDoctlInstaller * chore: upgrade packages * fix: add lint and webpack azure tool changes * fix: use lerna to group packages * fix: direct use dependencies that has an expression for webpack * chore: add lerna clean before run tests * chore: upgrade packages and default node to v16 * chore: upgrade test packages * chore: upgrade aws & semantic release packages * test: enable sourcemaps to pass tests * chore: upgrade aws-sdk packages * chore: migrate to husky 7 * chore: upgrade prettier & webpack * chore: fix lint and loglevel * fix(download): watch for progress on object instead of request * fix(download): remove httpDownloadProgress and use httpHeader & data * chore: upgrade aws-sdk * fix(doctlInstaller): get tool path and download - Add description - Rework messages * chore: upgrade jest * feat: add doctl runner * fix: lint import rules and semicolon * fix(webpack): auto import entries, remove replace files * chore: upgrade packages * test: setup initial tests * test: add remaining tests for doctl * chore: remove tests from tsconfig * test: mock process cwd * chore: upgrade packages * docs: add @marceloavf as a contributor * chore: add all-contributors * docs: add @usrme as a contributor * docs: add @TrueBrain as a contributor * docs: add tasks information * docs: fix typo BREAKING CHANGE: Many packages have been updated to major versions
- Loading branch information
1 parent
4629088
commit 3add6cf
Showing
67 changed files
with
8,168 additions
and
4,602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"projectName": "digitalocean-tools-vsts", | ||
"projectOwner": "marceloavf", | ||
"repoType": "github", | ||
"repoHost": "https://github.com", | ||
"files": [ | ||
"README.md" | ||
], | ||
"imageSize": 100, | ||
"commit": true, | ||
"commitConvention": "angular", | ||
"contributors": [ | ||
{ | ||
"login": "marceloavf", | ||
"name": "Marcelo Formentão", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/5435657?v=4", | ||
"profile": "https://www.linkedin.com/in/marceloavf/", | ||
"contributions": [ | ||
"question", | ||
"code", | ||
"content", | ||
"design", | ||
"doc", | ||
"ideas", | ||
"infra" | ||
] | ||
}, | ||
{ | ||
"login": "usrme", | ||
"name": "usrme", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/5902545?v=4", | ||
"profile": "https://usrme.xyz/", | ||
"contributions": [ | ||
"doc" | ||
] | ||
}, | ||
{ | ||
"login": "TrueBrain", | ||
"name": "Patric Stout", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/1663690?v=4", | ||
"profile": "https://github.com/TrueBrain", | ||
"contributions": [ | ||
"code", | ||
"doc" | ||
] | ||
} | ||
], | ||
"contributorsPerLine": 7 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"prettier" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier", | ||
"plugin:import/recommended", | ||
"plugin:import/typescript" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-var-requires": 0, | ||
"@typescript-eslint/ban-ts-comment": 1, | ||
"semi": [2, "never"], | ||
"import/order": ["error"] | ||
}, | ||
"settings": { | ||
"import/resolver": { | ||
"typescript": { | ||
"alwaysTryTypes": true, | ||
"project": "tsconfig.json" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"jest.autoEnable": false, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"eslint.alwaysShowStatus": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[jsonc]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as tl from 'azure-pipelines-task-lib/task' | ||
|
||
export class Doctl { | ||
public accessToken: string | ||
public arguments: string | ||
public pathToRun: string | ||
|
||
constructor() { | ||
try { | ||
this.accessToken = tl.getVariable('doctl.token') | ||
this.arguments = tl.getInput('arguments') | ||
this.pathToRun = tl.getPathInput("pathToRun") || process.cwd() | ||
} catch (error) { | ||
throw new Error(error.message) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import tl from './tl' | ||
import { Runner } from './utils/Doctl' | ||
|
||
const digitalOceanDoctl = new Runner() | ||
|
||
export default () => | ||
digitalOceanDoctl | ||
.init() | ||
.then((result) => tl.setResult(tl.TaskResult.Succeeded, '')) | ||
.catch((error) => tl.setResult(tl.TaskResult.Failed, error)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import init from './digitalOceanDoctl' | ||
|
||
init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "DigitalOceanDoctl", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"azure-pipelines-task-lib": "3.1.10", | ||
"azure-pipelines-tool-lib": "0.13.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"id": "06f78d7e-c262-47fa-9422-3d4f2d50875e", | ||
"name": "DigitalOceanDoctl", | ||
"friendlyName": "DigitalOcean Doctl", | ||
"instanceNameFormat": "DigitalOcean Doctl $(Arguments)", | ||
"description": "Executes Doctl", | ||
"author": "Marcelo Formentão", | ||
"helpMarkDown": "[More Information](https://github.com/marceloavf/digitalocean-tools-vsts) (Version #{Version}#).", | ||
"category": "Utility", | ||
"visibility": [ | ||
"Build", | ||
"Release" | ||
], | ||
"version": { | ||
"Major": 0, | ||
"Minor": 0, | ||
"Patch": 0 | ||
}, | ||
"runsOn": [ | ||
"Agent", | ||
"DeploymentGroup" | ||
], | ||
"demands": ["doctl"], | ||
"minimumAgentVersion": "1.91.0", | ||
"inputs": [ | ||
{ | ||
"name": "arguments", | ||
"type": "string", | ||
"label": "Arguments", | ||
"defaultValue": "", | ||
"required": false, | ||
"helpMarkDown": "Arguments passed to the doctl script. Either ordinal parameters or named parameters." | ||
}, | ||
{ | ||
"name": "pathToRun", | ||
"type": "filePath", | ||
"label": "Working Directory", | ||
"required": false | ||
} | ||
], | ||
"execution": { | ||
"Node10": { | ||
"target": "index.js", | ||
"argumentFormat": "" | ||
} | ||
}, | ||
"messages": { | ||
"NotFound": "Couldn't locate Doctl", | ||
"ExecutionFailed": "Doctl failed with exit code %d", | ||
"DoctlFailed": "Doctl failed with error %s", | ||
"TaskCompleted": "All specified files deleted from Space completed" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as path from 'path' | ||
import * as tl from 'azure-pipelines-task-lib/task' | ||
|
||
/** | ||
* Set language loc file | ||
*/ | ||
const taskManifestPath = path.join(__dirname, './task.json') | ||
tl.setResourcePath(taskManifestPath) | ||
|
||
export default tl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import trm = require('azure-pipelines-task-lib/toolrunner') | ||
import { Doctl } from '@Common/Doctl' | ||
import tl from '../tl' | ||
|
||
export class Runner extends Doctl { | ||
public async init(): Promise<void> { | ||
try { | ||
const doctlPath = tl.which('doctl', true) | ||
|
||
const doctl = tl.tool(doctlPath) | ||
if (this.accessToken) doctl.arg(`--access-token ${this.accessToken}`) | ||
doctl.line(this.arguments) | ||
|
||
const options: trm.IExecOptions = { | ||
cwd: this.pathToRun, | ||
env: process.env, | ||
silent: false, | ||
failOnStdErr: false, | ||
ignoreReturnCode: false, | ||
outStream: undefined, | ||
errStream: undefined, | ||
windowsVerbatimArguments: undefined | ||
} | ||
|
||
const result = await doctl.exec(options) | ||
if (result) { | ||
throw new Error(tl.loc('ExecutionFailed', result)) | ||
} | ||
} catch (err) { | ||
console.error(tl.loc('DoctlFailed'), err) | ||
throw err | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.