Code Monkey home page Code Monkey logo

timotijhof.net's Introduction

Credits

See also

Deployment

One-time remote setup

Inspired by http://toroid.org/git-website-howto.

Step 1: Create Git repository, on your server:

cd ~/git/
mkdir wp-theme-ttnet.git && cd wp-theme-ttnet.git
git init --bare
# Enable symlinks (I use this in _plugins/symlink for my subdomains)
git config core.symlinks true

Step 2: Create a plain directory, on your server, to be the recipient of deployments:

cd ~/git-deploy/
mkdir wp-theme-ttnet

Step 3: Create a post-receive hook in the Git repository. This hook is a shell script that the server will execute after you push a Git commit to it. The script will make sure your deployment directory will become a checkout of the latest commit. Remember to mark the post-receive file as executable!

~/git/wp-theme-ttnet/$ cat hooks/post-receive
#!/bin/sh
export GIT_WORK_TREE=/home/deb35044/git-deploy/wp-theme-ttnet/

# Workaround bad sshd/umask default (RHEL8, Antagonist).
echo "[krinkle] setting umask to 0002..."
umask 0002

git checkout -f
~/git/wp-theme-ttnet$ chmod +x hooks/post-receive

Done! You can now push to this repository, and a static copy of it will be maintained automatically in the git-deploy directory. I use this method (instead of simply exposing the Git repository from my web server) so that .git is naturally not exposed, and so that there is no Git "working copy" to worry about, which could sometimes get dirty or stuck for some reason.

You would then symlink to ~/git-deploy/wp-theme-ttnet/ from the appropiate place under public_html/wordpress/wp-content/.

One-time local setup

git clone ssh://timotijhof.net/~/git/wp-theme-ttnet.git

or

git remote add web ssh://timotijhof.net/~/git/wp-theme-ttnet.git

Done! You can now git push to deploy any time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.