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

WIP Documentaion #89

Closed
wants to merge 2 commits into from
Closed

WIP Documentaion #89

wants to merge 2 commits into from

Conversation

Tyagiquamar
Copy link

WIP documentation of features.

Pull Request description

Documentation of features

this PR improves the feature documentation

WIP documentation of features.
Copy link
Member

@xmnlab xmnlab left a comment

Choose a reason for hiding this comment

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

@Tyagiquamar thanks for working on that! appreciate that.
it seems the output from help is out-of-date .. could you install the latest version of makim and use the output from there?

we moved from argparse to typer .. so now the output for menu and error message is a bit different.

@Tyagiquamar
Copy link
Author

@xmnlab , thanks for checking it, can you tell me what I have to write at #targets (line no 114) or it is okay?

@xmnlab
Copy link
Member

xmnlab commented Jan 30, 2024

@Tyagiquamar , I think you can use this page as reference: https://docs.docker.com/compose/compose-file/compose-file-v3/

it is not easy to explain every part of the makim file, but I think that using that as references it would be easier to have it in a good shape.

por example, targets is a dictionary, so you can try to find another dictionary there an check how they are explaining that. you can take a look for example into this one: https://docs.docker.com/compose/compose-file/compose-file-v3/#credential_spec

@xmnlab
Copy link
Member

xmnlab commented Jan 31, 2024

@Tyagiquamar , let me know if you have any questions

WIP documentation of features.

Pull Request description
Documentation of features

this PR improves the feature documentation
@Tyagiquamar
Copy link
Author

WIP documentation of features.

@Tyagiquamar
Copy link
Author

@xmnlab can you check this pr

Copy link
Member

@xmnlab xmnlab left a comment

Choose a reason for hiding this comment

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

I will provide the structure of how it should look like

@xmnlab
Copy link
Member

xmnlab commented Feb 8, 2024

@Tyagiquamar we should use https://docs.docker.com/compose/compose-file/compose-file-v3/#credential_spec as a reference

please take a look into this example, it should look like this:

NOTE: ensure you are not missing any important information that we already have in the documentation, and you are not missing any feature of the current .makim.yaml file format


MakIm Configuration File Reference

The .makim.yaml file is a central part of defining and managing your MakIm project configurations. This document outlines the structure and options available within a .makim.yaml file.

Structure Overview

A .makim.yaml file is structured into several sections:

  • version: Specifies the version of the MakIm file format.
  • env-file: Specifies a global environment file.
  • shell: Defines the default shell for running commands.
  • groups: Organizes targets into named groups.
  • targets: Defines the actions or commands that can be executed.
  • env: Sets environment variables at different scopes.
  • dependencies: Lists other targets that must be run before the current one.
  • working-directory: Sets the working directory for the command execution.

Version

Specifies the .makim.yaml file format version being used.

version: 1.0

Env-file

Specifies a path to an environment file that should be loaded before executing any commands.

env-file: .env

Shell

Defines the default shell for executing the commands. It can be overridden at the group or target level.

shell: bash

Groups

Organizes targets into named groups, allowing for structured and modular command definitions.

groups:
  group-name:
    shell: bash
    env-file: .env-group
    env:
      VAR: "value"
    targets:
      target-name:
        # Target configuration

Group Configuration

  • shell: Optionally override the global shell setting for all targets in the group.
  • env-file: Specify a group-specific environment file.
  • env: Define environment variables available to all targets within the group.

Targets

Defines the actions or commands that can be executed. Targets can include arguments, dependencies, and specific run commands.

targets:
  clean:
    help: "Remove all temporary files"
    run: |
      echo "Cleaning up..."

Target Configuration

  • help: Provides a description of what the target does.
  • args: Defines arguments that can be passed to the target.
  • dependencies: Lists other targets that must be run before this one.
  • run: The command(s) to be executed for this target.

Env

Sets environment variables. These can be defined at the global level, within a group, or within a specific target.

env:
  GLOBAL_VAR: "value"

Dependencies

Specifies other targets that must be run before the current target. Dependencies can include conditions and arguments.

dependencies:
  - target: another-target
    if: "{{ args.condition }}"

Working-directory

Sets the working directory from which the command should be executed. This can be defined globally, for a group, or for a specific target.

working-directory: "/path/to/directory"

Examples

...

@xmnlab
Copy link
Member

xmnlab commented Feb 8, 2024

this is the source of the example above in markdown:

# MakIm Configuration File Reference

The `.makim.yaml` file is a central part of defining and managing your MakIm project configurations. This document outlines the structure and options available within a `.makim.yaml` file.

## Structure Overview

A `.makim.yaml` file is structured into several sections:

- `version`: Specifies the version of the MakIm file format.
- `env-file`: Specifies a global environment file.
- `shell`: Defines the default shell for running commands.
- `groups`: Organizes targets into named groups.
- `targets`: Defines the actions or commands that can be executed.
- `env`: Sets environment variables at different scopes.
- `dependencies`: Lists other targets that must be run before the current one.
- `working-directory`: Sets the working directory for the command execution.

### Version

Specifies the `.makim.yaml` file format version being used.

```yaml
version: 1.0
```

### Env-file

Specifies a path to an environment file that should be loaded before executing any commands.

```yaml
env-file: .env
```

### Shell

Defines the default shell for executing the commands. It can be overridden at the group or target level.

```yaml
shell: bash
```

### Groups

Organizes targets into named groups, allowing for structured and modular command definitions.

```yaml
groups:
  group-name:
    shell: bash
    env-file: .env-group
    env:
      VAR: "value"
    targets:
      target-name:
        # Target configuration
```

#### Group Configuration

- `shell`: Optionally override the global shell setting for all targets in the group.
- `env-file`: Specify a group-specific environment file.
- `env`: Define environment variables available to all targets within the group.

### Targets

Defines the actions or commands that can be executed. Targets can include arguments, dependencies, and specific run commands.

```yaml
targets:
  clean:
    help: "Remove all temporary files"
    run: |
      echo "Cleaning up..."
```

#### Target Configuration

- `help`: Provides a description of what the target does.
- `args`: Defines arguments that can be passed to the target.
- `dependencies`: Lists other targets that must be run before this one.
- `run`: The command(s) to be executed for this target.

### Env

Sets environment variables. These can be defined at the global level, within a group, or within a specific target.

```yaml
env:
  GLOBAL_VAR: "value"
```

### Dependencies

Specifies other targets that must be run before the current target. Dependencies can include conditions and arguments.

```yaml
dependencies:
  - target: another-target
    if: "{{ args.condition }}"
```

### Working-directory

Sets the working directory from which the command should be executed. This can be defined globally, for a group, or for a specific target.

```yaml
working-directory: "/path/to/directory"
```

## Examples

Here, provide comprehensive examples that demonstrate various features and configurations of `.makim.yaml` files. Show how to set up simple to complex workflows, utilize environment variables, define dependencies with conditions, and how to organize commands into groups.

@xmnlab
Copy link
Member

xmnlab commented Mar 18, 2024

@Tyagiquamar, it this is staled, I am closing that for now.
feel free to reopen this or open a new PR if you want to keep working on that.
thanks!

@xmnlab xmnlab closed this Mar 18, 2024
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.

2 participants