You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I am working on bitbucket pipelines using javascript/nodejs as the language.
I need 'jq' command in my script but it throws error of jq: command not found
Below is my bitbucket pipelines.yml file
Hi @nazia_akhtar ,
Thank you for your question!
You can add it with the next command before using jq:
apt-get install -y jq
Hi this is part of a script I am running to attach an image to a page. However, I am getting these errors:
line 10: jq: command not found
line 12: [: =: unary operator expected
Line 10 is ATTACHMENT_TITLE=$(curl -u $USER_NAME:$USER_PASSWORD \ -X POST \ -H "X-Atlassian-Token: nocheck" -F "file=@${ATTACHMENT_FILE_NAME}" -F "comment=File attached via REST API" \ ${CONFLUENCE_BASE_URL}/rest/api/content/${PAGE_ID}/child/attachment 2>/dev/null \ | jq -r '.results[].title')
Line 12 is if [ ${ATTACHMENT_TITLE} = ${ATTACHMENT_FILE_NAME} ]; then
Am not sure what is causing this error as I got this script from an atlassian page. Please let me know how I can fix and run this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
image: node:10.15.3
pipelines:
default:
- step:
name: "prova default"
script:
- echo "Deploying version is $VERSIONRELEASE"
- ls
- mkdir build
- touch build/test.json
- ls build
- apt-get install -y jq
- declare -x VERSION=$(jq -r '.version' package.json)
- echo "package.json version is $VERSION"
+ apt-get install -y jqReading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package jq
sorry, but does not work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Luca,
I had the same issue.
Before you can install jq, you have to make an "apt-get update"
Example:
- apt-get update
- apt-get -y install jq
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.