A Democratic Social Network. Currently available at https://democraticnet.de The Test Server is available at https://test.democraticnet.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
DemNet/.gitlab-ci.yml

50 lines
1.3 KiB

stages:
- build
- test
- deploy
deploy_to_test_server:
stage: build
image: debian:buster
before_script:
- '(which ssh-agent && which git) || (apt-get update -y && apt-get install openssh-client git -y)'
- eval `ssh-agent -s`
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY_TESTING" | ssh-add -
- echo "$SSH_KNOWN_HOSTS_TEST" > ~/.ssh/known_hosts
script:
- ssh root@$TESTING_HOST /root/DemNet/update-server $CI_COMMIT_REF_NAME
testing:
stage: test
image: python:3.7
before_script:
- pip install pytest requests certifi pycryptodome
- export PYTHONPATH="$PYTHONPATH:."
script:
- pytest
variables:
TEST_SERVER_URL: https://test.democraticnet.de
DUMMY_PASSWORD: root
TEST_MR_ID: $TEST_MR_ID
TEST_MESSAGE: $TEST_MESSAGE
GITLAB: https://gitlab.com
DEMNET_ID: 17662440
GITLAB_REPO: https://gitlab.com/csdummi/demnet
REPO_ID: 17662440
production:
stage: deploy
image: debian:buster
before_script:
- '(which ssh-agent && which git) || (apt-get update -y && apt-get install openssh-client git -y)'
- eval `ssh-agent -s`
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_PRIVATE_KEY_DEPLOYMENT" | ssh-add -
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
script:
- ssh root@$DEPLOYMENT_HOST /root/DemNet/update-server master
only:
- master