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

Add plugin for updating symlink on job completion #358

Closed
wants to merge 2 commits into from

Conversation

@expipiplus1
Copy link
Contributor

expipiplus1 commented Jul 11, 2016

I've written a small plugin which can create a symlink pointing to the latest output of a job.

It also touches a file as lots of filesystem watchers don't like watching symlinks :/

I'd appreciate some feedback :)

This can be used with a section in the config like this:

      <latestoutput>
        jobs = hoogle-instance.default.hoogle
        path = /nix/var/nix/gcroots/hydra/hoogle
        touch = /tmp/hoogle-updated
      </latestoutput>

I'm using this at the moment to run a hoogle server with the latest version of all our code on.

@domenkozar domenkozar added the feature label Jul 12, 2016

print STDERR "INFO: Creating symlink at $linkLocation with target $linkTarget\n";
if (-e $linkLocation) { unlink ($linkLocation); }
my $linkCreated = symlink($linkTarget, $linkLocation);

This comment has been minimized.

Copy link
@aszlig

aszlig Jul 12, 2016

Member

What about using nix-env -p $linkLocation --set $linkTarget here instead? This would also allow for rollbacks and would ensure that we have a gcroot.

@expipiplus1
Copy link
Contributor Author

expipiplus1 commented Aug 16, 2016

@aszlig I've made that change.

@expipiplus1
Copy link
Contributor Author

expipiplus1 commented Aug 16, 2016

The fact that only two lines in this change are actually specific to what this plugin is doing makes me wonder if there's a way to abstract over all the rest.

Some kind of 'on build completion script' as described in #281 might make sense.

@grahamc
Copy link
Member

grahamc commented Mar 18, 2019

This looks pretty cool. I wonder, though, if the runcommand plugin is satisfactory?

@expipiplus1
Copy link
Contributor Author

expipiplus1 commented Apr 11, 2019

@grahamc Perhaps, I've not looked at this for ages.

@gilligan
Copy link
Contributor

gilligan commented May 11, 2020

Since there was no further response and the runCommand indeed seems like a good candidate i’ll close this one.

@gilligan gilligan closed this May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.