Skip to content

Use Script Location Instead of Relative Path in build.py #211

@Raymond0212

Description

@Raymond0212

Type

Feature Request

Description

Updates the build.py script to use the script’s absolute location rather than relying on a relative path.

Rationale

Hi Mendix Team,

While setting up CI/CD pipelines using the Mendix Docker Buildpack with GitLab, I noticed that the current implementation assumes the script is executed from the root of the buildpack repository. This assumption may not hold in some CI/CD scenarios, where the buildpack might be downloaded into a temporary directory and invoked from within the root of the Mendix project instead.

By resolving paths relative to the script’s actual location, it makes build.py more robust and flexible in a wider range of environments and improves customers' experience using the build pack.

Suggested Changes

  1. Add SCRIPT_DIR as global variable to address the location of current script.
  2. Join SCRIPT_DIR with following files & directories to avoid file not found issue
    • scripts
    • Dockerfile
    • mxbuild

I have the changes in my forked repo and have tried to successfully built a mda directory in my local machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions