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

deploy hook: routeros: store the env vars within the domainconf #2413

Closed
wants to merge 8 commits into from

Conversation

herbetom
Copy link

I edited the deploy hook for RouterOS so that the enviroment variables for the routeros deploy hook are now stored inside the domain configuration file, so that it is not necessary to provide them each time.
Also the option ROUTER_OS_WEB_SERVICE with the default value yes was added for the ability to disable updating the certificate for the www-ssl service, useful for example when a special certificate only for the hotspot server is needed.

This changes shouldn't cause an issue for current users of the deploy hook.

The enviroment variables are stored inside the domain configuration file, so that it is not necessary to provide them each time
also the option ROUTER_OS_WEB_SERVICE was added for the ability to disable updating the certificate for the www-ssl service, useful for example when a special certificate only for the hotspot server is needed
@cngarrison
Copy link
Contributor

@herbetom Could you please fix the failing test(s).

I had a quick review of the changes and looks fine. I'll review in detail once the tests pass.

(Yes, I know - took me a while to fix the script so it would pass all tests. Have a look as shfmt; I suspect that will be the why its failing.)

And thanks for creating the PR; it's the first one since I took over the routeros deploy hook. ;-)

@herbetom
Copy link
Author

@cngarrison Yeah, it seems to be a problem with the shfmt check. But the current script doesn't work for me. As i already reported #2344 (comment), RouterOS just returns syntax error. It seems to have something to do with the line breaks in the var DEPLOY_SCRIPT_CMD. A quick try to do it diffrent faa84a4 wasn't succesfull. Any ideas?

@cngarrison
Copy link
Contributor

Had an availability incident at $work this week, so no time to reply properly yet. My quick answer; I used an online shfmt formatter to keep tweaking the code until it was expected format. I can't find that online formatter right now. I'll try to have a look at the changes soon and maybe I'll see something familiar to fix the shell formatting.

@cngarrison
Copy link
Contributor

Sorry it's taken me so long to return to this - I didn't have spare brain cycles for it before. Unfortunately, I don't know shfmt well enough to suggest why it's failing. The code changes look fine to me.

@cngarrison
Copy link
Contributor

I did a PR with the trailing slashes and it passed the CI build/test. Once it gets merged, would you please update this PR and see if your changes to store vals inside the domain configuration file will build/test ok.

@herbetom
Copy link
Author

herbetom commented Nov 29, 2019

Congratulations on finding something that passes the sfmt test!

And yes, once your pull request #2604 has been merged and I find the time I will do it.

@herbetom
Copy link
Author

Have you already looked into RouterOS v7 (beta)? They write in the changelog:

New CLI style which is more similar to API commands (v6 commands still supported)

So hopefully it will still work. But who knows. It should probably be tested.

@cngarrison
Copy link
Contributor

I’m aware of v7 but haven't looked into it. Thanks for the changelog entry.

... (v6 commands still supported)

I read that to mean the current command style/syntax will still work. But agreed, needs to be tested.

herbetom and others added 3 commits February 26, 2020 16:09
The enviroment variables are stored inside the domain configuration file, so that it is not necessary to provide them each time
also the option ROUTER_OS_WEB_SERVICE was added for the ability to disable updating the certificate for the www-ssl service, useful for example when a special certificate only for the hotspot server is needed
@herbetom herbetom closed this Feb 26, 2020
@herbetom herbetom reopened this Feb 26, 2020
@herbetom herbetom changed the base branch from master to dev February 26, 2020 15:31
@aklowther
Copy link

@herbetom @cngarrison any chance this could get another look?

@herbetom herbetom closed this Sep 9, 2020
@herbetom
Copy link
Author

herbetom commented Sep 9, 2020

I currently don't have time to look into this. Sorry

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.

3 participants