From 43e98fec150b1fa07812f9c9efe68ea0aec4a9b7 Mon Sep 17 00:00:00 2001 From: Marvin Winkens Date: Tue, 28 May 2024 10:15:52 +0200 Subject: [PATCH] add basic github pipeline --- .flake8 | 3 +++ .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ check_b2access.py | 5 ++++- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .flake8 create mode 100644 .github/workflows/ci.yml diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..f837320 --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +max-line-length = 120 +exclude = dist \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0fafa05 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: [push, pull_request] + +jobs: + build-and-lint: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ["3.10", "3.11"] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 + pip install -r requirements.txt + + - name: Build project + run: make + + - name: Lint with flake8 + run: flake8 . + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: build-artifact + path: '*.tar.gz' + if-no-file-found: 'error' diff --git a/check_b2access.py b/check_b2access.py index 8dd9727..cbe355e 100755 --- a/check_b2access.py +++ b/check_b2access.py @@ -164,7 +164,10 @@ def getInfoCert(param): cert_txt = subprocess.check_output(["openssl", "x509", "-subject", "-noout", "-in", param.certificate]) sub = str(cert_txt).replace("subject= ", "") dn = getLdapName(sub) - """ url = param.url+"/rest-admin/v1/resolve/x500Name/CN=Ahmed Shiraz Memon,OU=IAS-JSC,OU=Forschungszentrum Juelich GmbH,O=GridGermany,C=DE" """ + """ + url = param.url+"/rest-admin/v1/resolve/x500Name/CN=Ahmed Shiraz Memon,OU=IAS-JSC,\ + OU=Forschungszentrum Juelich GmbH,O=GridGermany,C=DE" + """ url = f"{param.url}/rest-admin/v1/resolve/x500Name/{dn}" print(f"url: {url}")