ZSI / Automatizácia

Automatizácia

Základy softvérového inžinierstva

Sergej Chodarev (sergejx.net)

We are programmers

Our job is to automate

Don't Use Manual Procedures

A computer will execute the same instructions, in the same order, time after time.

The Pragmatic Programmer

Shell scripts

Shell Programming

Example

#!/bin/sh
if [ ! -e pyvenv ]; then
    python3 -m venv pyvenv
fi
pyvenv/bin/pip install --upgrade --requirement=requirements.txt
pyvenv/bin/it4kt-builder serve --open-browser "$@"

Shebang #!

  1. Put at first line:

    #!/bin/sh
    
  2. Make it executable:

    chmod +x my-script.sh
    

Different Languages

#!/bin/bash
#!/usr/bin/env python3
#!/usr/bin/env ruby

Use the Power of Command Shells

Use the shell when graphical user interfaces don’t cut it.

The Pragmatic Programmer

Tools

Just make it!

make

Makefile

targets: prerequisites
	recipe
	recipe…

Running

make target

Compilers and Interpreters

Linters

Development Process

Dependencies

Package Management

Dependencies

Dependencies

Option: Virtualization

Containers

Containers

Containers — standardized units for development, shipment and deployment

Docker

It works on my machine - Then we'll ship your machine - And that is how Docker was born