Giter Club home page Giter Club logo

ansible-deploy's Introduction

Ansible Deployment Playbook

An ansible playbook for deploying a WordPress site from a git repository.

This is currently a proof of concept and likely isn't generic enough to work for most deployment processes. Feel free to fork it and adapt to your needs.

We're using Composer to manage the site stack along with a SatisPress instance to manage private packages. Only custom code is stored in site repository.

The repository and node modules are cached in a workspace to speed up subsequent deployments.

Getting Started

Install Ansible then run the following commands:

# Clone this repository.
git clone [email protected]:cedaro/ansible-deploy.git

# Change to the cloned repository
cd ansible-deploy

# Run the deploy playbook using the testing inventory
ansible-playbook -i testing deploy.yml

Running those commands will pull down an example website and deploy it to your local machine at /tmp/ansible-deploy.

Next Steps

  • Create your own inventory using group_vars/testing and roles/deploy/defaults/main.yml for guidance.
  • Read through the tasks in roles/deploy/tasks to see what tasks are run.

Slack Integration

The slack-command-handler.php file serves as a quick demonstration for using a Slack slash command to call an Ansible playbook. The handler should be placed in a web-accessible location.

After registering the command with Slack, a deployment can be kicked off from any channel with a command similar to the following:

/deploy production master

Resources

To Do

  • Deploy a specific commit, branch, or tag (should already be possible with --extra-vars)
  • Implement a rollback method
  • Clean up old releases
  • Official deploy helper module

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.