Skip to content
Snippets Groups Projects
Commit a7c86881 authored by Daniel Nemergut's avatar Daniel Nemergut
Browse files

Undid empty artifact attempt, properly escaping characters

parent b3415d4f
No related branches found
No related tags found
3 merge requests!1571catch 2.8.2.3 up with main,!15592.8.2.2-DEVELOPMENT into main,!1557Undid empty artifact attempt, properly escaping characters
Pipeline #13385 passed
......@@ -22,7 +22,7 @@ import os
import re
import subprocess
import sys
from pathlib import Path
# Write gitlab-ci workflow rule for generated yaml
def write_global_rule(**kwargs):
......@@ -101,12 +101,9 @@ def main(argv):
deploy_env = os.environ["DEPLOY_ENV"]
go_changes = []
rule = "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /(^[0-9](\.[0-9])*)-DEVELOPMENT/"
rule = "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /(^[0-9](\\.[0-9])*)-DEVELOPMENT/"
changes_rule = ""
print(f"Generating go yaml for env {deploy_env} ")
Path('generated-go-build-pipeline.yml').touch()
if deploy_env == "dev":
commit_sha = os.environ["CI_COMMIT_SHA"]
......@@ -126,17 +123,14 @@ def main(argv):
if "ingest" in go_changes:
go_changes.remove("ingest")
# Skip writing the rule if no configs will be written below to avoid building an invalid yaml
if go_changes:
write_global_rule(rule=rule)
write_global_rule(rule=rule)
changes_rule = """changes:
- apps/cli/executables/go/**/*"""
else:
if deploy_env == "test":
rule = "$CI_COMMIT_TAG =~ /^end-of-sprint-[0-9]+/ || $CI_COMMIT_TAG =~ /[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+/ || $CI_COMMIT_TAG =~ /[0-9]+\.[0-9]+\.[0-9]+\.[0.9]+-rc[0-9]+/"
rule = "$CI_COMMIT_TAG =~ /^end-of-sprint-[0-9]+/ || $CI_COMMIT_TAG =~ /[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+/ || $CI_COMMIT_TAG =~ /[0-9]+\\.[0-9]+\\.[0-9]+\\.[0.9]+-rc[0-9]+/"
if deploy_env == "prod":
rule = "$CI_COMMIT_TAG =~ /[0-9]+\.[0-9]+\.[0-9]+$/ || $CI_COMMIT_TAG =~ /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/"
rule = "$CI_COMMIT_TAG =~ /[0-9]+\\.[0-9]+\\.[0-9]+$/ || $CI_COMMIT_TAG =~ /[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$/"
write_global_rule(rule=rule)
go_changes = get_list_of_go_modules()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment