-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use derived constants in kubernetes base #14767
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f962a45
use generateJavaKey
Tcharl e041eee
use constant in kubernetes
Tcharl 8560b8e
Merge branch 'main' into constantref
Tcharl b7edd92
add default kubernetes values
Tcharl 129789a
improve property persistance, update snapshots
Tcharl ee1cf6c
Merge branch 'main' into constantref
Tcharl 9cb353f
improve modularity
Tcharl f06fa93
improve modularity
Tcharl 28dc16f
lint
Tcharl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,27 +23,10 @@ const { defaultConfig } = require('../generator-defaults'); | |
const prompts = require('./prompts'); | ||
const BaseBlueprintGenerator = require('../generator-base-blueprint'); | ||
const statistics = require('../statistics'); | ||
const packagejs = require('../../package.json'); | ||
const constants = require('../generator-constants'); | ||
const { OptionNames } = require('../../jdl/jhipster/application-options'); | ||
const { MAVEN, GRADLE } = require('../../jdl/jhipster/build-tool-types'); | ||
const { GENERATOR_CICD } = require('../generator-list'); | ||
|
||
const { | ||
BASE_NAME, | ||
APPLICATION_TYPE, | ||
DATABASE_TYPE, | ||
PROD_DATABASE_TYPE, | ||
SKIP_CLIENT, | ||
SKIP_SERVER, | ||
CLIENT_PACKAGE_MANAGER, | ||
BUILD_TOOL, | ||
REACTIVE, | ||
CLIENT_FRAMEWORK, | ||
TEST_FRAMEWORKS, | ||
CACHE_PROVIDER, | ||
} = OptionNames; | ||
|
||
const REACT = constants.SUPPORTED_CLIENT_FRAMEWORKS.REACT; | ||
|
||
let useBlueprints; | ||
|
@@ -103,29 +86,25 @@ module.exports = class extends BaseBlueprintGenerator { | |
validateFromCli() { | ||
this.checkInvocationFromCLI(); | ||
}, | ||
|
||
sayHello() { | ||
this.log(chalk.white('🚀 Welcome to the JHipster CI/CD Sub-Generator 🚀')); | ||
}, | ||
|
||
getSharedConfig() { | ||
this.loadAppConfig(); | ||
this.loadClientConfig(); | ||
this.loadServerConfig(); | ||
this.loadPlatformConfig(); | ||
}, | ||
|
||
getConfig() { | ||
this.jhipsterVersion = packagejs.version; | ||
const configuration = this.config; | ||
this.baseName = configuration.get(BASE_NAME); | ||
this.dasherizedBaseName = _.kebabCase(this.baseName); | ||
this.applicationType = configuration.get(APPLICATION_TYPE); | ||
this.databaseType = configuration.get(DATABASE_TYPE); | ||
this.prodDatabaseType = configuration.get(PROD_DATABASE_TYPE); | ||
this.skipClient = configuration.get(SKIP_CLIENT); | ||
this.skipServer = configuration.get(SKIP_SERVER); | ||
this.clientPackageManager = configuration.get(CLIENT_PACKAGE_MANAGER); | ||
this.buildTool = configuration.get(BUILD_TOOL); | ||
this.reactive = configuration.get(REACTIVE); | ||
this.herokuAppName = configuration.get('herokuAppName'); | ||
if (this.herokuAppName === undefined) { | ||
this.herokuAppName = _.kebabCase(this.baseName); | ||
} | ||
this.clientFramework = configuration.get(CLIENT_FRAMEWORK); | ||
this.testFrameworks = configuration.get(TEST_FRAMEWORKS); | ||
this.cacheProvider = configuration.get(CACHE_PROVIDER); | ||
this.autoconfigureTravis = this.options.autoconfigureTravis; | ||
this.autoconfigureJenkins = this.options.autoconfigureJenkins; | ||
this.autoconfigureGitlab = this.options.autoconfigureGitlab; | ||
|
@@ -134,10 +113,12 @@ module.exports = class extends BaseBlueprintGenerator { | |
this.autoconfigureCircleCI = this.options.autoconfigureCircle; | ||
this.abort = false; | ||
}, | ||
|
||
initConstants() { | ||
this.NODE_VERSION = constants.NODE_VERSION; | ||
this.NPM_VERSION = constants.NPM_VERSION; | ||
}, | ||
|
||
getConstants() { | ||
this.DOCKER_DIR = constants.DOCKER_DIR; | ||
this.SERVER_MAIN_RES_DIR = constants.SERVER_MAIN_RES_DIR; | ||
|
@@ -194,9 +175,8 @@ module.exports = class extends BaseBlueprintGenerator { | |
return this._configuring(); | ||
} | ||
|
||
_loadPlatformConfig(config = _.defaults({}, this.jhipsterConfig, defaultConfig), dest = this) { | ||
super.loadPlatformConfig(config, dest); | ||
dest.cicdIntegrationsSnyk = config.cicdIntegrations || []; | ||
_loadCiCdConfig(config = _.defaults({}, this.jhipsterConfig, defaultConfig), dest = this) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better move to after priorities to don't mix priority and api. |
||
dest.cicdIntegrations = dest.cicdIntegrations || config.cicdIntegrations || []; | ||
dest.cicdIntegrationsSnyk = dest.cicdIntegrations.includes('snyk'); | ||
dest.cicdIntegrationsSonar = dest.cicdIntegrations.includes('sonar'); | ||
dest.cicdIntegrationsHeroku = dest.cicdIntegrations.includes('heroku'); | ||
|
@@ -216,7 +196,9 @@ module.exports = class extends BaseBlueprintGenerator { | |
this.loadServerConfig(); | ||
this.loadDerivedServerConfig(); | ||
this.loadTranslationConfig(); | ||
this._loadPlatformConfig(); | ||
this._loadCiCdConfig(); | ||
this.loadPlatformConfig(); | ||
this.loadDerivedPlatformConfig(); | ||
}, | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to after priorities, it's not a priority.
Or drop the method and put in the task.