2.2.38 • Published 8 months ago

@alell/azure-pipelines-task-commons v2.2.38

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Samples to use.

Getting and Setting from/to different sources.

task.json

...
  "groups": [{
    "name": "advanced",
    "displayName": "Advanced",
    "isExpanded": false
  }],
  "inputs": [
    {
      "name": "sourceType",
      "label": "Type of source input",
      "required": true,
      "defaultValue": "text",
      "type": "pickList",
      "options": {
        "file": "file",
        "var": "var",
        "text": "text"
      },
      "helpMarkDown": "Indicate type of **source input reference**, can be **File**, **Variable** or **Raw Text Expression**",
      "groupName": "advanced"
    },
    {
      "name": "source",
      "label": "Source input reference or expression",
      "required": true,
      "defaultValue": "",
      "type": "string",
      "helpMarkDown": ""
    },
    {
      "name": "destType",
      "label": "Type of destination output",
      "required": true,
      "defaultValue": "var",
      "type": "pickList",
      "options": {
        "file": "file",
        "var": "var",
        "text": "text"
      },
      "helpMarkDown": "Indicate type of **destination output reference**, can be **File**, **Variable** or **Raw Text Expression**",
      "groupName": "advanced"
    },
    {
      "name": "dest",
      "label": "Destination output reference or expression (not required)",
      "defaultValue": "",
      "type": "string"
    }
  ]
...

YourTask.ts

import {
  TaskResult,
  getInput,
  setResult,
  setVariable
} from 'azure-pipelines-task-lib/task';
import { DestType, SourceType, getContent, setContent } from '@alell/azure-pipelines-task-commons';

...

  const source = getInput('source', true);
  const sourceType: SourceType = getInput('sourceType', true) as any;
  const dest = getInput('dest', false);
  const destType: DestType = getInput('destType', true) as any;

  const sourceContent = await getContent(sourceType, source);

  setContent(destType, dest, `${sourceContent} some out content sufix`);

azure-pipeline.yml

  - task: YourTask@1
    displayName: "My Task"
    inputs:
      sourceType: file
      source: ./my-file.txt
      destType: var
      dest: MY_ENCODED_64_VAR

About US

Help us

See CONTRIBUTING.md

If you like our project help us to make more best solutions.

Bitcoin / network BTC:

1NvnQAp2e46Fqv4YaoYTioypJZdq4Kc3Az

Etherium / network Etherium:

0x38a2113604fb3d642bbd009301e94848a499cea4

BitTorrent / network Tron:

TD9LHa5BjWQpf4oP3uYWP8ghnojJWJy53C

2.2.17

11 months ago

2.2.18

11 months ago

2.2.15

11 months ago

2.2.16

11 months ago

2.2.13

11 months ago

2.2.14

11 months ago

2.2.11

11 months ago

2.2.12

11 months ago

3.0.3

11 months ago

3.0.1

11 months ago

2.2.19

11 months ago

2.2.29

10 months ago

2.2.26

10 months ago

2.2.27

10 months ago

2.2.24

10 months ago

2.2.25

10 months ago

2.2.22

10 months ago

2.2.23

10 months ago

2.2.20

10 months ago

2.2.37

8 months ago

2.2.38

8 months ago

2.2.35

8 months ago

2.2.36

8 months ago

2.2.33

8 months ago

2.2.34

8 months ago

2.2.32

8 months ago

2.2.30

10 months ago

2.2.5

12 months ago

2.2.7

12 months ago

2.2.6

12 months ago

2.2.10

12 months ago

2.2.9

12 months ago

2.2.8

12 months ago

2.2.4

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago