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:
rookout-node: rookout/rookout-node@0.0.9
Use rookout-node
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Simple circle-ci file that imports and uses the orb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
orbs:
rookout-node: rookout/rookout-node@0.0.8
description: A circle-ci job that uses rookout-node to debug a node command
jobs:
my_job:
docker:
- image: circleci/node:10
working_directory: ~/Temp
steps:
- rookout-node/run_script:
users_script: node %YOUR_NODE_COMMAND%
rookout_tags: yourTag1;yourTag2
version: 2.1
workflows:
main:
jobs:
- my_job
Specify your ROOKOUT_TOKEN in your circle-ci project Environment Variables
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
users_script | Your node command that you wish to debug | Yes | - | string |
rookout_tags | The list of tags you want for your application instances. Use ; as a separator | No | $CIRCLE_PROJECT_REPONAME;$CIRCLE_JOB;circle-ci | 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
# 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: |
A circle-ci orb that installs rookout-node to your job and runs your node program with rookout.
Explore our github repository for further information: https://github.com/Rookout/circle-ci-orbs.
Orb dependencies: bash, nodejs, npm, sudo\root access.
commands:
run_script:
description: "Specify your ROOKOUT_TOKEN in your circle-ci project Environment Variables"
parameters:
users_script:
description: "Your node command that you wish to debug"
type: string
rookout_tags:
description: "The list of tags you want for your application instances. Use ; as a separator"
type: string
default: "$CIRCLE_PROJECT_REPONAME;$CIRCLE_JOB;circle-ci"
steps:
- run:
description: "Install rook if needed"
command: |
if ! which npm > /dev/null; then
echo "[Rookout] npm is not install in this image - please install npm."
exit 1
fi
if which sudo > /dev/null; then
sudo npm install --unsafe-perm -g rookout
else
npm install --unsafe-perm -g rookout
fi
- run:
description: ""
command: |
echo 'export ROOKOUT_ROOK_TAGS="<<parameters.rookout_tags>>"' >> $BASH_ENV
source $BASH_ENV
if [ "<<parameters.users_script>>" != "" ]; then
rookout-node <<parameters.users_script>>
fi
examples:
simple-node-debugging:
description: Simple circle-ci file that imports and uses the orb
usage:
orbs:
rookout-node: rookout/rookout-node@0.0.8
description: "A circle-ci job that uses rookout-node to debug a node command"
jobs:
my_job:
docker:
- image: circleci/node:10
working_directory: ~/Temp
steps:
- rookout-node/run_script:
users_script: "node %YOUR_NODE_COMMAND%"
rookout_tags: "yourTag1;yourTag2"
version: 2.1
workflows:
main:
jobs:
- my_job