Sign inSign up

botsudo/capistrano

Sponsored OSS

By Wdes SAS / Sudo Bot

•Updated 9 months ago

Docker image for capistrano (also supported: laravel & symfony)

Image
Integration & delivery
Developer tools
0

10K+

botsudo/capistrano repository overview

⁠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

Tag summary

Content type

Image

Digest

sha256:c590b5d1d…

Size

39.8 MB

Last updated

9 months ago

docker pull botsudo/capistrano

This week's pulls

Pulls:

256

Last week