Skip to content

Commit

Permalink
refactor(project)!: rename repository to mkdev
Browse files Browse the repository at this point in the history
  • Loading branch information
ttybitnik committed Jan 13, 2025
1 parent 9819c23 commit b34bea0
Show file tree
Hide file tree
Showing 36 changed files with 278 additions and 278 deletions.
22 changes: 11 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Changelog

## [0.1.0](https://github.com/ttybitnik/mkdevenv/compare/v0.1.0...v0.1.0) (2025-01-11)
## [0.1.0](https://github.com/ttybitnik/mkdev/compare/v0.1.0...v0.1.0) (2025-01-11)


### Features

* **ansible:** add fedora boilerplates ([0a75bcb](https://github.com/ttybitnik/mkdevenv/commit/0a75bcbe55fa54fde94f80cdb23e59d4aa20a53a))
* **bash:** add community boilerplates ([ee75f39](https://github.com/ttybitnik/mkdevenv/commit/ee75f3911d1253bfedd55e65a6602d0d6134a511))
* **bash:** add fedora boilerplates ([5dc2bd5](https://github.com/ttybitnik/mkdevenv/commit/5dc2bd534bde403f62366919c55d11955946fe87))
* **c:** add fedora boilerplates ([c85d227](https://github.com/ttybitnik/mkdevenv/commit/c85d227a12e7bf6c359a5b7853d0f7814667efe8))
* **go:** add community boilerplates ([7cd37c8](https://github.com/ttybitnik/mkdevenv/commit/7cd37c8ff1c05a8765acb3c65be65b57e4a0dd82))
* **go:** add fedora boilerplates ([790e329](https://github.com/ttybitnik/mkdevenv/commit/790e329ad58aa5dc161cbb16f993136947d39070))
* **guile:** add fedora boilerplates ([e42f5c6](https://github.com/ttybitnik/mkdevenv/commit/e42f5c62a176e7db1efe23abc79c4f96e8319c73))
* **lua:** add fedora boilerplates ([70354f5](https://github.com/ttybitnik/mkdevenv/commit/70354f50740d3b90fd613aab338d7beaae3289d1))
* **omni:** add fedora boilerplates ([e994862](https://github.com/ttybitnik/mkdevenv/commit/e994862a7741b249e8e57af1ec679b5c3419d909))
* **project:** initial commit ([e1a9ccf](https://github.com/ttybitnik/mkdevenv/commit/e1a9ccf828850bf66aa8f9e71c2ed07e77b714f8))
* **ansible:** add fedora boilerplates ([0a75bcb](https://github.com/ttybitnik/mkdev/commit/0a75bcbe55fa54fde94f80cdb23e59d4aa20a53a))
* **bash:** add community boilerplates ([ee75f39](https://github.com/ttybitnik/mkdev/commit/ee75f3911d1253bfedd55e65a6602d0d6134a511))
* **bash:** add fedora boilerplates ([5dc2bd5](https://github.com/ttybitnik/mkdev/commit/5dc2bd534bde403f62366919c55d11955946fe87))
* **c:** add fedora boilerplates ([c85d227](https://github.com/ttybitnik/mkdev/commit/c85d227a12e7bf6c359a5b7853d0f7814667efe8))
* **go:** add community boilerplates ([7cd37c8](https://github.com/ttybitnik/mkdev/commit/7cd37c8ff1c05a8765acb3c65be65b57e4a0dd82))
* **go:** add fedora boilerplates ([790e329](https://github.com/ttybitnik/mkdev/commit/790e329ad58aa5dc161cbb16f993136947d39070))
* **guile:** add fedora boilerplates ([e42f5c6](https://github.com/ttybitnik/mkdev/commit/e42f5c62a176e7db1efe23abc79c4f96e8319c73))
* **lua:** add fedora boilerplates ([70354f5](https://github.com/ttybitnik/mkdev/commit/70354f50740d3b90fd613aab338d7beaae3289d1))
* **omni:** add fedora boilerplates ([e994862](https://github.com/ttybitnik/mkdev/commit/e994862a7741b249e8e57af1ec679b5c3419d909))
* **project:** initial commit ([e1a9ccf](https://github.com/ttybitnik/mkdev/commit/e1a9ccf828850bf66aa8f9e71c2ed07e77b714f8))
26 changes: 13 additions & 13 deletions Devenv.mk → Dev.mk
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
# MKDEVENV 0.1.0 (x-release-please-version)
# See <https://github.com/ttybitnik/mkdevenv> for more information.
# MKDEV 0.1.0 (x-release-please-version)
# See <https://github.com/ttybitnik/mkdev> for more information.

PROJECT_NAME = changeme
CONTAINER_ENGINE = changeme

__USER = $(or $(USER),$(shell whoami))

# Host targets/commands
.PHONY: devenv start stop clean serestore
.PHONY: dev start stop clean serestore

devenv:
dev:
$(info Building development container image...)

$(CONTAINER_ENGINE) build \
--build-arg USERNAME=$(__USER) \
-f .mkdevenv/Containerfile \
-t localhost/mkdevenv/$(PROJECT_NAME) \
-f .mkdev/Containerfile \
-t localhost/mkdev/$(PROJECT_NAME) \
.

start:
$(info Starting development container...)

$(CONTAINER_ENGINE) run -it -d --replace \
$(if $(filter podman,$(CONTAINER_ENGINE)),--userns=keep-id) \
--name mkdevenv-$(PROJECT_NAME) \
--name mkdev-$(PROJECT_NAME) \
--volume .:/home/$(__USER)/workspace:Z \
localhost/mkdevenv/$(PROJECT_NAME):latest
localhost/mkdev/$(PROJECT_NAME):latest

@# $(CONTAINER_ENGINE) compose .mkdevenv/compose.yaml up -d
@# $(CONTAINER_ENGINE) compose .mkdev/compose.yaml up -d

stop:
$(info Stopping development container...)

$(CONTAINER_ENGINE) stop mkdevenv-$(PROJECT_NAME)
$(CONTAINER_ENGINE) stop mkdev-$(PROJECT_NAME)

@# $(CONTAINER_ENGINE) compose .mkdevenv/compose.yaml down
@# $(CONTAINER_ENGINE) compose .mkdev/compose.yaml down

clean: distclean
$(info Removing development container and image...)

-$(CONTAINER_ENGINE) rm mkdevenv-$(PROJECT_NAME)
-$(CONTAINER_ENGINE) image rm localhost/mkdevenv/$(PROJECT_NAME)
-$(CONTAINER_ENGINE) rm mkdev-$(PROJECT_NAME)
-$(CONTAINER_ENGINE) image rm localhost/mkdev/$(PROJECT_NAME)

@# $(CONTAINER_ENGINE) image prune

Expand Down
30 changes: 15 additions & 15 deletions Omni.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MKDEVENV 0.1.0 (x-release-please-version)
# See <https://github.com/ttybitnik/mkdevenv> for more information.
# MKDEV 0.1.0 (x-release-please-version)
# See <https://github.com/ttybitnik/mkdev> for more information.

OMNI_NAME = changeme
CONTAINER_ENGINE = changeme
Expand All @@ -8,42 +8,42 @@ __USER = $(or $(USER),$(shell whoami))
__AFFIX = omni-$(OMNI_NAME)

# Host targets/commands
.PHONY: devenv start stop clean serestore
.PHONY: dev start stop clean serestore

devenv:
dev:
$(info Building development container image...)

$(CONTAINER_ENGINE) build \
--build-arg USERNAME=$(__USER) \
-f .mkdevenv/Containerfile \
-t localhost/mkdevenv/$(__AFFIX) \
-f .mkdev/Containerfile \
-t localhost/mkdev/$(__AFFIX) \
.

start:
$(info Starting development container...)

$(CONTAINER_ENGINE) run -it -d --replace \
$(if $(filter podman,$(CONTAINER_ENGINE)),--userns=keep-id) \
--name mkdevenv-$(__AFFIX) \
--name mkdev-$(__AFFIX) \
--volume .:/home/$(__USER)/workspace:Z \
--volume mkdevenv-$(__AFFIX)-cache:/home/$(__USER)/.local \
localhost/mkdevenv/$(__AFFIX):latest
--volume mkdev-$(__AFFIX)-cache:/home/$(__USER)/.local \
localhost/mkdev/$(__AFFIX):latest

@# $(CONTAINER_ENGINE) compose .mkdevenv/compose.yaml up -d
@# $(CONTAINER_ENGINE) compose .mkdev/compose.yaml up -d

stop:
$(info Stopping development container...)

$(CONTAINER_ENGINE) stop mkdevenv-$(__AFFIX)
$(CONTAINER_ENGINE) stop mkdev-$(__AFFIX)

@# $(CONTAINER_ENGINE) compose .mkdevenv/compose.yaml down
@# $(CONTAINER_ENGINE) compose .mkdev/compose.yaml down

clean: distclean
$(info Removing development container and image...)

-$(CONTAINER_ENGINE) rm mkdevenv-$(__AFFIX)
-$(CONTAINER_ENGINE) image rm localhost/mkdevenv/$(__AFFIX)
-$(CONTAINER_ENGINE) volume rm mkdevenv-$(__AFFIX)-cache
-$(CONTAINER_ENGINE) rm mkdev-$(__AFFIX)
-$(CONTAINER_ENGINE) image rm localhost/mkdev/$(__AFFIX)
-$(CONTAINER_ENGINE) volume rm mkdev-$(__AFFIX)-cache

@# $(CONTAINER_ENGINE) image prune

Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# mkdevenv: consistent, isolated development
# mkdev: consistent, isolated development

**mkdevenv** is a personal collection of OCI-compliant container image boilerplates for managing isolated development environments using GNU Make.
**mkdev** is a personal collection of OCI-compliant container image boilerplates for managing isolated development environments using GNU Make.

It enables a **consistent**, **open**, and **extensible** workflow by using `Containerfile` and `Makefile` as the standard points of entry. Dependencies and tools are packaged in a custom container, providing isolation and replicability of the development environment while still integrating with the `$EDITOR` on the host system.

> "Don't let the development dependency hell mess with your files and processes. Containerize the development environment!"
> [Tower Guardian](https://imgflip.com/i/9gc41r), in a new take.
[![release](https://img.shields.io/github/v/release/ttybitnik/mkdevenv)](https://github.com/ttybitnik/mkdevenv/releases/latest)
[![ci/cd](https://github.com/ttybitnik/mkdevenv/actions/workflows/cicd.yaml/badge.svg)](https://github.com/ttybitnik/mkdevenv/actions/workflows/cicd.yaml)
[![release](https://img.shields.io/github/v/release/ttybitnik/mkdev)](https://github.com/ttybitnik/mkdev/releases/latest)
[![ci/cd](https://github.com/ttybitnik/mkdev/actions/workflows/cicd.yaml/badge.svg)](https://github.com/ttybitnik/mkdev/actions/workflows/cicd.yaml)
[![conventional commits](https://img.shields.io/badge/conventional%20commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)

**Example of resources on host system**:
Expand Down Expand Up @@ -43,15 +43,15 @@ It enables a **consistent**, **open**, and **extensible** workflow by using `Con

### Setup

1. **Create a `.mkdevenv` directory** at the root of the project or environment. Only files within this path will be shared with the container.
1. **Copy the appropriate files from the [boilerplates](boilerplates/) directory** into the `.mkdevenv` directory—for example, the [ansible-fedora](boilerplates/ansible/fedora) development environment. Clone the **mkdevenv** repository to streamline this process.
1. **Move the `Makefile`** from the `.mkdevenv` directory to the root of the project or environment.
1. **Create a `.mkdev` directory** at the root of the project or environment. Only files within this path will be shared with the container.
1. **Copy the appropriate files from the [boilerplates](boilerplates/) directory** into the `.mkdev` directory—for example, the [ansible-fedora](boilerplates/ansible/fedora) development environment. Clone the **mkdev** repository to streamline this process.
1. **Move the `Makefile`** from the `.mkdev` directory to the root of the project or environment.
1. **Edit the `Makefile`** and adjust variables with `changeme` values. These variables are used for naming, managing, and running the container.

#### Per-project example
```
project/
├── .mkdevenv/
├── .mkdev/
│ ├── Containerfile
│ ├── README.md
│ ├── dnf.txt
Expand All @@ -62,7 +62,7 @@ project/
#### Multi-project (omni) example
```
repositories/
├── .mkdevenv/
├── .mkdev/
│ ├── Containerfile
│ ├── README.md
│ ├── apt.txt
Expand All @@ -78,10 +78,10 @@ repositories/

#### Default commands on host system

- **`make devenv`**: Build the container image defined in `.mkdevenv/Containerfile`.
- **`make start`**: Start the mkdevenv container, passing the current working directory as a bind mount.
- **`make stop`**: Stop the mkdevenv container.
- **`make clean`**: Remove the mkdevenv container and its artifacts. Executes the `distclean` target first.
- **`make devenv`**: Build the container image defined in `.mkdev/Containerfile`.
- **`make start`**: Start the mkdev container, passing the current working directory as a bind mount.
- **`make stop`**: Stop the mkdev container.
- **`make clean`**: Remove the mkdev container and its artifacts. Executes the `distclean` target first.
- **`make serestore`**: Restore project files context on SELinux host systems.

#### Custom commands inside the container
Expand Down Expand Up @@ -140,22 +140,22 @@ In worst-case scenarios, SSH protocol can also be used.

## Contributing

In case of unexpected behavior, please open a [bug report](https://github.com/ttybitnik/mkdevenv/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=).
In case of unexpected behavior, please open a [bug report](https://github.com/ttybitnik/mkdev/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=).

For matters requiring privacy, such as security-related reports or patches, check the [security policy](SECURITY.md).

To contribute to **mkdevenv** boilerplates, see the [project guidelines](boilerplates/README.md).
To contribute to **mkdev** boilerplates, see the [project guidelines](boilerplates/README.md).

### Mailing list

[Email workflow](https://git-send-email.io/) is also available.

Feel free to send patches, questions, or discussions related to **mkdevenv** to the [~ttybitnik/general mailing list](https://lists.sr.ht/~ttybitnik/general).
Feel free to send patches, questions, or discussions related to **mkdev** to the [~ttybitnik/general mailing list](https://lists.sr.ht/~ttybitnik/general).

## License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0), **unless an exception is made explicit in context**. See the `COPYING` file for more information.

Be aware that the resulting container images may include other software subject to additional licenses, such as the base operating system, shells, and any direct or indirect dependencies of the software being contained. As with any built container image, it is the user's responsibility to ensure their use of the image complies with all relevant licenses for the software contained within.

The source code for this project is available at <https://github.com/ttybitnik/mkdevenv>.
The source code for this project is available at <https://github.com/ttybitnik/mkdev>.
16 changes: 8 additions & 8 deletions boilerplates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Containerfile

- **`ARG`**: Build-time argument for specifying the `USERNAME` (default value: `mkdevenv`).
- **`ARG`**: Build-time argument for specifying the `USERNAME` (default value: `mkdev`).
- **`LABEL`**: Metadata instruction including `name`, `summary`, and `usage` information.
- **`RUN`**: Commands for setting up the environment, including installing the **packages files**, removing cache files, and creating the non-root user.
- **`WORKDIR`**: Path to the project files inside the container `/home/$USERNAME/workspace`.
Expand All @@ -32,12 +32,12 @@

- **`PROJECT_NAME`**: Suffix for container and image names, restricted to letters, numbers, underscores, dots, and hyphens `[a-zA-Z0-9][a-zA-Z0-9_.-]*` (default value: `changeme`).
- **`CONTAINER_ENGINE`**: Command for running the container engine, such as `podman` or `docker` (default value: `changeme`).
- Development image names with complete address format, including `localhost`, and `mkdevenv` as the namespace (e.g., `localhost/mkdevenv/$(PROJECT_NAME)`).
- Development container names prefixed with `mkdevenv-` to avoid conflicts (e.g., `mkdevenv-$(PROJECT_NAME)`).
- Development image names with complete address format, including `localhost`, and `mkdev` as the namespace (e.g., `localhost/mkdev/$(PROJECT_NAME)`).
- Development container names prefixed with `mkdev-` to avoid conflicts (e.g., `mkdev-$(PROJECT_NAME)`).

### Host targets/commands

- **`devenv`**: Target for building the development container image.
- **`dev`**: Target for building the development container image.
- **`start`**: Target for starting the container.
- **`stop`**: Target for stopping the container.
- **`clean`**: Target for removing the container and image.
Expand All @@ -59,11 +59,11 @@
- Table describing the packages installed through **packages files** for each package manager.
- Basic three-steps instructions with a link for further details:
```text
1. Create a `.mkdevenv` directory at the root of the project.
2. Copy the boilerplate files into the `.mkdevenv` directory.
1. Create a `.mkdev` directory at the root of the project.
2. Copy the boilerplate files into the `.mkdev` directory.
3. Move the `Makefile` to the root of the project.
*For more information, see <https://github.com/ttybitnik/mkdevenv>.*
*For more information, see <https://github.com/ttybitnik/mkdev>.*
```

## Complete example
Expand All @@ -77,7 +77,7 @@ For a complete example, refer to any of the existing boilerplate files, such as

To ensure your changes follow the guidelines, run `./linter.sh`.

The files `./Devenv.mk` (per-project) and `./Omni.mk` (multi-project) are the source of truth for each approach. Changes to these files, up to the `# Container targets/commands` section, can be propagated to the boilerplates by running `./update-makefiles.sh`.
The files `./Dev.mk` (per-project) and `./Omni.mk` (multi-project) are the source of truth for each approach. Changes to these files, up to the `# Container targets/commands` section, can be propagated to the boilerplates by running `./update-makefiles.sh`.

To streamline this process in one step, run:

Expand Down
12 changes: 6 additions & 6 deletions boilerplates/ansible/fedora/Containerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# MKDEVENV 0.1.0 (x-release-please-version)
# MKDEV 0.1.0 (x-release-please-version)
FROM docker.io/fedora:latest

ARG USERNAME=mkdevenv
ARG USERNAME=mkdev

LABEL mkdevenv.name="ansible-fedora" \
mkdevenv.summary="Image with general tools for developing Ansible-related projects" \
mkdevenv.usage="For more information, see <https://github.com/ttybitnik/mkdevenv>"
LABEL mkdev.name="ansible-fedora" \
mkdev.summary="Image with general tools for developing Ansible-related projects" \
mkdev.usage="For more information, see <https://github.com/ttybitnik/mkdev>"

COPY .mkdevenv/*.txt /tmp/
COPY .mkdev/*.txt /tmp/

RUN dnf update -y && xargs -n 1 dnf install -y < /tmp/dnf.txt && dnf clean all \
&& adduser $USERNAME \
Expand Down
26 changes: 13 additions & 13 deletions boilerplates/ansible/fedora/Makefile
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
# MKDEVENV 0.1.0 (x-release-please-version)
# See <https://github.com/ttybitnik/mkdevenv> for more information.
# MKDEV 0.1.0 (x-release-please-version)
# See <https://github.com/ttybitnik/mkdev> for more information.

PROJECT_NAME = changeme
CONTAINER_ENGINE = changeme

__USER = $(or $(USER),$(shell whoami))

# Host targets/commands
.PHONY: devenv start stop clean serestore
.PHONY: dev start stop clean serestore

devenv:
dev:
$(info Building development container image...)

$(CONTAINER_ENGINE) build \
--build-arg USERNAME=$(__USER) \
-f .mkdevenv/Containerfile \
-t localhost/mkdevenv/$(PROJECT_NAME) \
-f .mkdev/Containerfile \
-t localhost/mkdev/$(PROJECT_NAME) \
.

start:
$(info Starting development container...)

$(CONTAINER_ENGINE) run -it -d --replace \
$(if $(filter podman,$(CONTAINER_ENGINE)),--userns=keep-id) \
--name mkdevenv-$(PROJECT_NAME) \
--name mkdev-$(PROJECT_NAME) \
--volume .:/home/$(__USER)/workspace:Z \
localhost/mkdevenv/$(PROJECT_NAME):latest
localhost/mkdev/$(PROJECT_NAME):latest

@# $(CONTAINER_ENGINE) compose .mkdevenv/compose.yaml up -d
@# $(CONTAINER_ENGINE) compose .mkdev/compose.yaml up -d

stop:
$(info Stopping development container...)

$(CONTAINER_ENGINE) stop mkdevenv-$(PROJECT_NAME)
$(CONTAINER_ENGINE) stop mkdev-$(PROJECT_NAME)

@# $(CONTAINER_ENGINE) compose .mkdevenv/compose.yaml down
@# $(CONTAINER_ENGINE) compose .mkdev/compose.yaml down

clean: distclean
$(info Removing development container and image...)

-$(CONTAINER_ENGINE) rm mkdevenv-$(PROJECT_NAME)
-$(CONTAINER_ENGINE) image rm localhost/mkdevenv/$(PROJECT_NAME)
-$(CONTAINER_ENGINE) rm mkdev-$(PROJECT_NAME)
-$(CONTAINER_ENGINE) image rm localhost/mkdev/$(PROJECT_NAME)

@# $(CONTAINER_ENGINE) image prune

Expand Down
6 changes: 3 additions & 3 deletions boilerplates/ansible/fedora/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
| python3-pip | | |
| ansible-core | | |

1. Create a `.mkdevenv` directory at the root of the project.
2. Copy all the boilerplate files into the `.mkdevenv` directory.
1. Create a `.mkdev` directory at the root of the project.
2. Copy all the boilerplate files into the `.mkdev` directory.
3. Move the `Makefile` to the root of the project.

*For more information, see <https://github.com/ttybitnik/mkdevenv>.*
*For more information, see <https://github.com/ttybitnik/mkdev>.*
Loading

0 comments on commit b34bea0

Please sign in to comment.