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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.