Skip to content

Doug/fix docker build process #69

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 4 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"

[project]
name = "socketsecurity"
version = "2.0.36"
version = "2.0.38"
requires-python = ">= 3.10"
license = {"file" = "LICENSE"}
dependencies = [
Expand All @@ -16,7 +16,7 @@ dependencies = [
'GitPython',
'packaging',
'python-dotenv',
'socket-sdk-python>=2.0.15'
'socket-sdk-python>=2.0.20'
]
readme = "README.md"
description = "Socket Security CLI for CI/CD"
Expand Down
28 changes: 14 additions & 14 deletions scripts/build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ fi

if [ $ENABLE_PYPI_BUILD = "pypi-build=prod" ]; then
echo "Doing production build"
if ! python -m build --wheel --sdist; then
echo "Build failed"
exit 1
fi
if ! twine upload dist/*$VERSION*; then
echo "Upload to PyPI failed"
exit 1
fi
if ! verify_package $VERSION "https://pypi.org/simple"; then
echo "Failed to verify package on PyPI"
exit 1
fi
# if ! python -m build --wheel --sdist; then
# echo "Build failed"
# exit 1
# fi
#
# if ! twine upload dist/*$VERSION*; then
# echo "Upload to PyPI failed"
# exit 1
# fi
#
# if ! verify_package $VERSION "https://pypi.org/simple"; then
# echo "Failed to verify package on PyPI"
# exit 1
# fi

docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:$VERSION . \
&& docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:latest . \
Expand Down
2 changes: 1 addition & 1 deletion socketsecurity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__author__ = 'socket.dev'
__version__ = '2.0.36'
__version__ = '2.0.38'

3 changes: 1 addition & 2 deletions socketsecurity/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import os
from dataclasses import asdict, dataclass
from typing import List, Optional
from socketdev import __version__

from socketsecurity import __version__
from socketdev import INTEGRATION_TYPES, IntegrationType


Expand Down
2 changes: 2 additions & 0 deletions socketsecurity/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,8 @@ def get_source_data(package: Package, packages: dict) -> list:
source = ("direct", manifests)
introduced_by.append(source)
else:
if not package.topLevelAncestors:
return introduced_by
for top_id in package.topLevelAncestors:
top_package = packages.get(top_id)
if top_package:
Expand Down
2 changes: 2 additions & 0 deletions socketsecurity/core/socket_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os

from socketsecurity.core.issues import AllIssues
from socketsecurity import __version__


default_exclude_dirs = {
Expand All @@ -27,6 +28,7 @@ class SocketConfig:
security_policy: Dict = None
all_issues: Optional['AllIssues'] = None
excluded_dirs: Set[str] = field(default_factory=lambda: default_exclude_dirs)
version: str = __version__

def __post_init__(self):
"""Validate configuration after initialization"""
Expand Down
1 change: 1 addition & 0 deletions socketsecurity/socketcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def cli():

def main_code():
config = CliConfig.from_args()
log.info(f"Starting Socket Security CLI version {config.version}")
log.debug(f"config: {config.to_dict()}")
output_handler = OutputHandler(config)

Expand Down
Loading