Created
November 19, 2012 03:53
-
-
Save sethcall/4108841 to your computer and use it in GitHub Desktop.
incron script to watch gems coming into a gem server directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# safe-network listener to place | |
# Do a put to http://internal:9000/gems/gemname.gem | |
# curl -T some.gem http://internal:9000/gems/some.gem | |
server { | |
listen 9000; | |
root /var/www/data/gems; | |
client_body_temp_path /tmp; | |
server_name localhost; | |
dav_methods PUT DELETE; | |
create_full_put_path on; | |
dav_access user:rw group:rw all:r; | |
client_max_body_size 25M; | |
} | |
# public-facing listener to expose gems. in gemfile, put | |
# source 'https://gemserver/gems' | |
server { | |
listen 443; | |
ssl on; | |
ssl_certificate /srv/ssl/nginx.pem; | |
ssl_certificate_key /srv/ssl/nginx.key; | |
server_name localhost; | |
location /gems/ { | |
auth_basic_user_file /etc/nginx/htpasswd; | |
auth_basic "Restricted"; | |
alias /var/www/data/gems/; | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "regenerating index" > /var/log/gem-builder 2>&1 | |
source /etc/profile.d/rvm.sh # assumes root installed RVM | |
gem generate_index -d /var/www/data/gems >> /var/log/gem-builder 2>&1 | |
echo "done regenerating index" >> /var/log/gem-builder 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/www/data/gems/gems IN_CLOSE_WRITE,IN_DELETE,IN_MOVED_FROM,IN_MOVED_TO /opt/jam/rebuild_gem_index |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment