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

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

@Syntactical01

Description

@Syntactical01

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions