11import chalk from 'chalk' ;
22import CiCdGenerator from 'generator-jhipster/esm/generators/ci-cd' ;
3+ import { GITHUB , GITLAB } from '../generator-dotnetcore-constants.mjs' ;
34import {
45 PRIORITY_PREFIX ,
56 PROMPTING_PRIORITY ,
@@ -28,8 +29,9 @@ export default class extends CiCdGenerator {
2829 if ( this . ciType ) return ;
2930
3031 const ciTypeChoices = [
31- { value : 'gitlab' , name : 'Gitlab CI' , } ,
32- { value : 'github' , name : 'Github Action' , } ,
32+ { value : GITHUB , name : 'Github Action' , } ,
33+ { value : GITLAB , name : 'Gitlab CI' , } ,
34+ { value : 'noci' , name : 'No CI' , } ,
3335 ] ;
3436
3537 const answers = await this . prompt ( [
@@ -38,7 +40,7 @@ export default class extends CiCdGenerator {
3840 name : 'ciType' ,
3941 message : `What CI/CD pipeline do you want to generate ?` ,
4042 choices : ciTypeChoices ,
41- default : 'github' ,
43+ default : GITHUB ,
4244 } ,
4345 ] ) ;
4446 this . ciType = this . blueprintConfig . ciType = answers . ciType ;
@@ -63,7 +65,12 @@ export default class extends CiCdGenerator {
6365 async writingCiFiles ( ) {
6466 await this . writeFiles ( {
6567 sections : {
66- files : [ { templates : [ 'template-file-app' ] } ] ,
68+ files : [
69+ {
70+ condition : ctx => ctx . ciType === GITHUB ,
71+ templates : [ '.github/workflows/dotnet.yml' ]
72+ } ,
73+ ] ,
6774 } ,
6875 context : this ,
6976 } ) ;
0 commit comments