Application and CLI
Paasify CLI: paasify.cli
paasify.cli
Paasify CLI interface
This API provides a similar experience as the CLI, but in Python.
Example:
CatchErrors
Bases: typer.core.TyperGroup
Class to catch program exceptions and make a nice shutdown
Source code in paasify/cli.py
__call__(*args, **kwargs)
Used to catch program exceptions
DocSubCmd
SrcSubCmd
app()
Return a Paasify App instance
Source code in paasify/cli.py
clean_terminate(err)
Terminate nicely the program depending the exception
Source code in paasify/cli.py
cli_apply(ctx, logs=typer.Option(False, '--logs', '-l', help='Show running logs after action'), stack=typer.Argument(None, help='Stack to target, current directory or all'))
Build and apply stack
Source code in paasify/cli.py
cli_assemble(ctx, explain=typer.Option(False, '--explain', '-X', help='Show diff between modifications'), stack=typer.Argument(None, help='Stack to target, current directory or all'))
Build docker-files
Source code in paasify/cli.py
cli_doc_collection(ctx, out=typer.Option(None, '-o', '--out', help='Out directory, where all files are generated'), mkdocs_config=typer.Option(None, '-m', '--mkdocs_config', help='Directory where to create mkdocs config, omited if empty'), path=typer.Argument('.', help='Directory of the project to create'))
Build collection documentation
Source code in paasify/cli.py
cli_doc_conf(ctx, out=typer.Option(None, '-o', '--out', help='Out directory, where all files are generated'), format_=typer.Option(OutputFormat.json, '-t', '--format', help='Output format for stdout'))
Build configuration schema documentation
Source code in paasify/cli.py
cli_document(ctx, cmd)
Command sources
Source code in paasify/cli.py
cli_down(ctx, stack=typer.Argument(None, help='Stack to target, current directory or all'))
Stop docker stack
Source code in paasify/cli.py
cli_help(ctx)
cli_info(ctx)
cli_logs(ctx, follow=typer.Option(False, '--follow', '-f'), stack=typer.Argument(None, help='Stack to target, current directory or all'))
Show stack logs
Source code in paasify/cli.py
cli_ls(ctx, explain=typer.Option(False, '--explain', '-X', help='Show stacks structure'), stack=typer.Argument(None, help='Stack to target, current directory or all, only when explain is enabled'))
List all stacks
Source code in paasify/cli.py
cli_new(ctx, source=typer.Option(None, '--from', help='Use another project as source'), path=typer.Argument('.', help='Directory of the project to create'))
Create a new paasify project
Source code in paasify/cli.py
cli_ps(ctx, stack=typer.Argument(None, help='Stack to target, current directory or all'))
Show docker stack instances
Source code in paasify/cli.py
cli_recreate(ctx, logs=typer.Option(False, '--logs', '-l', help='Show running logs after action'), stack=typer.Argument(None, help='Stack to target, current directory or all'))
Stop, rebuild and create stack
Source code in paasify/cli.py
cli_src(ctx, cmd)
Command sources
Source code in paasify/cli.py
cli_up(ctx, logs=typer.Option(False, '--logs', '-l', help='Show running logs after action'), stack=typer.Argument(None, help='Stack to target, current directory or all'))
Start docker stack
Source code in paasify/cli.py
cli_vars(ctx, vars=typer.Option(None, help='List of vars comma separated to show only'), explain=typer.Option(False, '--explain', '-X', help='Show running logs after action'), stack=typer.Argument(None, help='Stack to target, current directory or all'))
Dump stack variables
Source code in paasify/cli.py
main(ctx, verbose=typer.Option(0, '--verbose', '-v', count=True, min=0, max=5, help='Increase verbosity'), working_dir=typer.Option(None, '-c', '--config', help='Path of paasify.yml configuration file.', envvar='PAASIFY_PROJECT_DIR'), version=typer.Option(False, '-V', '--version', help='Show version info'), trace=typer.Option(False, '--trace', help='Show traces'))
Prepare Paasify App instance.
Source code in paasify/cli.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
|
src_install(ctx)
src_ls(ctx, explain=typer.Option(False, '--explain', '-X', help='Show collection and apps'))
List sources
Source code in paasify/cli.py
src_tree(ctx)
src_update(ctx)
test_logging()
Function to test logging
Source code in paasify/cli.py
Paasify App: paasify.app
paasify.app
Paasify Application library
This library provides a convenient paasify user friendly API.
Example:
from paasify.app import PaasifyApp
app = PaasifyApp()
print (app.info())
prj = app.load_project()
prj.dump()
PaasifyApp
Bases: NodeMap
, PaasifyObj
Paasify Main application Instance
Source code in paasify/app.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
|
cmd_config_schema(format=None, dest_dir=None)
Returns the configuration json schema
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dest_dir |
str
|
Destination directory |
None
|
Source code in paasify/app.py
cmd_document(path=None, dest_dir=None, mkdocs_config=None)
Generate documentation
Source code in paasify/app.py
info(autoload=None)
Report app config
Source code in paasify/app.py
load_project(path=None)
Return closest project
Source code in paasify/app.py
new_project(path, source=None)
Create a new project
Source code in paasify/app.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
|