Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Closes #2, #3, #4
  • Loading branch information
AlexSkrypnyk authored May 6, 2024
1 parent 76b0b60 commit e37eaa4
Showing 1 changed file with 44 additions and 79 deletions.
123 changes: 44 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,6 @@ and make it available for a developer to work on; `reset` command would remove
any build artifacts; `info` would display project information in a user-friendly
way.

## Why DX?

Imagine the simplicity and efficiency of building any project with a single
command, regardless of its programming language or framework.

Think of the convenience of running tests or performing routine development
tasks across various projects using standardized commands without the hassle
of remembering a myriad of options and arguments.

The DX initiative aims to establish a universal set of commands, functioning as
a common language among developers. This "contract" - akin to an interface in
object-oriented programming, but designed for human interaction - seeks to
standardize command vocabulary across projects.

Some examples include:

- The `build` command, which encompasses all necessary steps to prepare a
project for development.
- The `reset` command, tasked with cleaning up any build artifacts.
- The `info` command, designed to present project details in an accessible,
user-friendly format.

This approach not only streamlines the development process but also fosters a
more collaborative and intuitive environment for developers working on diverse
projects.

## What's next?

Depending on your language or a framework, you may create your own
Expand All @@ -74,11 +48,13 @@ Would print project information

## Existing implementations

- [DrevOps](https://drevops.com) implements these commands for Drupal
development (PHP).
- [DrevOps Scaffold](https://github.com/drevops/scaffold) implements these commands for Drupal
consumer site development (PHP)
- [Drupal extension scaffold](https://github.com/AlexSkrypnyk/drupal_extension_scaffold) implements these commands for Drupal
extensions development (PHP)
- Implement for your language or framework and be listed here!

## Similar and partial implementations (that would be nice to unify)
## Similar and partial implementations

- GovCMS (PHP,
Drupal, [https://github.com/govCMS/GovCMS/blob/3.x-develop/.ahoy.yml](https://github.com/govCMS/GovCMS/blob/3.x-develop/.ahoy.yml))
Expand All @@ -89,25 +65,25 @@ Would print project information

## `build`

- Single project start command.
- Single project start command
- Calls other commands as required to do what is necessary in order to have
project ready to be worked on.
- Guarantees idempotent file state on rerun.
project ready to be worked on
- Guarantees idempotent file state on rerun

## `info`

- Display project information in user-friendly way
- Display project information in a user-friendly way
- Does not perform any actions such as login, cleanup etc.

## `install`

- Install project and all dependencies.
- Install project code and all required dependencies

## `provision`

- Perform application-level operations to guarantee consistent application
state.
- May perform brand-new site installation or using existing site.
state
- May perform brand-new site installation or using existing site

## `lint`

Expand All @@ -117,83 +93,72 @@ Would print project information

## `lint-fix`

- Fix coding standards for violations
- Fix violations in coding standards

## `test-unit`

- Run unit tests.
- Agnostic to framework.
- Must run all tests if no arguments provided.
- Run unit tests
- Agnostic to framework
- Must run all tests if no arguments provided

## `test-bdd`

- Run behavioural tests
- Run behaviour tests
- Must run all tests if no arguments provided.

## `up`, `down`, `start`, `stop`, `logs`

Used for Docker-based projects.
Used for container-based projects.

- `up` will build Docker images if they do not exist and will start containers.
- `down` will stop and remove containers.
- `up` will build container images if they do not exist and will start containers
- `down` will stop and remove containers
- `start` will start existing or create new containers from previously built
images and will fail if images are not built.
- `stop` will stop containers, but will not remove any volumes.
- `logs` will show logs for all or selected services.
images and will fail if images are not built
- `stop` will stop containers, but will not remove any volumes
- `logs` will show logs for all or selected services

## `reset`

- Bring project to the default state.
- Remove installed dependencies.
- Bring project to the default state
- Remove installed dependencies
- Stops any running containers

## `update`

- Update ahoy configuration itself.
- Possible to update some platform files.
- Update ahoy configuration itself
- Possible to update some platform files

## `doctor`

- Identify any problems with the stack.
- Offer resolution suggestions.
- Run before build in pre-flight mode.
- Identify any problems with the stack
- Offer resolution suggestions
- May run before build in pre-flight mode

## Command wrapper

[Ahoy](https://ahoy-cli.readthedocs.io/en/latest/) provides clean and simple way
to create and maintain unified commands within a single YAML file.

[.ahoy.yml](https://github.com/drevops/dx/blob/main/.ahoy.yml) file
in this repository is an example of the command configuration file.

[.ahoy.local.example.yml](https://github.com/drevops/dx/blob/main/.ahoy.local.example.yml)
file in this repository is an example of the local command configuration file
that would be excluded from the repository. This file is used to define
additional local commands.

### Ahoy config
### Features

- Contain as less custom code as possible: rely on scripts or binaries that can
be ran without ahoy.
- Do not include environment variables into ahoy config - they should be only
- Do not include environment variables into wrapper config - they should be only
listed in `.env` files.
- Support reading environment variables from `.env` and `.env.local` files.
- Fail ahoy command if at least one sub-command fails.
- Fail a wrapper command if at least one sub-command fails.
- Commands should accept parameters and options as original binaries would do
(i.e., `ahoy test-bdd path/to/test/file`).

## Extending command list
### Implementations

Some projects may require specific commands that are not a part from the list
above. You may easily extend your command list, provided that you do not break
existing command semantic described above.
- [Ahoy](https://ahoy-cli.readthedocs.io/en/latest/) provides clean and simple way
to create and maintain unified commands within a single YAML file. [.ahoy.yml](https://github.com/drevops/dx/blob/main/.ahoy.yml) file
in this repository is an example of the command configuration file. [.ahoy.local.example.yml](https://github.com/drevops/dx/blob/main/.ahoy.local.example.yml)
file in this repository is an example of the local command configuration file
that would be excluded from the repository. This file is used to define
additional local commands.

Ahoy allows
to [extend](https://github.com/ahoy-cli/ahoy/wiki#importing-commands-from-other-ahoy-files)
command list in a separate command files without modifying main `.ahoy.yml`
file.
- [Task](https://github.com/go-task/task) - a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make.

## Feedback and contribution

Please feel free to provide feedback or propose to add more commands to
the proposed list
by [opening a new issue](https://github.com/drevops/dx/issues/new).
Please feel free to provide feedback or propose to add more commands to
the proposed list by [opening a new issue](https://github.com/drevops/dx/issues/new).

0 comments on commit e37eaa4

Please sign in to comment.