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/sh | |
set -e | |
# GIT_DIR is usually set to `.` and we need to change into the work tree. | |
cd "$GIT_DIR/.." || exit 1 | |
unset GIT_DIR | |
# The just uploaded commit to deploy: | |
NEWREF="$(cat /dev/stdin | cut -d ' ' -f 2)" |
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/sh | |
set -e | |
APP_PATH="$HOME/apps/openfoodnetwork" | |
CURRENT_PATH="/home/openfoodnetwork/apps/openfoodnetwork/current" | |
SHARED_PATH="/home/openfoodnetwork/apps/openfoodnetwork/shared" | |
CONFIG_PATH="/home/openfoodnetwork/apps/openfoodnetwork/shared/config" | |
BUNDLE="$HOME/.rbenv/shims/bundle" | |
GEM_PATH="/home/openfoodnetwork/.gem" |
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
cd /var/discourse/ | |
./launcher enter app | |
# vi config/discourse_defaults.conf | |
## sidekiq_workers = 1 | |
# sv reload unicorn | |
# ps fax | grep sidek | |
# kill -STOP 10641 | |
# for i in `seq 5`; do kill -CONT 10641; sleep 5; kill -STOP 10641; sleep 5; done | |
# kill -CONT 10641 |
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/sh | |
# This executes `git push` and then calls Shopify's theme command to update the associated theme. | |
# You can easily replace the theme command with another deploy command you like to be executed. | |
if ! test -e config.yml; then | |
echo "Error: not in theme directory" | |
exit 1 | |
fi |
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 -ex | |
usage=" Usage: $0 <repo> <branch> | |
or: $0 user:branch | |
Example: $0 Em-AK/openfoodnetwork.git i18n-tests | |
$0 Em-AK:i18n-tests" |
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/sh | |
# | |
# Pre-conditions: | |
# - You have SFTP access. | |
# - You have sshfs installed. | |
# - You have certbot installed. | |
domain='example.org' | |
mkdir -p "/tmp/$domain" |
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/sh | |
# This script is to be placed in /etc/cron.daily/. Make it executable: | |
# | |
# chmod +x /etc/cron.daily/certbot-ssl-renewal | |
# | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
export PATH |
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/sh | |
set -xe | |
git status | grep -F '# On branch master' | |
last_tag="$(git tag | grep -E '^[0-9]{4}\.' | tail -1)" | |
next_tag="$1" | |
# Check that a tag is given |
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 | |
dir="${1-.}" | |
inotifywait -r -m -e CLOSE_WRITE "$dir" | | |
grep '\.html\.php$' --line-buffered | | |
while read path _ file; do | |
dstfile="$path${file%.php}" | |
echo "Processing $path$file $dstfile" | |
php "$path$file" > "$dstfile" |
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/sh | |
# GIT_DIR='.' | |
# | |
# on stdin: | |
# oldrev: old commit id like 0000000000000000000000000000000000000000 | |
# newrev: new commit id like d26d82b03fbe38646941b6efb89827c88efa81e5 | |
# refname: branch reference like refs/heads/master | |
# Deploy only the master branch and ignore the rest |