Code Monkey home page Code Monkey logo

ansible-deploy's Introduction

ansible-deploy

Build Status

Ansible abstraction for deploy tasks.

Ansible Deploy structure

Allows to deploy project dist with various methods. Contains reference to three main roles

Role Variables

Available variables are listed below, along with example values (see deploy.yml):

deploy:
  project:
    root: '/tmp/test_deploy'
    name: 'My Project'
    scm: 'rsync'
    source: "dist"
    keep_previous_releases: 3
    copy_previous_release: True
    writable_dirs:
      - src: "var/files"
    shared_dirs:
      - "var/files"
    shared_files: []
    templated_files:
      -
        source: "config/settings.ini.j2"
        dest: "config/settings.ini"
        owner: "{{ ansible_user }}"
        group: "{{ ansible_user }}"
  finalize:
    required_sudo: False
    commands: []
    to_be_restarted_services: []
permission_model: 'chmod'


deploy.project.root: '/tmp/test_deploy'

Destination project directory.

deploy.project.name: 'My project'

Identifies project name

deploy.project.scm: 'rsync'
#or
deploy.project.scm: 'archive'

Identifies project deploy method. Could be chosen from (rsync|git|archive). Make sure your target meets software requirements. git or rsync or tar,unzip are instaled.

deploy.project.rsync_opts: 
    - '--exclude=excluded_dir'

Allows to define additional rsync options (only applicable in case when rsync is used as deploy method)

deploy.project.source: 'dist'

Identifies project distribution source. Could be relative or absolute ('/home/jkanclerz/projects/foo/dist')

deploy.project.keep_previous_releases: 3

Identifies how many previous releases are kept on your target. Role will remove all other previous releases. Keep just choosen amount.

deploy.project.copy_previous_release: True

Force to copy currently used release as copy that is updated at code update stage. Increase speed of code updating. If switched off then builded dist is fully copied as next release.

deploy.project.writable_dirs:
	- src: "var/files"

Allows define which directories should be writable for web server user.

deploy.project.shared_dirs:
	- "var/files"

Allows define which directories should be shared between releases

deploy.project.shared_files:
	- "config/settings.yml"

Allows define which files should be shared between releases

deploy.project.templated_files:
    -
        source: "config/settings.ini.j2"
        dest: "config/settings.ini"
        owner: "{{ ansible_user }}"
        group: "{{ ansible_user }}"

Allows define which files should be copied from local stored template.

deploy.finalize.required_sudo: True

Define if sudo is required to perform finalization tasks

deploy.finalize.commands:
	- 'echo "deploy finished"'

Define define commands to be executed after finished deploy

deploy.finalize.to_be_restarted_services:
	- 'nginx'
	- 'my_app_service'

Define define services that should be restarted after finished deploy

Ansible Rollback

Allows to rollback project deployed via above roles

Role Variables

Available variables are listed below, along with example values (see rollback.yml):

deploy:
  project:
    root: '/tmp/test_deploy'

License

MIT / BSD

Author Information

Created by Jakub Kanclerz and Others

ansible-deploy's People

Contributors

jkanclerz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mbugla

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.