Add a Dockerfile
Add a Dockerfile to significantly improve the quality of generated code
Configuring a Dockerfile and commands allow Ellipsis to test it’s own code before submitting it back to a human. This is highly suggested as it greatly increases the quality of generated code.
By default, when Ellipsis writes code in response to comments, messages, and issues, it doesn’t have a way to test the code it generates. As a result, linter errors or failing tests can be common.
To fix this, you can provide a Dockerfile and a list of commands that Ellipsis can use to test the code it generates before submitting that code back to human.
For example, if you notice that Ellipsis constantly suggests code that doesn’t pass your linter, you should configure a Dockerfile and a lint command (e.g., npm run lint
). Ellipsis will then attempt to lint it’s own code before opening a pull request. If the lint command fails, Ellipsis will fix the problem before moving on, or at least notify you why it wasn’t able to resolve the lint error.
In that example, your ellipsis.yaml
configuration file might look like:
and the Dockerfile might look like:
Instructions
Set up takes 5 minutes using our web UI. Open the console. Click “code” on the sidebar. Select your repository from the drop-down menu.
Add environment variables
Only required if your project needs environment variables to run the commands! Be sure to use dev env vars, not prod.
Add Commands
Add commands to your config file. Commands are executed from the root of the repository and can lint, build, and even run your tests. Include whichever commands you use while developing.
Add a Dockerfile
The file should install the dependencies and copy your code into the container. We build this from the root of the repository.
- The Dockerfile needs to include the Git CLI.
- Do not include an
ENTRYPOINT
orCMD
. - Update your
ellipsis.yaml
to point to this file by addingfile
underbuild
.
Test
Click “Test build and commands” and wait. If it fails, inspect the logs and fix the issue.
Add files to repository
Once the build passes, use the “Add to repository using PR” button to send the Dockerfile and config file to your repository. Merge the PR, and now, Ellipsis will use these commands to fix its own mistakes before opening a PR!