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:
- build
# .gitlab-ci.yml
stages:
- deploy
- test
build:
stage: build
deploy_to_production:
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:
- echo "Building project"
- echo "Starting production deployment"
- echo "Connecting to server"
- echo "Deployment completed"
only:
- master
test:
simple_test:
stage: test
image: alpine:latest
tags:
- jarvis
script:
- echo "Running tests"
\ No newline at end of file
- echo "Starting test"
- 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