CURRENTLY IN BETA (SOME THINGS MAY BE UNSTABLE)

Example: deploying static HTML website

  1. Create a custom stack from template
services:
    nginx:
        image: 'wodby/nginx:1.13-4.1.0'
        environment:
            NGINX_LOG_FORMAT_SHOW_REAL_IP: 1
        ports:
            - 'edge::80/tcp'
        deployment:
            type: ci
        check_ready:
            exec:
                command: [make, check-ready, '-f', /usr/local/bin/actions.mk]
            initial_delay_seconds: 5
            failure_threshold: 2
            timeout_seconds: 3
            period_seconds: 30

2. Deploy application with this stack
3. In your CI tool set the environment variables $WODBY_API_KEY with your api key and$WODBY_INSTANCE_UUID with your deployed application instance UUID.
4. Set up build

CircleCI

version: 2

jobs:
  build:
    machine: true

    steps:
      - checkout

      - restore_cache:
          keys:
            - yarn-v1-{{ checksum "yarn.lock" }}
            - yarn-v1-

      - run: wget -qO- https://api.wodby.com/api/v1/get/cli | sh
      - run: wodby ci init "${WODBY_INSTANCE_UUID}"
      - run: wodby ci run -i wodby/node:8 -- yarn install

      - save_cache:
          key: yarn-v1-{{ checksum "yarn.lock" }}
          paths:
            - node_modules

      - run: wodby ci run -i wodby/node:8 -- npm run build
      - run: wodby ci build --from ./build
      - run: wodby ci release
      - run: wodby ci deploy

TravisCI

language: bash

cache:
    directories:
     - node_modules

sudo: required

services:
  - docker

script:
  - set -e
  - wget -qO- https://api.wodby.com/api/v1/get/cli | sh
  - wodby ci init "${WODBY_INSTANCE_UUID}"
  - wodby ci run -i wodby/node:8 -- yarn install
  - wodby ci run -i wodby/node:8 -- npm run build
  - wodby ci build --from ./build  
  - wodby ci release
  - wodby ci deploy

BitBucket Pipelines

image: wodby/wodby-cli

options:
  docker: true

pipelines:
  default:
    - step:
        caches:
          - docker
          - node
        script:
          - wodby ci init "${WODBY_INSTANCE_UUID}"
          - wodby ci run -i wodby/node:8 -- yarn install
          - wodby ci run -i wodby/node:8 -- npm run build
          - wodby ci build --from ./build  
          - wodby ci release
          - wodby ci deploy

Custom environment

  1. Install wodby cli as described at https://github.com/wodby/wodby-cli
  2. Export $WODBY_API_KEY
  3. Run: 
wodby ci init "${WODBY_INSTANCE_UUID}"
wodby ci run -i wodby/node:8 -- yarn install
wodby ci run -i wodby/node:8 -- npm run build
wodby ci build --from ./build  
wodby ci release
wodby ci deploy

Or use wodby/wodby-cli container and run init with a special flag (docker in docker):

wodby ci init "${WODBY_INSTANCE_UUID}" --dind
Did this answer your question?