增加Dev环境Nacos配置发布流程
This commit is contained in:
@@ -4,9 +4,9 @@ import { join, relative, sep } from 'node:path';
|
||||
|
||||
const repositoryRoot = process.cwd();
|
||||
const target = requiredNacosTarget('NACOS_ENVIRONMENT');
|
||||
const configRoot = join(repositoryRoot, 'nacos', 'namespaces', 'prod');
|
||||
const group = 'DEFAULT_GROUP';
|
||||
const configFiles = await collectYamlFiles(target.environment === 'sit' ? join(repositoryRoot, 'nacos', 'namespaces', 'sit') : configRoot);
|
||||
const configRoot = join(repositoryRoot, 'nacos', 'namespaces', target.environment);
|
||||
const configFiles = await collectYamlFiles(configRoot);
|
||||
|
||||
if (configFiles.length === 0) {
|
||||
throw new Error(`nacos/namespaces/${target.environment} 下没有可发布的 YAML 配置`);
|
||||
@@ -53,6 +53,7 @@ function normalizeNacosBaseUrl(value) {
|
||||
function requiredNacosTarget(name) {
|
||||
const value = requiredEnvironment(name);
|
||||
const destinations = {
|
||||
dev: [{ name: 'dev', environment: 'dev', prefix: 'NACOS_DEV', verificationNodeCount: 1 }],
|
||||
sit: [{ name: 'sit', environment: 'sit', prefix: 'NACOS_SIT', verificationNodeCount: 1 }],
|
||||
'prod-center1': [{ name: 'prod-center1', environment: 'prod', prefix: 'NACOS_PROD', verificationNodeCount: 2 }],
|
||||
'prod-center2': [{ name: 'prod-center2', environment: 'prod', prefix: 'NACOS_DR', verificationNodeCount: 1 }],
|
||||
|
||||
@@ -8,6 +8,7 @@ on:
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- dev
|
||||
- sit
|
||||
- prod-center1
|
||||
- prod-center2
|
||||
@@ -37,4 +38,7 @@ jobs:
|
||||
NACOS_SIT_URLS: ${{ secrets.NACOS_SIT_URLS }}
|
||||
NACOS_SIT_USERNAME: ${{ secrets.NACOS_SIT_USERNAME }}
|
||||
NACOS_SIT_PASSWORD: ${{ secrets.NACOS_SIT_PASSWORD }}
|
||||
NACOS_DEV_URLS: ${{ secrets.NACOS_DEV_URLS }}
|
||||
NACOS_DEV_USERNAME: ${{ secrets.NACOS_DEV_USERNAME }}
|
||||
NACOS_DEV_PASSWORD: ${{ secrets.NACOS_DEV_PASSWORD }}
|
||||
run: node .gitea/scripts/publish-nacos.mjs
|
||||
|
||||
Reference in New Issue
Block a user