Add endpoint for reading & updating site deployment script (#562)

* feat(api): Add endpoint for updating site deployment script

- Add PUT /api/projects/{project}/servers/{server}/sites/{site}/deployment-script endpoint
- Add feature tests for successful and failed updates

* added reading deployment script as well

* generate docs

---------

Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
This commit is contained in:
Dimitar Yanakiev
2025-03-29 22:49:28 +02:00
committed by GitHub
parent 03be2d3ee2
commit 7882d2022c
33 changed files with 4072 additions and 1701 deletions

View File

@ -39,7 +39,7 @@ endpoints:
responses:
-
status: 200
content: '{"data":[{"id":null,"project_id":null,"user_id":null,"provider_id":null,"name":"Amina DuBuque","ssh_user":"vito","ip":"163.77.69.73","local_ip":"137.139.200.70","port":22,"os":"ubuntu_22","type":"regular","type_data":null,"provider":"custom","provider_data":null,"public_key":"test","status":"ready","auto_update":null,"available_updates":0,"security_updates":null,"progress":100,"progress_step":null,"updates":null,"last_update_check":null,"created_at":null,"updated_at":null},{"id":null,"project_id":null,"user_id":null,"provider_id":null,"name":"Floy Cummerata","ssh_user":"vito","ip":"62.53.140.25","local_ip":"34.59.35.195","port":22,"os":"ubuntu_22","type":"regular","type_data":null,"provider":"custom","provider_data":null,"public_key":"test","status":"ready","auto_update":null,"available_updates":0,"security_updates":null,"progress":100,"progress_step":null,"updates":null,"last_update_check":null,"created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo; Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next &raquo;","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}'
content: '{"data":[{"id":null,"project_id":null,"user_id":null,"provider_id":null,"name":"Prof. Wyatt Powlowski IV","ssh_user":"vito","ip":"33.53.217.82","local_ip":"227.155.11.76","port":22,"os":"ubuntu_22","type":"regular","type_data":null,"provider":"custom","provider_data":null,"public_key":"test","status":"ready","auto_update":null,"available_updates":0,"security_updates":null,"progress":100,"progress_step":null,"updates":null,"last_update_check":null,"created_at":null,"updated_at":null},{"id":null,"project_id":null,"user_id":null,"provider_id":null,"name":"Guiseppe D''Amore","ssh_user":"vito","ip":"41.138.98.159","local_ip":"78.178.81.109","port":22,"os":"ubuntu_22","type":"regular","type_data":null,"provider":"custom","provider_data":null,"public_key":"test","status":"ready","auto_update":null,"available_updates":0,"security_updates":null,"progress":100,"progress_step":null,"updates":null,"last_update_check":null,"created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo; Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next &raquo;","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}'
headers: []
description: ''
custom: []
@ -47,7 +47,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer E81avahec6365dbZfgD4kPV'
- 'Bearer aaEkbd3D8gZ6f5v1ePhcV46'
controller: null
method: null
route: null
@ -89,7 +89,7 @@ endpoints:
name: provider
description: 'The server provider type'
required: true
example: iste
example: vel
type: string
enumValues: []
exampleWasSpecified: false
@ -99,7 +99,7 @@ endpoints:
name: server_provider
description: 'If the provider is not custom, the ID of the server provider profile'
required: true
example: custom
example: hetzner
type: string
enumValues:
- custom
@ -114,7 +114,7 @@ endpoints:
name: region
description: 'Provider region if the provider is not custom'
required: true
example: libero
example: voluptatibus
type: string
enumValues: []
exampleWasSpecified: false
@ -124,7 +124,7 @@ endpoints:
name: plan
description: 'Provider plan if the provider is not custom'
required: true
example: ut
example: ducimus
type: string
enumValues: []
exampleWasSpecified: false
@ -134,7 +134,7 @@ endpoints:
name: ip
description: 'SSH IP address if the provider is custom'
required: true
example: molestias
example: dolores
type: string
enumValues: []
exampleWasSpecified: false
@ -144,7 +144,7 @@ endpoints:
name: port
description: 'SSH Port if the provider is custom'
required: true
example: laudantium
example: ratione
type: string
enumValues: []
exampleWasSpecified: false
@ -154,7 +154,7 @@ endpoints:
name: name
description: 'The name of the server.'
required: true
example: illum
example: in
type: string
enumValues: []
exampleWasSpecified: false
@ -164,7 +164,7 @@ endpoints:
name: os
description: 'The os of the server'
required: true
example: autem
example: cumque
type: string
enumValues: []
exampleWasSpecified: false
@ -174,7 +174,7 @@ endpoints:
name: webserver
description: 'Web server'
required: true
example: none
example: nginx
type: string
enumValues:
- none
@ -186,7 +186,7 @@ endpoints:
name: database
description: Database
required: true
example: postgresql12
example: mysql80
type: string
enumValues:
- none
@ -223,22 +223,22 @@ endpoints:
nullable: false
custom: []
cleanBodyParameters:
provider: iste
server_provider: custom
region: libero
plan: ut
ip: molestias
port: laudantium
name: illum
os: autem
webserver: none
database: postgresql12
provider: vel
server_provider: hetzner
region: voluptatibus
plan: ducimus
ip: dolores
port: ratione
name: in
os: cumque
webserver: nginx
database: mysql80
php: '7.4'
fileParameters: []
responses:
-
status: 200
content: '{"id":null,"project_id":null,"user_id":null,"provider_id":null,"name":"Archibald Nolan","ssh_user":"vito","ip":"226.168.13.177","local_ip":"143.14.43.182","port":22,"os":"ubuntu_22","type":"regular","type_data":null,"provider":"custom","provider_data":null,"public_key":"test","status":"ready","auto_update":null,"available_updates":0,"security_updates":null,"progress":100,"progress_step":null,"updates":null,"last_update_check":null,"created_at":null,"updated_at":null}'
content: '{"id":null,"project_id":null,"user_id":null,"provider_id":null,"name":"Anissa McDermott","ssh_user":"vito","ip":"212.15.34.173","local_ip":"142.201.95.242","port":22,"os":"ubuntu_22","type":"regular","type_data":null,"provider":"custom","provider_data":null,"public_key":"test","status":"ready","auto_update":null,"available_updates":0,"security_updates":null,"progress":100,"progress_step":null,"updates":null,"last_update_check":null,"created_at":null,"updated_at":null}'
headers: []
description: ''
custom: []
@ -246,7 +246,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer aad3Pvc4e65DghZVEk8f1b6'
- 'Bearer 6cgZPdbVD4fvae15khaE638'
controller: null
method: null
route: null
@ -283,7 +283,7 @@ endpoints:
name: id
description: 'The ID of the server.'
required: true
example: 8
example: 29
type: integer
enumValues: []
exampleWasSpecified: false
@ -291,7 +291,7 @@ endpoints:
custom: []
cleanUrlParameters:
project_id: 1
id: 8
id: 29
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
@ -300,7 +300,7 @@ endpoints:
responses:
-
status: 200
content: '{"id":null,"project_id":null,"user_id":null,"provider_id":null,"name":"Tevin Sipes","ssh_user":"vito","ip":"61.41.183.152","local_ip":"197.160.239.147","port":22,"os":"ubuntu_22","type":"regular","type_data":null,"provider":"custom","provider_data":null,"public_key":"test","status":"ready","auto_update":null,"available_updates":0,"security_updates":null,"progress":100,"progress_step":null,"updates":null,"last_update_check":null,"created_at":null,"updated_at":null}'
content: '{"id":null,"project_id":null,"user_id":null,"provider_id":null,"name":"Prof. Newton Wintheiser Jr.","ssh_user":"vito","ip":"243.154.251.36","local_ip":"198.224.194.65","port":22,"os":"ubuntu_22","type":"regular","type_data":null,"provider":"custom","provider_data":null,"public_key":"test","status":"ready","auto_update":null,"available_updates":0,"security_updates":null,"progress":100,"progress_step":null,"updates":null,"last_update_check":null,"created_at":null,"updated_at":null}'
headers: []
description: ''
custom: []
@ -308,7 +308,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer 5EhD3v6Z8Vdakfg46eP1cab'
- 'Bearer d5Ebc1ZeDv8aPk466aV3gfh'
controller: null
method: null
route: null
@ -345,7 +345,7 @@ endpoints:
name: server_id
description: 'The ID of the server.'
required: true
example: 8
example: 29
type: integer
enumValues: []
exampleWasSpecified: false
@ -353,7 +353,7 @@ endpoints:
custom: []
cleanUrlParameters:
project_id: 1
server_id: 8
server_id: 29
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
@ -370,7 +370,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer Pc5Da6Vhdk1vag6fE84e3Zb'
- 'Bearer Vav31kZcfg86bdE6ha5DeP4'
controller: null
method: null
route: null
@ -407,7 +407,7 @@ endpoints:
name: server_id
description: 'The ID of the server.'
required: true
example: 8
example: 29
type: integer
enumValues: []
exampleWasSpecified: false
@ -415,7 +415,7 @@ endpoints:
custom: []
cleanUrlParameters:
project_id: 1
server_id: 8
server_id: 29
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
@ -432,7 +432,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer a61v48DfkeEbcg3a6hd5PZV'
- 'Bearer 14bV3dgZhD6cvEefkPa586a'
controller: null
method: null
route: null
@ -469,7 +469,7 @@ endpoints:
name: server_id
description: 'The ID of the server.'
required: true
example: 8
example: 29
type: integer
enumValues: []
exampleWasSpecified: false
@ -477,7 +477,7 @@ endpoints:
custom: []
cleanUrlParameters:
project_id: 1
server_id: 8
server_id: 29
queryParameters: []
cleanQueryParameters: []
bodyParameters: []
@ -494,7 +494,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer haE8D6Z6gePk1vadVb53c4f'
- 'Bearer Vv6EbPh186eg3D5fadackZ4'
controller: null
method: null
route: null