Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exec-wrapper can't write files into /workspace folder in Cloud Build #205

Open
jkevingutierrez opened this issue Sep 7, 2021 · 0 comments

Comments

@jkevingutierrez
Copy link

jkevingutierrez commented Sep 7, 2021

Trying to run a Cloud Build file like the next:

steps:
  - name: 'gcr.io/google-appengine/exec-wrapper'
    id: TEST
    args:
      [
        '-i',
        'gcr.io/$PROJECT_ID/${_BUILD_TARGET}',
        '-s',
        '${_CLOUD_SQL_DEV}',
        '-e',
        'DJANGO_SETTINGS_MODULE=${_DJANGO_SETTINGS}',
        '-e',
        'CLOUD_SQL=/cloudsql/${_CLOUD_SQL_DEV}',
        '--',
        'bash',
        '-c',
        'touch /workspace/test.txt',
      ]

Is throwing an error, as it can't write in the /workspace folder:

touch: cannot touch '/workspace/test.txt': Permission denied

It would be great if the workspace directory and/or any other volume defined in the step were mapped directly, but it could also be a good option to accept volumes as parameters with the -v option. Something like

  - name: 'gcr.io/google-appengine/exec-wrapper'
    id: TEST
    args:
      [
        '-i',
        'gcr.io/$PROJECT_ID/${_BUILD_TARGET}',
        '-s',
        '${_CLOUD_SQL_DEV}',
        '-e',
        'DJANGO_SETTINGS_MODULE=${_DJANGO_SETTINGS}',
        '-e',
        'CLOUD_SQL=/cloudsql/${_CLOUD_SQL_DEV}',
        '-v',
        '/workspace:/workspace',
        '--',
        'bash',
        '-c',
        'touch /workspace/test.txt',
      ]
@jkevingutierrez jkevingutierrez changed the title Can't write files into workspace folder in Cloud Build Can't write files into /workspace folder in Cloud Build Sep 7, 2021
@jkevingutierrez jkevingutierrez changed the title Can't write files into /workspace folder in Cloud Build exec-wrapper Can't write files into /workspace folder in Cloud Build Sep 7, 2021
@jkevingutierrez jkevingutierrez changed the title exec-wrapper Can't write files into /workspace folder in Cloud Build exec-wrapper can't write files into /workspace folder in Cloud Build Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant