i am trying to build pipeline for a python fastapi project i dont how how to build pipeline for that

Siddhant Pandey September 26, 2023

i tried to build pipeline for python fastapi but it is just a basic one i am running it with a script.sh file i want to build a professional looking pipeline for my project can some one help me on this.

i am also attaching my pipeline here which i have made using my knowledge.

image: python:3.10

pipelines:
branches:
master:
- step:
name: Building
script:
- python3 -m venv venv
- source venv/bin/activate # Activate the virtual environment
- pip install -r requirements.txt
- step:
name: Deploying the app
deployment: Production
script:
- pipe: atlassian/rsync-deploy:0.9.0
variables:
USER: $DEPLOY_USER
SERVER: $DEPLOY_SERVER
REMOTE_PATH: $REMOTE_PATH
LOCAL_PATH: '.'
after-script:
- ssh $DEPLOY_USER@$DEPLOY_SERVER "cd $REMOTE_PATH && chmod +x script.sh && ./script.sh"
any help would be appreciated.

  

2 answers

2 accepted

2 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 27, 2023

Hi Siddhant,

It's not clear what you mean by "professional looking pipeline".

The pipeline you posted here has two steps, one for building the app, and another one for deploying. The deployment step also has an after-script section where you connect to your server and execute the script script.sh (please keep in mind that with this definition, the command in the after-script will run even when the deployment fails).

What exactly do you want to do differently?

Kind regards,
Theodora

Siddhant Pandey October 4, 2023

i am exploring other ways to deploy my python fastapi project

1 vote
Answer accepted
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 29, 2023

Hi @Siddhant Pandey 

Also, you could follow the official guideline for Deployment Concepts
and choose your case, as the best practice, take a look into FastAPI in Containers - Docker

 

Best regard,
Oleksandr Kyrdan

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events