I have several Elixir projects, and I want to use AutoDevops. Clearly tests are not ran by default, because the env is nor recognised. So I have defined a BUILDPACK_URL
env var pointing to https://github.com/HashNuke/heroku-buildpack-elixir.git
; also I have defined a elixir_buildpack.config
which defines a hook to run tests:
hook_post_compile="mix test --trace"
The test job fails with:
Running with gitlab-runner 15.8.0 (12335144)
on ci-runner xxx, system ID: xxx
Preparing the "kubernetes" executor
00:00
Using Kubernetes namespace: gitlab-runner
Using Kubernetes executor with image gliderlabs/herokuish:latest ...
Using attach strategy to execute scripts...
Preparing environment
00:04
Waiting for pod gitlab-runner/runner-yr9ps7cn-project-42637879-concurrent-1tq846 to be running, status is Pending
Running on runner-yr9ps7cn-project-42637879-concurrent-1tq846 via gitlab-runner-6f8fd4c56d-49ks4...
Getting source from Git repository
00:02
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/xxx-redacted-xxx/.git/
Created fresh repository.
Checking out 1c14311e as feature/ci...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:03
$ if [ -z ${KUBERNETES_PORT+x} ]; then # collapsed multi-line command
$ export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOST}:5432/${POSTGRES_DB}"
$ cp -R . /tmp/app
$ /bin/herokuish buildpack test
-----> Fetching custom buildpack
-----> Unable to select a buildpack
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1
Clearly I don’t expect this setup to already work, but the buildpack not being found is a major issue, that I have to fix to resolve the other errors. The point is that I haven’t found any relevant guide that explains how to use a custom buildpack.
Another option would be to define a custom job for tests, but that would exclude the chance to use AutoDevOps, am I right ?