I'm trying to write a custom pipe which ends up doing a docker build and push. I ran into a permissions issues with a mercurial file. When running the "docker build ..." command I got the following error:
error checking context: 'no permission to read from '/opt/atlassian/pipelines/agent/build/.hg/cache/checkisexec''
Running ls -al on that directory within the script revealed that file didn't have global read:
total 20
drwxrwxrwx. 2 nobody nogroup 4096 Mar 13 14:17 .
drwxrwxrwx. 4 nobody nogroup 4096 Mar 13 14:17 ..
-rw-rw-rw-. 1 nobody nogroup 707 Mar 13 14:17 branch2-base
-rw-rw-rw-. 1 nobody nogroup 818 Mar 13 14:17 branch2-served
-rwx--x--x. 1 nobody nogroup 0 Mar 13 14:17 checkisexec
lrwxrwxrwx. 1 nobody nogroup 16 Mar 13 14:17 checklink -> checklink-target
-rw-rw-rw-. 1 nobody nogroup 0 Mar 13 14:17 checklink-target
-rw-rw-rw-. 1 nobody nogroup 2472 Mar 13 14:17 hgtagsfnodes1
I was able to get around it by adding a chmod on that file in the repos pipeline script before calling the pipe (could not do it in the pipe script itself), but that doesn't seem like it should be necessary. Is this a bug or some setting I'm missing? Oh, I'm using the example simple bash-pipe as template for my custom pipe.
Hello James,
Thank you for your reply.
Do you use .dockerignore file?
If no, try to add it before docker build to ignore Mercurial's repository directory.
# .dockerignore content
.hg
.hgignore
More information about .dockerignore here.
If you have any additional questions feel free to ask.
Cheers,
Alex
And adding a chmod on the file just before running atlassian pipe for Google App Engine deploy did the trick to get around.
thanks @James Stewart and same for me : would like to understand if it is a bug or a wrong setting from my side.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using this atlassian script : atlassian/google-app-engine-deploy:0.3.1 I run into the same kind of issue :
ERROR: (gcloud.app.deploy) Unable to read file [/opt/atlassian/pipelines/agent/build/.hg/cache/checkisexec]: [Errno 13] Permission denied: '/opt/atlassian/pipelines/agent/build/.hg/cache/checkisexec'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mercurial's repository specific.
Looks like the problem with ignoring Mercurial's repository directory in the build and deploy context.
File .gcloudignore in your project's directory can solve that issue.
# .gcloudignore content
.hg
.hgignore
Added answer according to your case google-app-engine-deploy Stuck-during-deploy-pipeline-for-nodejs-app-targeting-google.
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.