Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Dockerfile support to maestro workflow #68

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

fagiani
Copy link
Member

@fagiani fagiani commented Apr 14, 2023

This PR aims to add the possibility to use docker build as an alternative to pack build in the maestro workflow.

Currently buildpacks will rely on the .env file to feed environment variables during the build and we need to figure if that is required for this new approach and if so, how.

@fagianijunior Please start tests with a sample project and create additional commits as required.

Copy link
Contributor

@fagianijunior fagianijunior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't work for multirepo, which is the purpose of the task.

build.sh Outdated
build_built=true
fi

if [ -f project.toml ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will run together with the 35 line, if any project has Dockerfile (to local development) and Project.toml to build.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fagianijunior having them both is definitely not ideal but how to handle that? which one takes precedence? I dislike the idea of adding yet another ENV for defining it as proposed in the last commit.

Copy link
Member Author

@fagiani fagiani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MatheusdeMelo Please take a look at the comments in order to fix and improve this PR

build.sh Outdated
cd $MAESTRO_BUILD_FOLDER
fi

if [ $MAESTRO_BUILD_MODE == Dockerfile ]; then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check differs from the one in the elif...

if you have changed the directory why don't just check for the file presence as before?

build.sh Outdated
exit 0
fi

if [ ! -z $MAESTRO_BUILD_FOLDER ]; then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest $WORKLOAD_PATH instead of $MAESTRO_BUILD_FOLDER

build.sh Outdated
fi

if [ ! -z $MAESTRO_BUILD_FOLDER ]; then
cd $MAESTRO_BUILD_FOLDER
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of changing directory you could leverage the docker and pack path parameters

@MatheusdeMelo
Copy link
Contributor

@fagiani, if a person want's to use buildpack and the repository is multi folder, how can he run the pack build command on the correct directory?

Comment on lines +34 to +35
if [ -z "$WORKLOAD_PATH" ]; then
$WORKLOAD_PATH=.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fagiani here $WORKLOAD_PATH receive the "." as value if it's empty, thinking about this with @fagianijunior we think wich is unnecessary utilize bash parameter expansion to change the value to "." again.

README.md Outdated
@@ -79,6 +79,7 @@ Variable | Description | Examples/Values | Default
`DEPLOYMENT_CIRCUIT_BREAKER_RULE` | Enable or disable circuit breaker | `enable=true,rollback=true`
`ECS_CONTAINER_STOP_TIMEOUT` | Set stopTimeout on taskdefinition | min: 0, max: 120, default: 30
`TZ`| Set this variable to the desired task timezone | America/Sao_Paulo
`WORKLOAD_PATH`| Set the workload path to run build commands on correct directory| ./Projects/my-app, ./
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Set the workload path to run build commands on correct directory" should do it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to new description.

@MatheusdeMelo
Copy link
Contributor

@fagiani @fagianijunior this PR can be merged or is necessary other changes to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants