Commit 74deb2b5 by yiling.shen

Add working GitLab CI configuration - basic deploy and test stages with SSH setup

parent c52295cf
Pipeline #3184 passed with stages
in 6 seconds
stages: # .gitlab-ci.yml
- build
stages:
- deploy
- test - test
build: deploy_to_production:
stage: build stage: deploy
image: alpine:latest
tags:
- jarvis
before_script:
- 'which ssh-agent || ( apk add --update --no-cache openssh-client )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script: script:
- echo "Building project" - echo "Starting production deployment"
- echo "Connecting to server"
- echo "Deployment completed"
only:
- master
test: simple_test:
stage: test stage: test
image: alpine:latest
tags:
- jarvis
script: script:
- echo "Running tests" - echo "Starting test"
\ No newline at end of file - echo "Test completed"
only:
- master
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment