---
kind: pipeline
type: docker
name: default

steps:
  - name: build
    image: golang
    commands:
      - make build
  - name: docker
    image: plugins/docker
    settings:
      repo: kekskurse/kuvia
      username: kekskurse
      password:
        from_secret: docker_password
  - name: ssh commands
    image: appleboy/drone-ssh
    settings:
      host: green.keks.cloud
      username: kekskurse
      port: 65223
      key:
        from_secret: ssh_key
    script:
    - cd ~/kuvia-beta;sudo docker-compowe down kuvia
    - sudo docker pull kekskurse/kuvia
    - cd ~/kuvia-beta;sudo docker-compowe up -d kuvia