Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,392
Community Members
 
Community Events
184
Community Groups

extract_capabilities.sh script throws error

I use the script found at https://confluence.atlassian.com/bamkb/how-to-export-a-remote-agent-capability-list-to-bamboo-capatilities-properties-format-1108676050.html

 

#!/bin/bash
USER=admin
PASS=admin
BAMBOO_SERVER="https://bamboo80.mydomain.net"
CURL="curl -s -k -X GET"
DELIMITER="@#CaPaBiliTy#@" # Set this to a string you know that will not appear on any Agent name
AGENTS=$(${CURL} -u ${USER}:${PASS} "${BAMBOO_SERVER}/rest/api/latest/agent/remote" | jq -r '.[] | .name|=gsub(" "; "_") | [.id, .name] | join('\"${DELIMITER}\"')')

get_capability() {
  ${CURL} -u ${USER}:${PASS} "${BAMBOO_SERVER}/rest/api/latest/agent/${1}/capability" \
    | jq -r '.[] | .key|=gsub(" "; "\\ ") | .value|=gsub("\\\\";"\\\\") | [.key, .value] | join("=")' | sort
}

for AGENT in ${AGENTS[@]}; do
  agent=(${AGENT/${DELIMITER}/ });
  get_capability ${agent[0]} > bamboo-capabilities.properties-${agent[1]}
done

I edit it with my username, password, and site, set it as an executable then run it and get error:

parse error: Invalid numeric literal at line 1, column 10

 

Shouldn't something you post on your site work out of the box?

1 answer

1 accepted

0 votes
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 04, 2022

Hello @William Flow

That's a jq message. It means the input is not the one expected by the filter. Have you tried running each part of the script individually without piping it to jq and seeing the results?

As noted on the page, that script requires jq 1.6. Make sure to use that version or later.

Best regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

I checked it looked right but no problem I re-wrote the script to make it work

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events