Last active
August 29, 2015 13:57
-
-
Save mattgrill/9920798 to your computer and use it in GitHub Desktop.
This file contains 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 | |
set -e | |
CONTAINERID=$(sudo docker run -d -p 80 drpal/$project_name:$BUILD_NUMBER) | |
CONTAINER_HOST_PORT=$(sudo docker port $CONTAINERID 80) | |
cat > $BUILD_NUMBER-$project_name/$project_name.localhost << EOL | |
upstream $project_name.localhost { | |
server $CONTAINER_HOST_PORT; | |
} | |
server { | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
server_name $project_name.localhost; | |
location / { | |
proxy_pass http://$project_name.localhost; | |
include /etc/nginx/proxy_params; | |
} | |
} | |
EOL | |
sudo cp $WORKSPACE/$BUILD_NUMBER-$project_name/$project_name.localhost /etc/nginx/sites-enabled/$project_name.localhost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment