first bugfixes

This commit is contained in:
Michael Jerger 2023-05-19 12:17:48 +02:00
parent 8aec1be4a5
commit 1ea4a5aa3f
8 changed files with 36 additions and 33 deletions

View file

@ -28,7 +28,7 @@ use_plugin("python.distutils")
default_task = "publish" default_task = "publish"
name = "ddadevops" name = "ddadevops"
version = "4.0.0-dev16" version = "4.0.0-dev19"
summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud"
description = __doc__ description = __doc__
authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")]

View file

@ -9,32 +9,36 @@ PROJECT_ROOT_PATH = "../.."
@init @init
def initialize(project): def initialize(project):
project.build_depends_on("ddadevops>=4.0.0-dev")
stage = "notused"
dockerhub_user = environ.get("DOCKERHUB_USER")
if not dockerhub_user:
dockerhub_user = gopass_field_from_path("meissa/web/docker.com", "login")
dockerhub_password = environ.get("DOCKERHUB_PASSWORD")
if not dockerhub_password:
dockerhub_password = gopass_password_from_path("meissa/web/docker.com")
tag = environ.get("CI_COMMIT_TAG") tag = environ.get("CI_COMMIT_TAG")
if not tag: if not tag:
tag = get_tag_from_latest_commit() tag = get_tag_from_latest_commit()
devops = Devops( input = {
stage=stage, "name": name,
project_root_path=PROJECT_ROOT_PATH, "module": MODULE,
module=MODULE, "stage": "notused",
name=name, "project_root_path": PROJECT_ROOT_PATH,
) "build_types": ["IMAGE"],
image = Image( "mixin_types": [],
dockerhub_user=dockerhub_user, "image_dockerhub_user": "dockerhub_user",
dockerhub_password=dockerhub_password, "image_dockerhub_password": "dockerhub_password",
docker_publish_tag=tag, "image_tag": tag,
devops=devops, "credentials_mappings": [
) {
"gopass_path": "meissa/web/docker.com",
"gopass_field": "login",
"name": "image_dockerhub_user"
},
{
"gopass_path": "meissa/web/docker.com",
"name": "image_dockerhub_password"
},
],
}
build = DevopsImageBuild(project, image=image) project.build_depends_on("ddadevops>=4.0.0-dev")
build = DevopsImageBuild(project, input)
build.initialize_build_dir() build.initialize_build_dir()

View file

@ -19,6 +19,5 @@ from .devops_terraform_build import DevopsTerraformBuild, create_devops_terrafor
from .devops_build import DevopsBuild, create_devops_build_config, get_devops_build from .devops_build import DevopsBuild, create_devops_build_config, get_devops_build
from .credential import gopass_password_from_path, gopass_field_from_path from .credential import gopass_password_from_path, gopass_field_from_path
from .release_mixin import ReleaseMixin from .release_mixin import ReleaseMixin
from .domain import Validateable, DnsRecord, Devops, Image, Release, Version
__version__ = "${version}" __version__ = "${version}"

View file

@ -1,5 +1,5 @@
from src.main.python.ddadevops.domain import Image, Devops, BuildType from ..domain import Image, Devops, BuildType
from src.main.python.ddadevops.infrastructure import FileApi, ResourceApi, ImageApi from ..infrastructure import FileApi, ResourceApi, ImageApi
class ImageBuildService: class ImageBuildService:

View file

@ -1,6 +1,6 @@
from typing import Optional, List from typing import Optional, List
from src.main.python.ddadevops.infrastructure import GitApi, BuildFileRepository from ..infrastructure import GitApi, BuildFileRepository
from src.main.python.ddadevops.domain import Version, Release from ..domain import Version, Release
class ReleaseService: class ReleaseService:

View file

@ -2,7 +2,7 @@ from pathlib import Path
from .common import Devops, MixinType from .common import Devops, MixinType
from .devops_factory import DevopsFactory from .devops_factory import DevopsFactory
from .version import Version from .version import Version
from src.main.python.ddadevops.infrastructure import ( from .infrastructure import (
BuildFileRepository BuildFileRepository
) )

View file

@ -5,7 +5,7 @@ from .credentials import Credentials, GopassType
from .devops_factory import DevopsFactory from .devops_factory import DevopsFactory
from .version import Version from .version import Version
from .release import ReleaseType from .release import ReleaseType
from src.main.python.ddadevops.infrastructure import ( from ..infrastructure import (
BuildFileRepository, BuildFileRepository,
CredentialsApi, CredentialsApi,
EnvironmentApi, EnvironmentApi,

View file

@ -1,7 +1,7 @@
from pybuilder.core import Project from pybuilder.core import Project
from src.main.python.ddadevops.devops_build import DevopsBuild from .devops_build import DevopsBuild
from src.main.python.ddadevops.application import ReleaseService from .application import ReleaseService
from src.main.python.ddadevops.domain import MixinType from .domain import MixinType
class ReleaseMixin(DevopsBuild): class ReleaseMixin(DevopsBuild):