Giter VIP home page Giter VIP logo

drone-deploy's Introduction

Drone Deployment Plugin

Quickstart ๐Ÿš€

kind: pipeline
name: default

steps:
  
  - name: build
    image: node:11-alpine
    pull: always
    commands:
      - npm i
      - npm run build:prod

  - name: deploy
    image: cupcakearmy/drone-deploy
    pull: always
    settings:
      host: example.org
      user: root
      key:
        from_secret: ssh_key
      # or with a password
      # password: S3cr37Sh1zzl3
      port: 69
      target: /my/web/root/project
      sources:
        # To copy all the files
        # - . 
        - ./public
        - ./docker-compose.yml
        - ./docker-compose.prod.yml
      commands:
        - docker-compose -f docker-compose.yml -f docker-compose.prod.yml down
        - docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
    when:
      event: push
      branch: master

Details ๐Ÿ“’

The plugins creates a tarball compressing all the files included inside of sources. Then the compressed tarball gets uploaded, extracted and deleted, leaving only the files specified by sources inside of the target folder. Afterwards all the commands inside of commands will get executed at the target directory.

Mapping remote environment variables ๐Ÿ—บ

Sometimes it's usefull to have a remote env with a secret. Here is how.

kind: pipeline
name: default

steps:

  # build...

  - name: deploy
    image: cupcakearmy/drone-deploy
    pull: always
    settings:
      # host, user, port, key, when, target ...

      myvar: 'Something'
      somesecret:
        from_secret: mysecret
      envs:
        - myvar
        - somesecret
      commands:
        - echo $MYENV # Outputs: Something
        - echo $SOMESECRET # Outputs: Whatever is saved in drone as `mysecret`
Note

If you don't want to specify single variables just use envs: all and all the parameters inside of settings will be available.

All the vars will be automagically be uppercased.

drone-deploy's People

Contributors

cupcakearmy 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.