Makim features
Makim Feature Tutorials¶
This Jupyter Notebook provides in-depth tutorials for key features of Makim:
- Scheduler: Automating tasks at specified intervals.
- SSH Execution: Running tasks on remote servers securely.
Each section includes explanations, YAML configuration examples, and how to run these features.
In [52]:
Copied!
import os
import os
In [53]:
Copied!
%%writefile .makim.yaml
scheduler:
daily-clean:
task: build.clean
schedule: "0 0 * * *" # Runs every day at midnight
groups:
build:
tasks:
clean:
help: Clean build artifacts
run: echo "Cleaning build artifacts..."
%%writefile .makim.yaml
scheduler:
daily-clean:
task: build.clean
schedule: "0 0 * * *" # Runs every day at midnight
groups:
build:
tasks:
clean:
help: Clean build artifacts
run: echo "Cleaning build artifacts..."
Overwriting .makim.yaml
In [54]:
Copied!
!makim cron list
!makim cron list
Makim file: .makim.yaml ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ ┃ Name ┃ Task ┃ Schedule ┃ Status ┃ Next Run ┃ ┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ │ daily-clean │ build.clean │ 0 0 * * * │ Inactive │ Not scheduled │ └─────────────┴─────────────┴───────────┴──────────┴───────────────┘
In [55]:
Copied!
!makim cron start daily-clean
!makim cron start daily-clean
Makim file: .makim.yaml Successfully started schedule 'daily-clean'
In [56]:
Copied!
!makim cron stop daily-clean
!makim cron stop daily-clean
Makim file: .makim.yaml Successfully stopped schedule 'daily-clean'
In [57]:
Copied!
%%writefile .makim.yaml
hosts:
my_server:
user: deploy_user
host: example.com
port: '22'
groups:
deploy:
tasks:
deploy:
remote: my_server
run: echo "Deploying application..."
%%writefile .makim.yaml
hosts:
my_server:
user: deploy_user
host: example.com
port: '22'
groups:
deploy:
tasks:
deploy:
remote: my_server
run: echo "Deploying application..."
Overwriting .makim.yaml
In [58]:
Copied!
# !makim deploy.deploy
# !makim deploy.deploy
Summary¶
- Scheduler automates recurring tasks using cron syntax.
- SSH Execution enables remote task execution securely.
Start using Makim to enhance your workflow!