Skip to content

Commit

Permalink
add infrastructure as code tool support
Browse files Browse the repository at this point in the history
  • Loading branch information
fangjian0423 committed Nov 29, 2024
1 parent 47dcc17 commit 7dfc567
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class AzureGeneratorComponent implements OnInit {
hideAuthenticationType: true,
hideHibernateCache: true,
hideDevDatabaseType: true,
displayInfraType: true,
hideIaCTool: true,
hideDatabaseTypeOptions: ['cassandra', 'couchbase', 'neo4j', 'no'],
hideProdDatabaseTypeOptions: ['mysql', 'mariadb', 'oracle', 'mssql', 'cassandra', 'couchbase', 'neo4j', 'no'],
hideDevDatabaseTypeOptions: ['h2Disk', 'h2Memory', 'mysql', 'mariadb', 'oracle', 'mssql', 'cassandra', 'couchbase', 'neo4j', 'no'],
Expand Down
30 changes: 7 additions & 23 deletions src/main/webapp/app/home/generator/generator.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,29 +117,13 @@ <h4>Server side options</h4>
<option value="no" [hidden]="config.disableNoDatabaseOptions == true" *ngIf="!isProdDatabaseOptionHidden('no', 'no') || !config.hideDatabaseType">No database</option>
</select>
</div>
<div class="form-group" *ngIf="config.displayInfraType">
<label>Do you want to enable Bicep or Terraform for deployment?</label>
<div class="container">
<div class="row">
<div class="col-md-1">
<input type="checkbox" class="form-control" id="enableTerraform"
[(ngModel)]="model.enableTerraform" name="enableTerraform"
#enableTerraform="ngModel" checked>
</div>
<div class="col-md-5">
<label for="enableTerraform">Terraform</label>
</div>
<div class="col-md-1">
<input type="checkbox" class="form-control" id="enableBicep"
[(ngModel)]="model.enableBicep" name="enableBicep"
#enableBicep="ngModel" checked>
</div>
<div class="col-md-5">
<label for="enableBicep">Bicep</label>
</div>
</div>
</div>
</div>
<div class="form-group" *ngIf="config.hideIaCTool">
<label for="iaCTools">Do you want to use Infrastructure as Code tool(multiple choice)?</label>
<select id="iaCTools" [(ngModel)]="model.iaCTools" name="iaCTools" class="form-control"
#iaCTools="ngModel" multiple>
<option *ngFor="let option of iaCToolOptions" [value]="option.value">{{option.name}}</option>
</select>
</div>
<div class="form-group" *ngIf="!config.hideDevDatabaseType">
<label for="devDatabaseType">Which <i>development</i> database would you like to use?</label>
<select id="devDatabaseType" [(ngModel)]="model.devDatabaseType" name="devDatabaseType"
Expand Down
5 changes: 5 additions & 0 deletions src/main/webapp/app/home/generator/generator.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class GeneratorComponent implements OnInit {
submitted = false;

languageOptions: any;
iaCToolOptions: any;

selectedGitProvider: string | undefined;
selectedGitCompany: string | undefined;
Expand Down Expand Up @@ -123,6 +124,10 @@ export class GeneratorComponent implements OnInit {
ngOnInit(): void {
this.newGenerator();
this.languageOptions = GeneratorComponent.getAllSupportedLanguageOptions();
this.iaCToolOptions = [
{ name: 'Terraform', value: 'terraform'},
{ name: 'Bicep', value: 'bicep'}
];
this.gitConfig = this.gitConfigurationService.gitConfig;
if (this.gitConfig) {
this.gitlabConfigured = this.gitConfig.gitlabConfigured ?? false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ export interface GeneratorConfigurationModel {
hideTestingOptions?: boolean;
hideHibernateCache?: boolean;
disableNoDatabaseOptions?: boolean;
displayInfraType?: boolean;
hideIaCTool?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ export class JHipsterConfigurationModel {
public jhiPrefix = 'jhi';
public withAdminUi = true;
public blueprints: BlueprintModel[] = [];
public enableBicep = false;
public enableTerraform = false;
public iaCTools = ['bicep', 'terraform'];

constructor(data?: Partial<JHipsterConfigurationModel>) {
if (data) {
Expand Down

0 comments on commit 7dfc567

Please sign in to comment.