Git Product home page Git Product logo

docker-capistrano's Introduction

A Docker image to run Capistrano

Go to Capistrano's GitHub or on Capistrano's website

You can find the image on Docker Hub and on GitHub

Docker Pulls

How to use it

Folder and file structure

./deploy
├── Capfile
├── config
│   ├── deploy-server1
│   │   ├── production.rb
│   │   └── staging.rb
│   ├── deploy-server2
│   │   ├── production.rb
│   │   └── staging.rb
│   └── deploy.rb
├── launch.sh

3 directories, 7 files

launch.sh

#!/bin/sh -eu

echo "Start SSH agent"
eval $(ssh-agent -s)
ssh-add $SSH_KEY
ssh-add -l

echo "Deploying ($BRANCH) ..."
bundle exec cap $ENV_NAME deploy BRANCH="$BRANCH" SSH_KEY="$SSH_KEY"

Command line

# For Capistrano logs (https://capistranorb.com/documentation/getting-started/configuration/) LOGNAME and USERNAME are needed

# Example: ./deploy/config/deploy-server1

docker run \

    # Mount some files and folders referenced in .rb configs
    -v /root/deploy/composer.lock:/deploy/composer.lock:rw \
    -v /root/deploy/envs:/deploy/envs:ro \
    -v /root/deploy/keys:/deploy/keys:ro \

    # Mount configs
    -v /root/deploy/config/deploy-server1:/deploy/config/deploy:ro \
    -v /root/deploy/config/deploy.rb:/deploy/config/deploy.rb:ro \

    # Mount your Capfile
    -v /root/deploy/Capfile:/deploy/Capfile:ro \

    # Your script to launch the deploy
    -v /root/deploy/launch.sh:/deploy/scripts/launch.sh:ro \

    # Needed ENVs
    -e LOGNAME="$USER" \
    -e USERNAME="$USER" \
    -e BRANCH=$2 \
    -e ENV_NAME=$ENV_NAME \
    -e SSH_KEY="./deploy/keys/id_rsa_deploy" \
    -it --net=host --rm botsudo/capistrano:3.17.1 sh -exu -c './deploy/scripts/launch.sh'
    # Also exists as 3.17.1-symfony for deploying symfony
    # Also exists as 3.17.1-laravel for deploying laravel

docker-capistrano's People

Contributors

williamdes avatar

Watchers

 avatar

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.