Skip to content

Instantly share code, notes, and snippets.

@tejasrsuthar
Last active September 28, 2020 20:17
Show Gist options
  • Save tejasrsuthar/80da3e661f7f638b34afc9a655e94e36 to your computer and use it in GitHub Desktop.
Save tejasrsuthar/80da3e661f7f638b34afc9a655e94e36 to your computer and use it in GitHub Desktop.
Gitlab to Staging Server basic configuration
image: node:latest
stages:
- build
- deploy
before_script:
- npm install mocha
install_dependencies:
stage: build
script:
- npm install
deployment:
stage: deploy
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- ssh [email protected] "cd ~/public_html/tests && git pull origin master && git status"
environment:
name: develop
url: https://tests.dharmabhaktiinfotech.com/
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment