Hi there,
I’m just wondering if someone ever set up a hook within gitlab to autocompile SASS as soon as a push has been done. If so, I would gladly appreciate any hint on how you did it or if there is better way to compile pushed SASS.
Kind Regards
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Check out the docs from GitLab on how to configure custom git hooks. This would need to be done by an administrator as you need filesystem access. If you used the DigitalOcean One-Click or GitLab’s Omnibus installer, you can find the git repository in disk at:
/var/opt/gitlab/git-data/repositories/<group>/<project>.git
Inside of that directory, you can create a new directory named custom_hooks In there, you can create and use normal git hooks. For instance if you wanted to run a script to compile SASS after a push, you could use a post-receive hook.
You’ll also need to make sure the directory is owned by the git user:
chown -R git:git /var/opt/gitlab/git-data/repositories/<group>/<project>.git/custom_hooks
For more info on writing git hooks, check out:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.