gitlab

GitLab CI python subprocess.Popen permission denied

GitLab CI python subprocess.Popen permission denied Question: I’m running a GitLab-CI job which runs a python script which starts a subprocess.Popen(…). def main(): proc = subprocess.Popen("./../binary_file –args value", stdout=subprocess.PIPE) The problem is that I’m getting PermissionError: [Errno 13] Permission denied: ‘./../binary_file’ Ok. Maybe I forgot to set appropriate permissions? $ chmod +x ./binary_file $ ls …

Total answers: 1

Define timeout when tox is installing requirements

Define timeout when tox is installing requirements Question: I have a gitlab ci pipeline which basically do some stuff on the enviornment ( install python and other packages) then it simply run tox in order to run some tests. stages: – check before_script: # here you can run any commands before the pipelines start – …

Total answers: 2

How to fail a gitlab CI pipeline if the python script throws error code 1?

How to fail a gitlab CI pipeline if the python script throws error code 1? Question: I have a python file that opens and checks for a word. The program returns 0 if pass and 1 if fails. import sys word = "test" def check(): with open("tex.txt", "r") as file: for line_number, line in enumerate(file, …

Total answers: 1

Persistent cache during deployment with sphinx-autoapi?

Persistent cache during deployment with sphinx-autoapi? Question: I have been stuck with a problem for several days without solutions. I am trying to deploy local docs generated with Sphinx to Gitlab pages. Below is my .gitlab-ci.yml on the root directory of the repos, and I am using the latest Ubuntu image: stage: deploy script: – …

Total answers: 1

Add a file in Gitlab project repository by Python

Add a file in Gitlab project repository by Python Question: I have a python script where I have created an output file as an excel table. Now I would like to add/upload this file to my Gitlab project repository directly by using python-gitlab library. I have found some solution where file was added local repository …

Total answers: 1

Docker : exec /usr/bin/sh: exec format error

Docker : exec /usr/bin/sh: exec format error Question: Hi guys need some help. I created a custom docker image and push it to docker hub but when I run it in CI/CD it gives me this error. exec /usr/bin/sh: exec format error Where : Dockerfile FROM ubuntu:20.04 RUN apt-get update RUN apt-get install -y software-properties-common …

Total answers: 4

Python – working with GitLab API 403 Forbidden Error

Python – working with GitLab API 403 Forbidden Error Question: I am trying to make POST request to GitLab and make file with my Python code. Url is fine I tested it in Postman and request worked fine and made file in repo. But when i tried to use Python it didn’t work. Python code: …

Total answers: 1

GitLab CI Python black formatter says: would reformat, whereas running black does not reformat

GitLab CI Python black formatter says: would reformat, whereas running black does not reformat Question: When I run GitLab CI on this commit with this gitlab-ci.yml: stages: – format – test black_formatting: image: python:3.6 stage: format before_script: # Perform an update to make sure the system is up to date. – sudo apt-get update –fix-missing …

Total answers: 2

Getting flake8 most critical errors on big python codebase

Getting flake8 most critical errors on big python codebase Question: Given a large Python 3.6 codebase deployed in GitLab with lots of "minor" violations with flake8 (e.g. stylistic violations), I would like to first find the most serious violations (e.g. variable may be undefined, name not found…). The idea is to avoid being overwhelmed with …

Total answers: 1