diff --git a/jenkins/jcasc.yaml b/jenkins/jcasc.yaml index a41f0e5..7b1679f 100644 --- a/jenkins/jcasc.yaml +++ b/jenkins/jcasc.yaml @@ -2,6 +2,7 @@ jobs: - file: ./webapp_seed.groovy - file: ./webapp_db_seed.groovy - file: ./webapp_helm_chart_seed.groovy + - file: ./infra_helm_chart_seed.groovy # https://github.com/jenkinsci/configuration-as-code-plugin/issues/701 tool: #This tool can't be installed against alpine OS diff --git a/scripts/infra_helm_chart_seed.groovy b/scripts/infra_helm_chart_seed.groovy new file mode 100644 index 0000000..4ae53ed --- /dev/null +++ b/scripts/infra_helm_chart_seed.groovy @@ -0,0 +1,17 @@ +multibranchPipelineJob('infra-helm-chart') { + branchSources { + github { + id('csye7125-infra-helm-chart') + scanCredentialsId('jenkins-sydrawat') + repoOwner('csye7125-fall2023-group05') + repository('infra-helm-chart') + } + } + + orphanedItemStrategy { + discardOldItems { + numToKeep(-1) + daysToKeep(-1) + } + } +} diff --git a/scripts/install.sh b/scripts/install.sh index 26b7cca..ac8fd5d 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -150,11 +150,11 @@ sudo chown jenkins:jenkins ./* # Move Jenkins files to Jenkins home cd /home/ubuntu/ || exit -sudo mv jcasc.yaml webapp_seed.groovy webapp_db_seed.groovy webapp_helm_chart_seed.groovy /var/lib/jenkins/ +sudo mv jcasc.yaml webapp_seed.groovy webapp_db_seed.groovy webapp_helm_chart_seed.groovy infra_helm_chart_seed.groovy /var/lib/jenkins/ # Update file ownership cd /var/lib/jenkins/ || exit -sudo chown jenkins:jenkins jcasc.yaml webapp_seed.groovy webapp_db_seed.groovy webapp_helm_chart_seed.groovy +sudo chown jenkins:jenkins jcasc.yaml webapp_seed.groovy webapp_db_seed.groovy webapp_helm_chart_seed.groovy infra_helm_chart_seed.groovy # Configure JAVA_OPTS to disable setup wizard sudo mkdir -p /etc/systemd/system/jenkins.service.d/ diff --git a/ubuntu.ami.pkr.hcl b/ubuntu.ami.pkr.hcl index d382e22..231590e 100644 --- a/ubuntu.ami.pkr.hcl +++ b/ubuntu.ami.pkr.hcl @@ -144,7 +144,10 @@ build { source = "./scripts/webapp_db_seed.groovy" destination = "/home/ubuntu/webapp_db_seed.groovy" } - + provisioner "file" { + source = "./scripts/infra_helm_chart_seed.groovy" + destination = "/home/ubuntu/infra_helm_chart_seed.groovy" + } provisioner "file" { source = "./scripts/webapp_helm_chart_seed.groovy" destination = "/home/ubuntu/webapp_helm_chart_seed.groovy"