title: AWS CodeBuild Skipping invalid artifact path - not a valid identifier
body: <p>I have an AWS CodeBuild that processes two projects, during the build process the source will get built and bundled in zip files and placed in <code>bundles/*</code>. </p>
  
  <p>The following is how the directory tree looks like, where bundles contains the generated zip files to be deployed:</p>
  
  <p><a href="https://i.stack.imgur.com/2IMi7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2IMi7.png" alt="Directory tree"></a></p>
  
  <p>It uses the following <code>buildspec.yml</code>:</p>
  
  <pre><code>version: 0.2
  
  phases:
    install:
      commands:
        - ./manager.sh install
    build:
      commands:
        - ./manager.sh build
        - ./manager.sh package
        - ./manager.sh test
        - ./manager.sh test:functional
        - ./manager.sh test:deploy
    post_build:
      commands:
        - ls -l bundles # I see the artifacts on the console using this
  
  artifacts:
    files: 
      - 'bundles/*'
  </code></pre>
  
  <p>After the tests, after the building passes the deploy fails. <a href="https://i.stack.imgur.com/bwO3w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bwO3w.png" alt="CodeBuild"></a></p>
  
  <p>This returns <code>Skipping invalid artifact path [edited] not a valid identifier .</code> (where it should be bundles)</p>
  
  <p>I have tried multiple combinations of the following:</p>
  
  <p>this one returns <code>Skipping invalid artifact path [edited] not a valid identifier bundles</code></p>
  
  <pre><code>artifacts:
    base-directory: bundles
    files: 
      - '**/*'
  </code></pre>
  
  <p>Or this one <code>Skipping invalid artifact path [edited] not a valid identifier .</code></p>
  
  <pre><code>artifacts:
    files: 
      - bundles
  </code></pre>
  
  <p>here is the full error:</p>
  
  <pre><code>[Container] 2018/02/12 19:13:05 Expanding /codebuild/output/tmp/env.sh: line 69: export: `npm_config_unsafe-perm': not a valid identifier
  .
  [Container] 2018/02/12 19:13:05 Skipping invalid artifact path /codebuild/output/tmp/env.sh: line 69: export: `npm_config_unsafe-perm': not a valid identifier
  .
  [Container] 2018/02/12 19:13:05 Phase complete: UPLOAD_ARTIFACTS Success: false
  [Container] 2018/02/12 19:13:05 Phase context status code: CLIENT_ERROR Message: No matching base directory path found for /codebuild/output/tmp/env.sh: line 69: export: `npm_config_unsafe-perm': not a valid identifier
  .
  [Container] 2018/02/12 19:13:07 Runtime error (*errors.errorString: No matching base directory path found for /codebuild/output/tmp/env.sh: line 69: export: `npm_config_unsafe-perm': not a valid identifier
  .)
  </code></pre>
  
  <p>Could it be my <code>docker container</code>?</p>