recentpopularlog in

kme : deployment   113

« earlier  
Simple automated GIT Deployment using Hooks
I'm sure I've got a gist with something like this somewhere else (FIXME).

<code class="language-bash">#!/bin/bash

while read oldrev newrev ref
# only checking out the master (or whatever branch you would like to deploy)
if [ "$ref" = "refs/heads/$BRANCH" ];
echo "Ref $ref received. Deploying ${BRANCH} branch to production..."
git --work-tree=$TARGET --git-dir=$GIT_DIR checkout -f $BRANCH
echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server."
git  githooks  deployment  webdevel  devops  automation  reference 
6 days ago by kme
The Vanilla DevOps Git Credentials & Private Packages Cheatsheet
The one I was looking for was this:
.gitconfig [credential]

Sets a default username for a given repository url.

(can't store passwords, not very useful)


<code class="language-ini">[credential ""]
username = token</code>
git  auth  credentials  passwordmanager  solution  dammitbrain  packagemanagement  deployment  reference 
8 days ago by kme
Automatic App Deployment with "git push" - Benjamin Gleitzman's Blog
When deploying pet projects on remote servers, I dislike the extra step of logging into the remote machine to execute a git pull (and perhaps a server reload) every time I push new code. Sure there’s Jenkins and all sorts of bazooka-like solutions, but this is a knife fight. Poking around an old PHP repo, I found a nifty line of code that will update your app via a URL endpoint.
<code class="language-bash"><?php `git pull`;</code>
Drop that into secret-update-url.php and now all you have to do is visit to get the latest version of your code on the site. Going a step further, you can set up a webhook to have Github hit the URL for you.
webdevel  git  php  deployment  automation  python  flask 
9 weeks ago by kme
peritus/bumpversion: Version-bump your software with a single command
Pretty handily replaces what I used to use a complicated custom Makefile for, except that it *only* does version numbers, not "last updated" dates or anything like that.

Handy note:
Options on the command line take precedence over those from the config file, which take precedence over those derived from the environment and then from the defaults.
python  versionnumber  distribution  deployment  automation  alternativeto  makefile 
august 2019 by kme
python - pip install from git repo branch - Stack Overflow |

Prepend the url prefix git+ (See VCS Support):
<code class="language-bash">pip install git+</code>

And specify the branch name without the leading /.
python  pip  packagemanagement  sysadmin  deployment  git  solution 
march 2018 by kme
mod_wsgi (Apache) — Flask Documentation (0.12) []
Working with Virtual Environments
Virtual environments have the advantage that they never install the required dependencies system wide so you have a better control over what is used where. If you want to use a virtual environment with mod_wsgi you have to modify your .wsgi file slightly.

Add the following lines to the top of your .wsgi file:

activate_this = '/path/to/env/bin/'
execfile(activate_this, dict(__file__=activate_this))
For Python 3 add the following lines to the top of your .wsgi file:

activate_this = '/path/to/env/bin/'
with open(activate_this) as file_:
exec(, dict(__file__=activate_this))
flask  python  webdevel  webmaster  deployment  apache  mod_wsgi  config  solution 
august 2017 by kme
Learning Ansible with Vagrant (Part 2/4)
So lets run, ssh-keyscan lb, for our load balancer machine, web1, and web2, then we will pipe the output into our Vagrant users .ssh/known_hosts file.

vagrant@mgmt:~$ ssh-keyscan lb web1 web2 >> .ssh/known_hosts
# web2 SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
# lb SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
# lb SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
# web1 SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
# web1 SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
# web2 SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
ansible  screencast  sysadmin  deployment  ssh  hostkeyverification  solution 
may 2016 by kme
Cannot setup via SSH (AuthenticationFailed error) · Issue #45 · mislav/git-deploy · GitHub
For now, just setup key authentication. You'll do crazy if you have to re-enter the password on every deploy.
ssh  deployment  solution  githooks 
september 2015 by kme
Git post-receive hook to checkout each branch to different folders? - Stack Overflow
Another (different) method for deploying is to have a "real" git tree in the deployment location. Then, instead of git --work-tree=... checkout you do something like this instead:

local path=$1 branch=$2

(cd $path && unset GIT_DIR && git fetch && git checkout -f origin/$branch)
git  post-receive  hook  deployment  maybesolution 
june 2015 by kme
Git post-receive hook doesn't remove deleted files from master - Stack Overflow
Note: The script you show will go awry if there is a tag named master or develop as the reference names for those two are refs/tags/master and refs/tags/develop respectively. I'd recommend fixing this (if you care :-) ) via shell function and case statements to cut down on process spawning in the non-deploy cases, e.g.:
git  post-receive  hook  deployment  configfile  maybesolution 
june 2015 by kme
Cannot override default ssh port forwarding · Issue #3232 · mitchellh/vagrant · GitHub
Just do this and it will use 9980 instead of default 2222: :forwarded_port, guest: 22, host: 9980, id: "ssh"
vagrant  configfile  ssh  portforwarding  devops  deployment  solution 
may 2015 by kme
Modifying apache to prevent public accessibility of .git folder - Stack Overflow
# deny access to the top-level git repository:
RewriteEngine On
RewriteRule \.git - [F,L]

Better solution at (using DirectoryMatch in top-level config)
git  webmaster  webdevel  deployment  htaccess  apache  security  solution 
october 2014 by kme
How to define custom configuration variables in rails - Stack Overflow
Rails.configuration.custom_config_variable = :my_config_setting

Also (probably):

Dude, simple: Path: config/environments/production.rb Config: config.whatever = false Access it anywhere: Rails.configuration.whatever
rails  configfile  deployment  maybesolution 
july 2014 by kme
Passing environment variables to Ruby from Phusion Passenger – Phusion Corporate BlogPhusion Corporate Blog
You can set these environment variables by writing a wrapper script. Recall that Phusion Passenger has a “PassengerRuby” configuration option which typically looks like this:

PassengerRuby /usr/bin/ruby

You can point this to a wrapper script:

PassengerRuby /usr/local/my_ruby_wrapper_script
rails  environment  deployment  passenger  environmentvariables  solution 
july 2014 by kme
git - build into gh-pages branch from master branch - Stack Overflow
Confusing to me now, but there might be some gems here for later.
github  git-fu  hosting  deployment  githubpages 
july 2014 by kme
« earlier      
per page:    204080120160

Copy this bookmark:

to read