2.2.38 • Published 1 year ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

2.2.18

1 year ago

2.2.15

1 year ago

2.2.16

1 year ago

2.2.13

1 year ago

2.2.14

1 year ago

2.2.11

1 year ago

2.2.12

1 year ago

3.0.3

1 year ago

3.0.1

1 year ago

2.2.19

1 year ago

2.2.29

1 year ago

2.2.26

1 year ago

2.2.27

1 year ago

2.2.24

1 year ago

2.2.25

1 year ago

2.2.22

1 year ago

2.2.23

1 year ago

2.2.20

1 year ago

2.2.37

1 year ago

2.2.38

1 year ago

2.2.35

1 year ago

2.2.36

1 year ago

2.2.33

1 year ago

2.2.34

1 year ago

2.2.32

1 year ago

2.2.30

1 year ago

2.2.5

1 year ago

2.2.7

1 year ago

2.2.6

1 year ago

2.2.10

1 year ago

2.2.9

1 year ago

2.2.8

1 year ago

2.2.4

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago