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

Add Makefile, use Docker for lint/test/CI #34

Merged
merged 3 commits into from
Jun 25, 2020
Merged

Add Makefile, use Docker for lint/test/CI #34

merged 3 commits into from
Jun 25, 2020

Conversation

aureliojargas
Copy link
Owner

@aureliojargas aureliojargas commented Jun 24, 2020

Instead of installing dependencies in both the local machine and in
Travis runner, install everything inside the clitest Docker image:

  • Supported shells: bash, dash, mksh, zsh
  • Linter: checkbashisms

Also updated Alpine version from 3.7 to 3.11.

The image size grew from ~40MB to ~60MB.

The Docker container is not using ENTRYPOINT anymore, to make it easier
to run arbitrary commands inside it. So now you have to explicitly run
the clitest command.

Add a Makefile to isolate all the commands related to dev tasks such as
running linters and tests. Note that by default all those tasks are run
inside the clitest Docker container. To run them directly on the host,
avoiding the container, unset the docker_run variable. Examples:

make test-bash               # test using container's bash
make test-bash docker_run=   # test using host's bash

The CI configuration (Travis) was updated to avoid installing
dependencies and to run make targets inside a freshly built Docker
container.

Also fixed the COLUMNS handling in the tests, so it is compatible with
bash and mksh running inside the container.

Also remove deprecated MAINTAINER instruction.
Since I plan to use this container also as the dev container, to run
linters and tests inside it in the CI, having ENTRYPOINT is cumbersome
when you want to execute any other command except clitest.
@aureliojargas aureliojargas force-pushed the makefile branch 2 times, most recently from 72042fd to b41713a Compare June 25, 2020 05:41
Instead of installing dependencies in both the local machine and in
Travis runner, install everything inside the clitest Docker image:

- Supported shells: bash, dash, mksh, zsh
- Linter: checkbashisms

The image size grew from ~40MB to ~60MB.

Add a Makefile to isolate all the commands related to dev tasks such as
running linters and tests. Note that by default all those tasks are run
inside the clitest Docker container. To run them directly on the host,
avoiding the container, unset the `docker_run` variable. Examples:

    make test-bash               # test using container's bash
    make test-bash docker_run=   # test using host's bash

The CI configuration (Travis) was updated to avoid installing
dependencies and to run make targets inside a freshly built Docker
container.

Also fixed the `COLUMNS` handling in the tests, so it is compatible with
bash and mksh running inside the container.
@aureliojargas aureliojargas merged commit eefe2a2 into master Jun 25, 2020
@aureliojargas aureliojargas deleted the makefile branch June 25, 2020 06:36
aureliojargas added a commit that referenced this pull request Jun 29, 2020
In #34, development tools were added to the official clitest Docker
image, making it both an end user image and a development environment.
This was a bad idea.

This commit separates them in two different images.

- The official public clitest image was moved to a new repository:
  https://github.com/aureliojargas/clitest-docker. Now everything is
  automated and releasing a new clitest image to Docker Hub is just a
  matter of adding a git tag to that repository. Everything related to
  that image was removed from this repository.

- The local development image remains here, named `clitest-dev` and
  described in the new `Dockerfile.dev` file. It does not have clitest
  inside it, it's just the development environment. When running the
  image, the current clitest code should be mounted inside it.

In short, everything dev-related is here. After releasing a new clitest
version (here), go to the other repository to make the official Docker
image for it.
aureliojargas added a commit that referenced this pull request Jun 29, 2020
In #34, development tools were added to the clitest Docker image, making
it both an end user image and a development environment. This was a bad
idea.

This commit separates them in two different images.

- The public clitest image was moved to a new repository:
  https://github.com/aureliojargas/clitest-docker. Now everything is
  automated and releasing a new clitest image to Docker Hub is just a
  matter of adding a git tag to that repository. Everything related to
  that image was removed from this repository.

- The local development image remains here, named `clitest-dev` and
  described in the new `Dockerfile.dev` file. It does not have clitest
  inside it, it's just the development environment. When running the
  image, the current clitest code should be mounted inside it.

In short, everything dev-related is here. After releasing a new clitest
version (here), go to the other repository to make the official Docker
image for it.
aureliojargas added a commit that referenced this pull request Jun 30, 2020
In #34, development tools were added to the clitest Docker image, making
it both an end user image and a development environment. This was a bad
idea.

This commit separates them in two different images.

- The public clitest image was moved to a new repository:
  https://github.com/aureliojargas/clitest-docker. Now everything is
  automated and releasing a new clitest image to Docker Hub is just a
  matter of adding a git tag to that repository. Everything related to
  that image was removed from this repository.

- The local development image remains here, named `clitest-dev` and
  described in the new `Dockerfile.dev` file. It does not have clitest
  inside it, it's just the development environment. When running the
  image, the current clitest code should be mounted inside it.

In short, everything dev-related is here. After releasing a new clitest
version (here), go to the other repository to make the official Docker
image for it.
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.

1 participant