Last active
September 28, 2020 20:17
-
-
Save tejasrsuthar/80da3e661f7f638b34afc9a655e94e36 to your computer and use it in GitHub Desktop.
Gitlab to Staging Server basic configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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