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

[ENHANCEMENT] Updated Windows hugoserver.ps1 script #7318

Open
DefSol opened this issue May 29, 2019 · 5 comments

Comments

@DefSol
Copy link
Contributor

commented May 29, 2019

Having any sort of fast feedback using a Hugo container (with or without the provided hugoserver.ps1 script) seems to be a hopeless situation. I understand windows contributors are by far the minority, but I'm hoping this solution will go some way in providing a better development experience for windows contributors.

There are a number of non trivial constraints that make the development experience sunig Linux containers on windows sub optimal. These include Inotify issues in Docker between Windows and Linux - see docker/for-win#56

Although there are known utilities to aid with such constraints (https://github.com/merofeev/docker-windows-volume-watcher) there are still issues as noted here merofeev/docker-windows-volume-watcher#4

I have re-written the hugoserver.ps1 script which will

  • determine the contributors data file
  • start the hugo container (with the current image used for linux)
  • exec a command to append to the data file in order to trigger the Hugo watch
  • on exit of the loop, the function will then stop the hugo container

The hugoserver.ps1 needs to be dot sourced . .\hugoserver.ps1 which will then expose the function Invoke-HugoWatch. the function takes 2 parameters - year and city which it uses to build a path to `data\events[year]-[city].yml

The function has side effects, namely the appending of #Watch Triggered to the data file

The function source can be found here https://github.com/DevOpsEventsNZ/devopsdays-web/blob/rdunn/WindowsHugoContainerUpdate/hugoserver.ps1

If this is helpful, happy to submit a PR

@kmugrage

This comment has been minimized.

Copy link
Contributor

commented May 31, 2019

I can test this on my Windows box but probably not until early next week.

@DefSol

This comment has been minimized.

Copy link
Contributor Author

commented May 31, 2019

Hey @kmugrage all good, appreciate any feedback.

@DefSol

This comment has been minimized.

Copy link
Contributor Author

commented Jun 1, 2019

hey @kmugrage I found some cases where this fell short my my expectations, so hold off for now and I'll make some improvements

@bridgetkromhout

This comment has been minimized.

Copy link
Collaborator

commented Jun 1, 2019

Thanks for working on this, @DefSol! I appreciate you contributing something I don't have enough context to do myself! :)

@DefSol

This comment has been minimized.

Copy link
Contributor Author

commented Jun 2, 2019

Kia ora @bridgetkromhout it's my pleasure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.