From 9c4fe0075fab26781b4037d3ad1edab6e7c2db05 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 08:46:22 +0200 Subject: [PATCH] prepare for publish_artifacts_test --- .gitlab-ci.yml | 30 +++++++++++++++++++++--------- build.py | 12 ++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe8b09d..99fd7b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,19 +2,31 @@ stages: - build_on_main - build_on_tag -build_on_main: - image: domaindrivenarchitecture/devops-build:latest - stage: build_on_main - script: - - echo "buld on main" -build_on_tag: - image: domaindrivenarchitecture/devops-build:latest - stage: build_on_tag +.tag_only: &tag_only rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: never - if: '$CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+$/' + +.ddadevops: &ddo + image: "domaindrivenarchitecture/4.5.5-dev2023-08-17-08-40-46" + before_script: + - export RELEASE_ARTIFACT_TOKEN=$test + + +build_on_main: + <<: *ddo + stage: build_on_main + script: + - echo "buld on main" + - pyb publish_artifacts + + +build_on_tag: + <<: *ddo + <<: *tag_only + stage: build_on_tag script: - echo "buld on tag" - + - pyb publish_artifacts diff --git a/build.py b/build.py index 44efda9..5844819 100644 --- a/build.py +++ b/build.py @@ -18,6 +18,10 @@ def initialize(project): "mixin_types": ["RELEASE"], "release_primary_build_file": "build_to_test.py", "release_secondary_build_files": ["package.json", "project.clj"], + "release_artifacts": [], + "release_artifact_server_url": "https://repo.prod.meissa.de", + "release_organisation": "meissa", + "release_repository_name": name, } project.build_depends_on("ddadevops>=4.0.0-dev") @@ -67,3 +71,11 @@ def build(project, release_type): build = get_devops_build(project) build.update_release_type(release_type) nothing(project) + + +@task +def publish_artifacts(project): + build = get_devops_build(project) + print("RELEASE_ARTIFACT_TOKEN" in os.environ) + print(os.environ.get("RELEASE_ARTIFACT_TOKEN")) + build.publish_artifacts() \ No newline at end of file