image: python:3.9
pipelines:
default:
- step:
name: Install Dependencies
script:
- apt-get update && apt-get install -y python3-venv
- python3 -m venv venv
- source venv/bin/activate
- pip install --upgrade pip
- pip install -r requirements.txt
- step:
name: Deploy to DigitalOcean
deployment: production
script:
- apt-get update && apt-get install -y zip
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements.txt
- apt-get install -y rsync sshpass
- ssh-keyscan $BITBUCKET_VARIABLE_DIGITALOCEAN_SERVER_IP >> ~/.ssh/known_hosts
- rsync -az --exclude='.git/' . $BITBUCKET_VARIABLE_USERNAME@$BITBUCKET_VARIABLE_DIGITALOCEAN_SERVER_IP:$BITBUCKET_VARIABLE_REMOTE_PATH
- sshpass -p $BITBUCKET_VARIABLE_SERVER_PASSWORD ssh $BITBUCKET_VARIABLE_USERNAME@$BITBUCKET_VARIABLE_DIGITALOCEAN_SERVER_IP "cd $BITBUCKET_VARIABLE_REMOTE_PATH && source venv/bin/activate && pip install -r requirements.txt && python main.py"
definitions:
variables: // HERE
BITBUCKET_VARIABLE_DIGITALOCEAN_SERVER_IP: "<digitalocean_server_ip>"
BITBUCKET_VARIABLE_SERVER_PASSWORD: "<server_password>"
BITBUCKET_VARIABLE_USERNAME: "<username>"
BITBUCKET_VARIABLE_REMOTE_PATH: "<remote_path>"
getting error during deploying my project on digital ocean i even dont know my pipeline code is even correct can someone please help .