docker-compose up -d
docker-compose down
docker volume rm jenkins-data jenkins-docker-certs
Linux - run ngrok container to map localhost:8080 to ip adress
docker run -it -e NGROK_AUTHTOKEN=<token> ngrok/ngrok http localhost:8080
Windows/MacOS - run ngrok container to map host.docker.internal:8080 to ip adress
docker run -it -e NGROK_AUTHTOKEN=<token> ngrok/ngrok http host.docker.internal:8080
TO get new created ip adress go to
http://localhost:4040
docker build -t myjenkins-blueocean:2.361.3-1 ./jenkins/Dockerfile
docker network create jenkins
docker run --name jenkins-blueocean --restart=on-failure --detach \
--network jenkins --env DOCKER_HOST=tcp://docker:2376 \
--env DOCKER_CERT_PATH=/certs/client --env DOCKER_TLS_VERIFY=1 \
--publish 8080:8080 --publish 50000:50000 \
--volume jenkins-data:/var/jenkins_home \
--volume jenkins-docker-certs:/certs/client:ro \
myjenkins-blueocean:2.361.3-1
docker run --name jenkins-blueocean --restart=on-failure --detach --network jenkins --env DOCKER_HOST=tcp://docker:2376 --env DOCKER_CERT_PATH=/certs/client --env DOCKER_TLS_VERIFY=1 --volume jenkins-data:/var/jenkins_home --volume jenkins-docker-certs:/certs/client:ro --publish 8080:8080 --publish 50000:50000 myjenkins-blueocean:2.361.3-1
docker logs jenkins-blueocean
Create and active virtual enviroment using venv library:
python3 -m venv .venv
source .venv/bin/activate (Linux)
.venv\Scripts\activate (Windows)
In some Windows cases before activating venv:
Set-ExecutionPolicy Unrestricted -Scope Process
Linux/MacOS
export FLASK_APP=flaskr/run.py
Windows cmd
set FLASK_APP=flaskr/run.py
Windows powershell
$env:FLASK_APP = "flaskr/run.py"
Install app as library in development mode using setuptool
python -m pip install -e .[dev]
Build package (run command each time after changes anmd before building image from Dockerfile)
python setup.py bdist_wheel
docker run --name postgres_workshops -e POSTGRES_DB=dev_database -e POSTGRES_USER=dev_user -e POSTGRES_PASSWORD=dev_user -p 5432:5432 -d postgres:14
flask run
pytest tests
Pytlint
python -m pylint flaskr/** tests/**
Black check
python -m black --check .
Black fix
python -m black .