ZupIT / ritchie-formulas

This repository contains the community formulas that can be executed through Ritchie CLI once imported. This tool is an open source product that allows you to create, store and share any kind of automations, executing them through command lines, to run operations or start workflows ⚙️ 🖥 💡
https://ritchiecli.io
Apache License 2.0
105 stars 72 forks source link

Schedule formulas execution through CRON jobs. Issue https://github.c… #367

Closed joaomsilvadev closed 3 years ago

joaomsilvadev commented 3 years ago

…om/ZupIT/ritchie-cli/issues/641

Pull Request

What I did

Schedule formulas execution through CRON jobs for Linux systems as requested in the issue https://github.com/ZupIT/ritchie-cli/issues/641

How I did it

Creating a new formula cron schedule

How to verify it

Run the command "rit cron schedule" and follow the instructions.

What kind of change does this PR make

Description for the changelog

Schedule formulas execution through CRON jobs for Linux systems.

GuillaumeFalourd commented 3 years ago

Hi @joaomsilvadev, and thank you for contributing to Ritchie with your formula! 🚀

As the formula you implemented isn't support on Windows, I suggest to remove the formula.bat file. Otherwise, users running this formula on this OS will execute the Hello World template.

What do you think?

joaomsilvadev commented 3 years ago

rmula you implemented isn't support on Windows, I suggest to remove the formula.bat file. Otherwise, users running this formula on this OS will execute the Hello World template.

What do you think?

I'll do it! Thanks for the quick response!

GuillaumeFalourd commented 3 years ago

I'll do it! Thanks for the quick response!

I forgot other files (besides the formula.bat) that need to be removed or updated as well due to incompatibility with windows. I will add some comments to your PR explaining 👍🏼

joaomsilvadev commented 3 years ago

I made more changes and added list and remove cron jobs functionality as well.

GuillaumeFalourd commented 3 years ago

It seems some files didn't pass the Pre-Commit execution @joaomsilvadev (could be related to whitespaces or similar issues). You can check what happened here: https://github.com/ZupIT/ritchie-formulas/pull/367/checks?check_run_id=2805843591

joaomsilvadev commented 3 years ago

Could someone please help me solve these problems?

GuillaumeFalourd commented 3 years ago

@joaomsilvadev : you can use the https://github.com/ZupIT/ritchie-formulas/blob/master/pre-commit.sh or https://github.com/ZupIT/ritchie-formulas/blob/master/pre-commit.bat files locally to check your files format before pushing your code. It should return the same error messages we observed when performing those checks on the PR, to help you correct them.

joaomsilvadev commented 3 years ago

Why am I having these issues below? My code is written in Python. There's nothing from Golang


 go fmt...................................................................Failed

- hook id: go-fmt
- exit code: 127

/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found

go imports...............................................................Failed
- hook id: go-imports
- exit code: 127

/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
GuillaumeFalourd commented 3 years ago

Why am I having these issues below? My code is written in Python. There's nothing from Golang


 go fmt...................................................................Failed

- hook id: go-fmt
- exit code: 127

/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-fmt.sh: line 8: gofmt: command not found

go imports...............................................................Failed
- hook id: go-imports
- exit code: 127

/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found
/root/.cache/pre-commit/repoxnr37caq/run-go-imports.sh: line 8: goimports: command not found

We'll investigate and give you a return ASAP 👍🏼 Have a nice week-end until then 😉

fabianofernandeszup commented 3 years ago

@joaomsilvadev We've updated the .pre-commit-config.yaml file on the master branch with the fix for this issue. Update your branch with master and your PR should pass. Thanks for the contribution.

joaomsilvadev commented 3 years ago

Hi Could you approve my PR please?

GuillaumeFalourd commented 3 years ago

Sorry for the delay @joaomsilvadev , I missed your last message after @fabianofernandeszup's return. All good to go! 👍🏼