Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
alexjs-orb: lauravuo/alexjs-orb@0.0.1
Use alexjs-orb
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Linting example
1
2
3
4
5
6
7
version: '2.1'
orbs:
alexjs-orb: lauravuo/alexjs-orb@1.2.3
workflows:
use-my-orb:
jobs:
- alexjs-orb/lint
Lint using alex
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
args | Arguments passed to Alex.js | No | '' | string |
version | Alex.js version | No | 9.0.1 | string |
This command runs linter Alex.js
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
args | Arguments passed to Alex.js | No | '' | string |
version | Alex.js version | No | 9.0.1 | string |
This is a sample executor using Docker and Node.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
tag | Pick a specific circleci/node image variant: https://hub.docker.com/r/cimg/node/tags
| No | lts | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
Lint using alex
display:
home_url: https://www.github.com/lauravuo/alexjs-orb
source_url: https://www.github.com/lauravuo/alexjs-orb
commands:
alex:
description: |
This command runs linter Alex.js
parameters:
args:
default: ""
description: Arguments passed to Alex.js
type: string
version:
default: 9.0.1
description: Alex.js version
type: string
steps:
- run:
command: |
Alex() {
sudo npm install --global alex@"${PARAM_VERSION}" > "/dev/null" 2>&1
alex "${PARAM_ARGS}"
}
# Will not run if sourced for bats-core tests.
# View src/tests for more information.
ORB_TEST_ENV="bats-core"
if [ "${0#*$ORB_TEST_ENV}" == "$0" ]; then
Alex
fi
environment:
PARAM_ARGS: <<parameters.args>>
PARAM_VERSION: <<parameters.version>>
name: Lint
executors:
default:
description: |
This is a sample executor using Docker and Node.
docker:
- image: cimg/node:<<parameters.tag>>
parameters:
tag:
default: lts
description: |
Pick a specific circleci/node image variant: https://hub.docker.com/r/cimg/node/tags
type: string
jobs:
lint:
description: |
Lint using alex
executor: default
parameters:
args:
default: ""
description: Arguments passed to Alex.js
type: string
version:
default: 9.0.1
description: Alex.js version
type: string
steps:
- checkout
- alex:
args: << parameters.args >>
version: << parameters.version >>
examples:
example:
description: |
Linting example
usage:
version: "2.1"
orbs:
alexjs-orb: lauravuo/alexjs-orb@1.2.3
workflows:
use-my-orb:
jobs:
- alexjs-orb/lint