Skip to content

Commit

Permalink
fix: groovy script file provisioner
Browse files Browse the repository at this point in the history
  • Loading branch information
karanwadhwa authored and sydrawat01 committed Oct 20, 2023
1 parent b0747f9 commit 64d36da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ sudo chown jenkins:jenkins *

# Move casc.yaml file to Jenkins home
sudo mv /home/ubuntu/casc.yaml /var/lib/jenkins/casc.yaml
sudo mv /home/ubuntu/jenkins_setup.groovy /var/lib/jenkins/jenkins_setup.groovy
# Update file ownership
sudo chown jenkins:jenkins /var/lib/jenkins/casc.yaml
sudo chown jenkins:jenkins /var/lib/jenkins/jenkins_setup.groovy

# Configure JAVA_OPTS to disable setup wizard
sudo mkdir -p /etc/systemd/system/jenkins.service.d/
Expand Down
5 changes: 5 additions & 0 deletions ubuntu.ami.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ build {
destination = "/home/ubuntu/casc.yaml"
}

provisioner "file" {
source = "./scripts/jenkins_setup.groovy"
destination = "/home/ubuntu/jenkins_setup.groovy"
}

provisioner "shell" {
environment_vars = [
"DEBIAN_FRONTEND=noninteractive",
Expand Down

0 comments on commit 64d36da

Please sign in to comment.