permission denied and bad interpreter when attempting to run awscli in Jenkins pipeline
up vote
0
down vote
favorite
I have tried to use the code below to run awscli in a virtual environment. I can activate it and install awscli, but run into permissions issues after. The first shows me trying to set execute permissions on aws, but that leads to a 'bad interpreter error'. The second attempts to run awscli with no changes to permissions. It's just an install and run. Does anyone have a suggestion for a next step?
Thank you.
Example 1:
stages {
stage('Build') {
steps {
scl enable rh-python36 -- python -m virtualenv testvenv
. testvenv/bin/activate
echo WORKSPACE:"${WORKSPACE}"
python -m pip install awscli
chmod +x "${WORKSPACE}"/testvenv/bin/aws
aws ec2 describe-instances
}
}
}
bad interpreter: Permission denied
Example 2:
stages {
stage('Build') {
steps {
scl enable rh-python36 -- python -m virtualenv testvenv
. testvenv/bin/activate
python -m pip install awscli
aws ec2 describe-instances
}
}
}
WORKSPACE/awscli/bin/aws: Permission denied
python jenkins jenkins-pipeline
add a comment |
up vote
0
down vote
favorite
I have tried to use the code below to run awscli in a virtual environment. I can activate it and install awscli, but run into permissions issues after. The first shows me trying to set execute permissions on aws, but that leads to a 'bad interpreter error'. The second attempts to run awscli with no changes to permissions. It's just an install and run. Does anyone have a suggestion for a next step?
Thank you.
Example 1:
stages {
stage('Build') {
steps {
scl enable rh-python36 -- python -m virtualenv testvenv
. testvenv/bin/activate
echo WORKSPACE:"${WORKSPACE}"
python -m pip install awscli
chmod +x "${WORKSPACE}"/testvenv/bin/aws
aws ec2 describe-instances
}
}
}
bad interpreter: Permission denied
Example 2:
stages {
stage('Build') {
steps {
scl enable rh-python36 -- python -m virtualenv testvenv
. testvenv/bin/activate
python -m pip install awscli
aws ec2 describe-instances
}
}
}
WORKSPACE/awscli/bin/aws: Permission denied
python jenkins jenkins-pipeline
You don't have any quotes around the commands anywhere? Or any steps declared in yoursteps
block?
– mkobit
Nov 19 at 23:19
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have tried to use the code below to run awscli in a virtual environment. I can activate it and install awscli, but run into permissions issues after. The first shows me trying to set execute permissions on aws, but that leads to a 'bad interpreter error'. The second attempts to run awscli with no changes to permissions. It's just an install and run. Does anyone have a suggestion for a next step?
Thank you.
Example 1:
stages {
stage('Build') {
steps {
scl enable rh-python36 -- python -m virtualenv testvenv
. testvenv/bin/activate
echo WORKSPACE:"${WORKSPACE}"
python -m pip install awscli
chmod +x "${WORKSPACE}"/testvenv/bin/aws
aws ec2 describe-instances
}
}
}
bad interpreter: Permission denied
Example 2:
stages {
stage('Build') {
steps {
scl enable rh-python36 -- python -m virtualenv testvenv
. testvenv/bin/activate
python -m pip install awscli
aws ec2 describe-instances
}
}
}
WORKSPACE/awscli/bin/aws: Permission denied
python jenkins jenkins-pipeline
I have tried to use the code below to run awscli in a virtual environment. I can activate it and install awscli, but run into permissions issues after. The first shows me trying to set execute permissions on aws, but that leads to a 'bad interpreter error'. The second attempts to run awscli with no changes to permissions. It's just an install and run. Does anyone have a suggestion for a next step?
Thank you.
Example 1:
stages {
stage('Build') {
steps {
scl enable rh-python36 -- python -m virtualenv testvenv
. testvenv/bin/activate
echo WORKSPACE:"${WORKSPACE}"
python -m pip install awscli
chmod +x "${WORKSPACE}"/testvenv/bin/aws
aws ec2 describe-instances
}
}
}
bad interpreter: Permission denied
Example 2:
stages {
stage('Build') {
steps {
scl enable rh-python36 -- python -m virtualenv testvenv
. testvenv/bin/activate
python -m pip install awscli
aws ec2 describe-instances
}
}
}
WORKSPACE/awscli/bin/aws: Permission denied
python jenkins jenkins-pipeline
python jenkins jenkins-pipeline
edited Nov 22 at 11:01
daspilker
5,7601538
5,7601538
asked Nov 19 at 20:55
SO03112
788
788
You don't have any quotes around the commands anywhere? Or any steps declared in yoursteps
block?
– mkobit
Nov 19 at 23:19
add a comment |
You don't have any quotes around the commands anywhere? Or any steps declared in yoursteps
block?
– mkobit
Nov 19 at 23:19
You don't have any quotes around the commands anywhere? Or any steps declared in your
steps
block?– mkobit
Nov 19 at 23:19
You don't have any quotes around the commands anywhere? Or any steps declared in your
steps
block?– mkobit
Nov 19 at 23:19
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53382494%2fpermission-denied-and-bad-interpreter-when-attempting-to-run-awscli-in-jenkins-p%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You don't have any quotes around the commands anywhere? Or any steps declared in your
steps
block?– mkobit
Nov 19 at 23:19