Workdir should be writable by defaults


#1

The workdir should be +w by default as it was in the 1.0.
Otherwise it leads to obscure permission errors. The fix is also quite obscure :slight_smile:

version: 2
executorType: machine
stages:
  build:
    workDir: ~/repository_name
    steps:
      - type: checkout
      - type: shell
        name: Build the images
        command: docker-compose build
      - type: shell
        name: Chmod all the things
        command: sudo chmod -R 777 .
      - type: shell
        name: Run tests
        command: make test

#2

From what user are you running commands? +w is enabled for the owner and the group.

drwxrwxr-x 3 circleci circleci 4096 Feb 21 19:53 .


#3

Ditto what Ryan said. I ran a diagnostic build with:

version: 2
executorType: machine
stages:
  build:
    workDir: ~/repository_name
    steps:
      - type: checkout
      - type: shell
        name: Check permissions
        command: |
          ls -la ~
          ls -la ~/repository_name

I see that circleci owns everything except root-owned ~/.bashrc.backup. Everything has +w on this bare repo. Is it possible that the permissions are set on your project in the repo?


#4