Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ cp_discovery:
project: "deploy-configuration-management/discovery-project"
branch: master
token: envgen.creds.get('discovery-repository-cred').secret
self_token: envgen.creds.get('self-token-cred').secret
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"cloud_deploytool_image": "env-generator-deploytool_build_deploytool",
"effective_set_generator_image": "qubership-effective-set-generator",
"gitlab_runner_tag_name": "gitlab-org-docker",
"self_token": "",
"_copy_without_render": [
"example"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,3 @@
# Mandatory
# Authentication token for the discovery repository
# token: string

# Mandatory
# Authentication token for EnvGene to access this instance repository
# Required for EnvGene to commit changes
self_token: "${creds.get('self-token-cred').secret}"
12 changes: 1 addition & 11 deletions schemas/integration.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,9 @@
"required": [
"gitlab"
]
},
"self_token": {
"type": "string",
"title": "Self Token",
"description": "The access token granting the access to this repository for committing changes",
"examples": [
"glpat-67890fghij",
"glpat-11223klmno"
]
}
},
"required": [
"cp_discovery",
"self_token"
"cp_discovery"
]
}
11 changes: 8 additions & 3 deletions scripts/cloud_passport/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
import shutil
from pathlib import Path
import sys

from envgenehelper import logger, findAllFilesInDir, writeYamlToFile, readYaml
from envgenehelper import openYaml, unpack_archive, cleanup_dir, addHeaderToYaml, crypt, fetch_cred_value
Expand Down Expand Up @@ -126,11 +127,15 @@ def main():
integration_config = get_integration_config(Path(f"{base_dir}/configuration/integration.yml"))
cred_config = get_cred_config()

self_git_token = fetch_cred_value(integration_config.get("self_token"), cred_config)
repo = GitRepoManager(repo_path=base_dir, git_token=self_git_token)
gitlab_token = os.environ.get("GITLAB_TOKEN")
if not gitlab_token:
logger.error(f'Variable "GITLAB_TOKEN" is not set')
sys.exit(1)

repo = GitRepoManager(repo_path=base_dir, git_token=gitlab_token)
repo.prepare_repo()

downstream_gl_client = GitLabClient(token=self_git_token)
downstream_gl_client = GitLabClient(token=gitlab_token)

project_id = os.getenv("CI_PROJECT_ID")
pipeline_id = os.getenv("CI_PIPELINE_ID")
Expand Down
1 change: 0 additions & 1 deletion test_data/configuration/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ cp_discovery:
project: "value"
branch: master
token: somevalue.secret
self_token: somevalue.secret
Loading