Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket YLM pipeline to deploy on Digital Ocean ERROR

se
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 23, 2020

I am following this guide to create a pipeline to deploy my Django project to Digital Ocean, Ubuntu 18 droplet.

**What I have done**

1. SSH key generated and added to my remote server and bitbucket
2. Synced yml file with project
3. bitbucket-pipelines.yml

image: python:3.7.3

pipelines:
default:
- step:
name: Build and test
caches:
- pip
script: # Modify the commands below to build your repository.
- pip install -r requirements.txt
- nosetests test/autotests --with-xunit --xunit-file=nosetests.xml --with-coverage --all-modules
- step:
name: Deploy to <myserver>
script:
- cat <script>.sh | ssh <user>@<host>
- echo "Deploy step finished"

 

**ERRORS**

I had to do the following in terminal within my virtual environment

pip install nose
pip install coverage
pip freeze > requirements.txt

than commit and push the file to bitbucket

When I run the pipeline on Bitbucket I get the following ERROR


+ nosetests test/autotests --with-xunit --xunit-file=nosetests.xml --with-coverage --all-modulesnose.plugins.cover: ERROR: Coverage not available: unable to import coverage moduleE======================================================================ERROR: Failure: OSError (No such file /opt/atlassian/pipelines/agent/build/test/autotests)----------------------------------------------------------------------Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/nose/failure.py", line 42, in runTest raise self.exc_class(self.exc_val)OSError: No such file /opt/atlassian/pipelines/agent/build/test/autotests----------------------------------------------------------------------Ran 1 test in 0.001sFAILED (errors=1)

 

**Questions**

- ```ssh <user>@<host>``` I do understand how to replace ```<user>``` & ```<host>```
- A.) How I should replace ```<script>``` at ```cat <script>.sh ```
- B.) How I should replace ```<myserver>``` at ```name: Deploy to <myserver>``` is this my server's IP address?
- C.) at the bottom section this guide has the following code I do not know what to do whit this?


#!/usr/bin/env bash
echo "Deploy script started"
cd <project git directory>
git pull
sh <restart project>.sh

 

1 answer

0 votes
Gonchik Tsymzhitov
Community Champion
January 28, 2021

Hi! 

Please, try to change everything and validate it here 

https://bitbucket-pipelines.prod.public.atl-paas.net/validator

 

Typically I do check in the bitbucket or github repo the examples and replace as is

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events