Git Product home page Git Product logo

node8-rsync-python-ssh's Introduction

docker-node-8-rsync-python-ssh

Node 8 container with rsync, python and ssh support

Links

Example how to use this image in GitLab CI/CD

  1. Create file .gitlab-ci.yml, e.g.:
image: kirbownz/node8-rsync-python-ssh

###### STAGES #################################################################
stages:
  - install
  - test
  - build
  - deploy

###### TEMPLATES ##############################################################
.general: &general
  variables:
    GIT_STRATEGY: fetch

variables:
  # Docker in Docker variables
  DOCKER_HOST: "tcp://docker:2375"

###### JOBS ###################################################################
install:
  <<: *general
  stage: install
  artifacts:
    paths:
      - node_modules
    expire_in: 1 day
  script:
    - rm yarn.lock
    - yarn

test:
  <<: *general
  stage: test
  dependencies:
    - install
  script:
    - yarn test

build:
  <<: *general
  stage: build
  dependencies:
    - install
  artifacts:
    paths:
      - build
    expire_in: 1 week
  script:
    - yarn build

deployment:
  <<: *general
  stage: deploy
  dependencies:
    - build
  script:
    - mkdir -p ~/.ssh
    - echo "${ssh_key}" > ~/.ssh/id_rsa
    - chmod 700 ~/.ssh
    - chmod 600 ~/.ssh/id_rsa
    - echo "${gitconfig}" > ~/.gitconfig
    - ssh-keyscan -t rsa ${demo_host} >> ~/.ssh/known_hosts
    - rsync build/ ${demo_user}@${demo_host}:${demo_path} --delete-after -r -v
  1. Add the variables above in GitLab -> Project -> Settings -> CI / CD -> Variables:
Type Key Value Protected Masked Scope
Variable demo_host example.com - - All environments
Variable demo_path ~/project/dist/ - - All environments
Variable demo_user user - - All environments
Variable gitconfig [user]
name = Firstname Lastname
email = [email protected]
- - All environments
Variable ssh_key -----BEGIN RSA... - - All environments

node8-rsync-python-ssh's People

Contributors

kirbo avatar

Watchers

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