Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Resolve private GitHub https access (~/.netrc file). #24

Open
Syntactical01 opened this issue Aug 18, 2020 · 0 comments
Open

Resolve private GitHub https access (~/.netrc file). #24

Syntactical01 opened this issue Aug 18, 2020 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Syntactical01
Copy link
Contributor

Syntactical01 commented Aug 18, 2020

Issue:

Scenario::

  • Trying to package a project that uses a setup.py which has a dependency from a private GitHub repository.

Problem: The follow DroneCI step fails because the pip installation fails saying it does not have access to the repository.

  - name: build-deployment
    image: 3mcloud/lambda-packager:python-3.7
    pull: always
    depends_on: []
    environment:
      LAMBDA_CODE_DIR: ./src
      ARTIFACT_NAME: deployment.zip

But the following step works without issues.

  - name: build-deployment
    image: 3mcloud/lambda-packager:python-3.7
    pull: always
    depends_on: []
    environment:
      LAMBDA_CODE_DIR: ./src
      ARTIFACT_NAME: deployment.zip
    commands:
    - /entrypoint.sh

The reason for this is in regards to when the volume mount happens. In the second scenario the entrypoint.sh script runs after the volume mount, in which case drone mounts ~/.netrc which is used for GitHub access. In the first case, the ~/.netrc file is not yet mounted when CMD ["/entrypoint.sh"] is run within the Docker image, thus there is not GitHub access for the clone to work.

To verify this, I swapped out CMD ["/entrypoint.sh"] with CMD ["/entrypoint.sh && cat ~/.netrc"] in one of the Dockerfiles and got:
image

We should switch to using environment variables to generate the ~/.netrc file.

@Syntactical01 Syntactical01 added bug Something isn't working help wanted Extra attention is needed labels Aug 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant