-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d077e12
commit 8be588a
Showing
2 changed files
with
393 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
pages/blog/makim-efficient-workflows-with-makims-working-directory/.makim.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
version: 1.0 | ||
working-directory: "/tmp/multi_language_project" | ||
groups: | ||
backend_python: | ||
working-directory: "backend/python" | ||
targets: | ||
test: | ||
run: | | ||
echo "Running Python backend tests..." | ||
# Add commands to run Python backend tests | ||
lint: | ||
run: | | ||
echo "Linting Python code..." | ||
# Add commands for linting Python code | ||
backend_java: | ||
working-directory: "backend/java" | ||
targets: | ||
test: | ||
working-directory: "src" | ||
run: | | ||
echo "Running Java backend tests..." | ||
# Add commands to run Java backend tests | ||
build: | ||
run: | | ||
echo "Building Java artifacts..." | ||
# Add commands for building Java artifacts | ||
frontend_react: | ||
working-directory: "frontend/react" | ||
targets: | ||
test: | ||
run: | | ||
echo "Running React frontend tests..." | ||
# Add commands to run React frontend tests | ||
build: | ||
run: | | ||
echo "Building React frontend..." | ||
# Add commands for building React frontend | ||
frontend_vue: | ||
working-directory: "frontend/vue" | ||
targets: | ||
test: | ||
run: | | ||
echo "Running Vue.js frontend tests..." | ||
# Add commands to run Vue.js frontend tests | ||
build: | ||
working-directory: "src" | ||
run: | | ||
echo "Building Vue.js frontend..." | ||
# Add commands for building Vue.js frontend |
341 changes: 341 additions & 0 deletions
341
...blog/makim-efficient-workflows-with-makims-working-directory/blog-working-directory.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,341 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "39d4fdb7-8441-4060-8048-3fc389f37cbd", | ||
"metadata": {}, | ||
"source": [ | ||
"# **Efficent Workflows with Makim's Working Directory**" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "eca10ec0-50fe-4ef2-a80f-75ab15beb60c", | ||
"metadata": {}, | ||
"source": [ | ||
"Welcome to the world of [Makim](https://github.com/osl-incubator/makim), your go-to command-line companion for project automation. In our ongoing effort to enhance Makim's capabilities, we've introduced an exciting new feature—the Working Directory. This feature brings a new level of control and flexibility to your project workflows.\n", | ||
"\n", | ||
"In this blog post, we'll explore the Working Directory feature, understand its syntax, and witness its power in action through real-world examples. Whether you're a Makim veteran or a newcomer, this feature is designed to make your command-line experience more flexible and tailored to your project's needs. Let's dive into the details and unleash the potential of Makim's Working Directory feature!" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "a445f2d9-e743-4b24-9b47-2f00455898de", | ||
"metadata": {}, | ||
"source": [ | ||
"## Unveiling the Power of Working Directories" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "1f75b9ef-ce06-4003-ac8f-308b853a27f5", | ||
"metadata": {}, | ||
"source": [ | ||
"In the bustling realm of project management, one of the key challenges is orchestrating a seamless workflow while ensuring command executions are precisely where they need to be. This is where Makim's **Working Directory** steps into the spotlight, offering a robust solution for organizing, customizing, and optimizing your project commands." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "1a214ca5-810a-4ef9-84d6-93b3c37e1882", | ||
"metadata": {}, | ||
"source": [ | ||
"## Syntax and Scopes" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "56c3a561-48b0-4047-b155-db00bf11eb07", | ||
"metadata": {}, | ||
"source": [ | ||
"The Working Directory feature in Makim operates across three distinct scopes: Global, Group, and Target.\n", | ||
"1. **Global Scope**\n", | ||
" \n", | ||
" At the global scope, setting the working directory impacts all targets and groups within the Makim configuration. It provides a top-level directive to establish a standardized execution environment.\n", | ||
"```yaml\n", | ||
"version: 1.0\n", | ||
"working-directory: /path/to/global/directory\n", | ||
"\n", | ||
"# ... other configuration ...\n", | ||
"```\n", | ||
"\n", | ||
"2. **Group Scope**\n", | ||
" Moving a level deeper, the group scope allows you to tailor the working directory for all targets within a specific group.\n", | ||
"```yaml\n", | ||
"version: 1.0\n", | ||
"\n", | ||
"groups:\n", | ||
" my-group:\n", | ||
" working-directory: /path/to/group/directory\n", | ||
" targets:\n", | ||
" target-1:\n", | ||
" run: |\n", | ||
" # This target operates within the /path/to/group/directory\n", | ||
"```\n", | ||
"3. **Target Scope**\n", | ||
" For fine-grained control over individual targets, the working directory can be specified at the target scope.\n", | ||
"```yaml\n", | ||
"version: 1.0\n", | ||
"\n", | ||
"groups:\n", | ||
" my-group:\n", | ||
" targets:\n", | ||
" my-target:\n", | ||
" working-directory: /path/to/target/directory\n", | ||
" run: |\n", | ||
" # This target operates within the /path/to/target/directory\n", | ||
"```\n", | ||
"\n", | ||
"The flexibility provided by these scopes ensures that your commands are executed in precisely the right context, maintaining a clean and organized project structure." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "05c11ec2-7749-4db0-832b-0738d63c22c0", | ||
"metadata": {}, | ||
"source": [ | ||
"## Why is it helpful?" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ae7bdee0-f8e5-4844-9dbd-1dafb0622b4d", | ||
"metadata": {}, | ||
"source": [ | ||
"Embracing the Working Directory feature in Makim brings forth a multitude of advantages, enhancing the overall project management experience. Let's delve into why this feature is a game-changer for your Makim configurations:\n", | ||
"1. **Isolation of Commands:**\n", | ||
" Users can isolate commands within specific directories, avoiding potential conflicts and ensuring that commands run in the expected environment.\n", | ||
"\n", | ||
"2. **Flexibility in Configuration:**\n", | ||
" Different targets or groups may require different execution environments. The working-directory attribute provides the flexibility to customize these environments, tailoring them to the unique needs of each segment of your project.\n", | ||
"\n", | ||
"3. **Ease of Use:**\n", | ||
" Users can easily understand and manage the execution context of commands within the Makim configuration. This makes the configuration more readable and maintainable, especially when dealing with complex project structures.\n", | ||
"\n", | ||
"4. **Support for Absolute and Relative Paths:**\n", | ||
" The feature supports both absolute and relative paths, allowing users to specify directories based on their requirements. This flexibility ensures compatibility with diverse project structures and simplifies the configuration process." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "35312475-67f7-4108-a328-7235b032cc8c", | ||
"metadata": {}, | ||
"source": [ | ||
"## Real-Life Example" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "e5dbbc1a-59d1-4028-9575-d21f2e2e12ef", | ||
"metadata": {}, | ||
"source": [ | ||
"Consider a scenario where a development team is working on a project that involves multiple programming languages and technologies. The project structure looks like this:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "raw", | ||
"id": "edeab9cc-5fa2-44ac-b1fb-5570c5f5753c", | ||
"metadata": {}, | ||
"source": [ | ||
"multi_language_project/\n", | ||
"│\n", | ||
"├── backend/\n", | ||
"│ ├── python/\n", | ||
"│ │ └── src/\n", | ||
"│ └── java/\n", | ||
"│ └── src/\n", | ||
"│\n", | ||
"└── frontend/\n", | ||
" ├── react/\n", | ||
" │ └── src/\n", | ||
" └── vue/\n", | ||
" └── src/\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "5dcf2f8e-d41c-4684-b305-16c382af2216", | ||
"metadata": {}, | ||
"source": [ | ||
"The project consists of a backend with components implemented in both Python and Java, and a frontend with components using React and Vue.js. To efficiently manage and run tasks for each language or framework, the Working Directory feature proves invaluable.\n", | ||
"\n", | ||
"Let's create a Makim configuration file (makim.yaml) that showcases the flexibility of the Working Directory feature in managing tasks for different languages.\n", | ||
"\n", | ||
"```yaml\n", | ||
"version: 1.0\n", | ||
"working-directory: \"/multi_language_project\"\n", | ||
"groups:\n", | ||
" backend_python:\n", | ||
" working-directory: \"backend/python\"\n", | ||
" targets:\n", | ||
" test:\n", | ||
" run: |\n", | ||
" echo \"Running Python backend tests...\"\n", | ||
" # Add commands to run Python backend tests\n", | ||
" lint:\n", | ||
" run: |\n", | ||
" echo \"Linting Python code...\"\n", | ||
" # Add commands for linting Python code\n", | ||
"\n", | ||
" backend_java:\n", | ||
" working-directory: \"backend/java\"\n", | ||
" targets:\n", | ||
" test:\n", | ||
" working-directory: \"src\"\n", | ||
" run: |\n", | ||
" echo \"Running Java backend tests...\"\n", | ||
" # Add commands to run Java backend tests\n", | ||
" build:\n", | ||
" run: |\n", | ||
" echo \"Building Java artifacts...\"\n", | ||
" # Add commands for building Java artifacts\n", | ||
"\n", | ||
" frontend_react:\n", | ||
" working-directory: \"frontend/react\"\n", | ||
" targets:\n", | ||
" test:\n", | ||
" run: |\n", | ||
" echo \"Running React frontend tests...\"\n", | ||
" # Add commands to run React frontend tests\n", | ||
" build:\n", | ||
" run: |\n", | ||
" echo \"Building React frontend...\"\n", | ||
" # Add commands for building React frontend\n", | ||
"\n", | ||
" frontend_vue:\n", | ||
" working-directory: \"frontend/vue\"\n", | ||
" targets:\n", | ||
" test:\n", | ||
" run: |\n", | ||
" echo \"Running Vue.js frontend tests...\"\n", | ||
" # Add commands to run Vue.js frontend tests\n", | ||
" build:\n", | ||
" working-directory: \"src\"\n", | ||
" run: |\n", | ||
" echo \"Building Vue.js frontend...\"\n", | ||
" # Add commands for building Vue.js frontend\n", | ||
"\n", | ||
"```" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "726bcf5a-7cc5-4448-af62-0564e2cbe1a1", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Writing .makim.yaml\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"%%writefile .makim.yaml\n", | ||
"version: 1.0\n", | ||
"working-directory: \"/multi_language_project\"\n", | ||
"groups:\n", | ||
" backend_python:\n", | ||
" working-directory: \"backend/python\"\n", | ||
" targets:\n", | ||
" test:\n", | ||
" run: |\n", | ||
" echo \"Running Python backend tests...\"\n", | ||
" # Add commands to run Python backend tests\n", | ||
" lint:\n", | ||
" run: |\n", | ||
" echo \"Linting Python code...\"\n", | ||
" # Add commands for linting Python code\n", | ||
"\n", | ||
" backend_java:\n", | ||
" working-directory: \"backend/java\"\n", | ||
" targets:\n", | ||
" test:\n", | ||
" working-directory: \"src\"\n", | ||
" run: |\n", | ||
" echo \"Running Java backend tests...\"\n", | ||
" # Add commands to run Java backend tests\n", | ||
" build:\n", | ||
" run: |\n", | ||
" echo \"Building Java artifacts...\"\n", | ||
" # Add commands for building Java artifacts\n", | ||
"\n", | ||
" frontend_react:\n", | ||
" working-directory: \"frontend/react\"\n", | ||
" targets:\n", | ||
" test:\n", | ||
" run: |\n", | ||
" echo \"Running React frontend tests...\"\n", | ||
" # Add commands to run React frontend tests\n", | ||
" build:\n", | ||
" run: |\n", | ||
" echo \"Building React frontend...\"\n", | ||
" # Add commands for building React frontend\n", | ||
"\n", | ||
" frontend_vue:\n", | ||
" working-directory: \"frontend/vue\"\n", | ||
" targets:\n", | ||
" test:\n", | ||
" run: |\n", | ||
" echo \"Running Vue.js frontend tests...\"\n", | ||
" # Add commands to run Vue.js frontend tests\n", | ||
" build:\n", | ||
" working-directory: \"src\"\n", | ||
" run: |\n", | ||
" echo \"Building Vue.js frontend...\"\n", | ||
" # Add commands for building Vue.js frontend" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "6896833c-7464-4d8d-b419-4f2991f00dcb", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"2" | ||
] | ||
}, | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"1 + 1" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "708e264b-fcf8-4515-bef7-08410a4026c4", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.1" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |