livecycle / preevy

Quickly deploy preview environments to the cloud!

Home Page:https://preevy.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Unable to set ProjectDirectory breaking 'includes' in docker-compose

aleclerc-cio opened this issue · comments

What happened?

Since #340 I am unable to get my docker-compose project to work. Here's a simplified Version:
subfolder/docker-compose.yaml

version: "3.8"

include:
- ./services-compose.yaml

subfolder/services-compose.yaml

services:
  api:
    image: <image>

If I try to run preevy from the root (which I have to do using preevy-action-up) I get

✔ Loading compose file: devboxsome/compose.yaml
    Error: Could not load compose file: command `docker compose 
    --project-directory /runner/_work/reponame/reponame -f 
    subfolder/docker-compose.yaml convert` exited with code 14: open 
    /runner/_work/reponame/reponame/services-compose.yaml: no such file or 
    directory

    Code: ERR_LOADING_COMPOSE_FILE
    Try this:
      * Run the command at a directory containing a compose file
      * Specify the -f flag
    Reference: https://docs.docker.com/compose/compose-file/03-compose-file/

This makes sense because here we force project-directory to be the cwd with no way to pass it in as far as I can tell

      - uses: livecycle/preevy-up-action@v2.3.0
        id: preevy_up
        with:
          profile-url: gs://<private>
          docker-compose-yaml-paths: subfolder/docker-compose.yaml
        env:
          COMPOSE_PROJECT_NAME: "tesT"

Add screenshots

n/a

Steps to reproduce the behavior

See Above

Expected behavior

I should be able to either pass in the CWD, or ignore it

What OS are you seeing the problem on?

Linux

Additional context

0.0.57+

Record

  • I agree to follow this project's Code of Conduct

Also thought of changing working directory, but that doesn't seem to work for uses steps in GHA as per here

@aleclerc-cio just added working-directory to the up and down actions.

Will consider adding --project-directory to the preevy up command as well.