S19: share workstation runner and move agent workflows to landscape
This commit is contained in:
@@ -18,7 +18,7 @@ def create(destination, name, components, repository, tag, runner, landscape):
|
||||
if destination.exists():
|
||||
raise ValueError('Destination must not exist; existing project files are never overwritten')
|
||||
commit = subprocess.check_output(['git', '-C', str(HOME), 'rev-parse', tag + '^{commit}'], text=True).strip()
|
||||
replacements = {'@PROJECT@': name, '@RUNNER@': runner, '@LANDSCAPE@': landscape,
|
||||
replacements = {'@PROJECT@': name, '@RUNNER@': runner, '@RUNNER_NAME@': runner, '@LANDSCAPE@': landscape,
|
||||
'@ENGINEERING@': repository.removesuffix('.git'),
|
||||
'@MODULES@': '<module>backend</module>' if 'backend' in components else ''}
|
||||
try:
|
||||
@@ -41,6 +41,7 @@ def create(destination, name, components, repository, tag, runner, landscape):
|
||||
'FORMAT_DIRECTORIES': 'backend/src', 'COMPOSE_PROJECT': name + '-production',
|
||||
'BROWSER_TESTS': 'false', 'CI_DATABASE': 'false',
|
||||
'TARGET_PLATFORM': 'linux/amd64', 'RUNNER_LABEL': runner,
|
||||
'RUNNER_NAME': runner, 'RUNNER_SCOPE': 'user',
|
||||
'FRONTEND_TEST_COMMAND': '["npm","test"]', 'DEPENDENCY_SERVICES': '',
|
||||
'REQUIRED_DEPLOY_SECRETS': ''}
|
||||
(destination / 'engineering.properties').write_text(''.join(k + '=' + v + '\n' for k, v in settings.items()))
|
||||
@@ -78,7 +79,7 @@ def main():
|
||||
parser.add_argument('--components', choices=['backend', 'frontend', 'both'], default='both')
|
||||
parser.add_argument('--repository', default='http://192.168.2.28:3000/wanjakrah/engineering.git')
|
||||
parser.add_argument('--version', required=True)
|
||||
parser.add_argument('--runner', required=True, help='Existing Gitea host runner label')
|
||||
parser.add_argument('--runner', default='mini-pc', help='Shared Gitea host runner label (default: mini-pc)')
|
||||
parser.add_argument('--landscape', default='http://192.168.2.28:3000/wanjakrah/landscape')
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user