Skip to content

Fixed handling secrets in CI/CD build #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
name: Checks
needs: [ check-tag-version-job ]
uses: ./.github/workflows/checks.yml
secrets: inherit

cd-job:
name: Continues Delivery
Expand Down
1 change: 1 addition & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import nox
import sys

from pathlib import Path
from nox import Session
Expand Down
7 changes: 4 additions & 3 deletions test/integration/api_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,18 @@ def database(
yield db
wait_for_delete_clearance(start)
finally:
db_repr = f"{db.name} with ID {db.id}"
if db and not keep:
LOG.info(f"Deleting database {db.name}")
LOG.info(f"Deleting database {db_repr}")
response = self.delete_database(db.id, ignore_delete_failure)
if response.status_code == 200:
LOG.info(f"Successfully deleted database {db.name}.")
LOG.info(f"Successfully deleted database {db_repr}.")
else:
LOG.warning(f"Ignoring status code {response.status_code}.")
elif not db:
LOG.warning("Cannot delete db None")
else:
LOG.info(f"Keeping database {db.name} as keep = {keep}")
LOG.info(f"Keeping database {db_repr} as keep = {keep}")

def get_database(self, database_id: str) -> openapi.models.database.Database:
return get_database.sync(
Expand Down
13 changes: 10 additions & 3 deletions test/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,26 @@
timestamp_name,
)


def _env(var: str) -> str:
result = os.environ.get(var)
if not result:
raise RuntimeError(f"Environment variable {var} is empty.")


@pytest.fixture(scope="session")
def saas_host() -> str:
return os.environ["SAAS_HOST"]
return _env("SAAS_HOST")


@pytest.fixture(scope="session")
def saas_pat() -> str:
return os.environ["SAAS_PAT"]
return _env("SAAS_PAT")


@pytest.fixture(scope="session")
def saas_account_id() -> str:
return os.environ["SAAS_ACCOUNT_ID"]
return _env("SAAS_ACCOUNT_ID")


@pytest.fixture(scope="session")
Expand Down
Loading