https://github.com/kirbo/node10-rsync-python-ssh
Node 10 container with rsync, python and ssh support
https://github.com/kirbo/node10-rsync-python-ssh
docker git nodejs python rsync ssh-support
Last synced: about 2 months ago
JSON representation
Node 10 container with rsync, python and ssh support
- Host: GitHub
- URL: https://github.com/kirbo/node10-rsync-python-ssh
- Owner: Kirbo
- Created: 2019-11-12T12:16:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-12T12:55:31.000Z (over 6 years ago)
- Last Synced: 2025-03-02T01:31:03.127Z (about 1 year ago)
- Topics: docker, git, nodejs, python, rsync, ssh-support
- Language: Dockerfile
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker-node-10-rsync-python-ssh
Node 10 container with rsync, python and ssh support
## Links
- [GitLab repository](https://gitlab.com/kirbo/node10-rsync-python-ssh)
- [GitHub repository](https://github.com/kirbo/node10-rsync-python-ssh)
- [Docker repository](https://hub.docker.com/repository/docker/kirbownz/node10-rsync-python-ssh)
## Example how to use this image in GitLab CI/CD
1. Create file `.gitlab-ci.yml`, e.g.:
```yml
image: kirbownz/node10-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
```
2. 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@me.com` | - | - | All environments |
| Variable | `ssh_key` | `-----BEGIN RSA...` | - | - | All environments |