CI configuration

Travis (standalone).

Add your private ssh key run:

# Install Travis command line tool.
gem install travis

# Login to Travis Pro (private repositories) account.
travis login

# Add encrypted key.
travis encrypt-file YOUR_DEPLOY_PRIVATE_KEY --add

travis.yml:

sudo: required
language: generic

before_install:
# Generated by travis encrypt-file ~/.ssh/id_rsa --add
- openssl aes-256-cbc -K $encrypted_43124fdbf953_key -iv $encrypted_43124fdbf953_iv
  -in id_rsa_travis.enc -out ~\/.ssh/id_rsa_travis -d

install:
- curl -sS https://raw.githubusercontent.com/andock/andock/master/install-andock |

before_script:
- SSH_PRIVATE_KEY=$(cat ~/.ssh/id_rsa_travis)
- . andock ssh-add "$SSH_PRIVATE_KEY"

script:
- andock build deploy

Gitlab (docker).

To add your private ssh key see gitlab docs.

stages:
  - build
  - deploy

before_script:
  - . andock ssh-add "$SSH_PRIVATE_KEY"
  - andock version

build:
  stage: build
  image: andockio/andock:latest
  script:
    - andock build push
  environment:
    name: andock/$CI_COMMIT_REF_NAME
    url: http://$CI_ENVIRONMENT_SLUG.$CI_PROJECT_NAME.example.com
    on_stop: stop_environment
  only:
    - branches

deploy:
  stage: deploy
  image: andockio/andock:latest
  script:
    - andock deploy
  environment:
    name: andock/$CI_COMMIT_REF_NAME
    url: http://$CI_ENVIRONMENT_SLUG.$CI_PROJECT_NAME.example.com
    on_stop: stop_environment
  only:
    - branches

stop_environment:
  stage: deploy
  image: andockio/andock:latest
  variables:
    GIT_STRATEGY: none
  script:
    - andock environment rm
  when: manual
  environment:
    name: andock/$CI_COMMIT_REF_NAME
    action: stop

Bitbucket (docker).

image: andockio/andock:latest

pipelines:
  branches:
    master:
    - step:
        script:
          - andock build deploy