Created
January 5, 2019 13:34
-
-
Save mlabouardy/67a76b6959020c1ef9de564bb6f7d505 to your computer and use it in GitHub Desktop.
Packer template to bake Nexus GCP image
This file contains hidden or 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
{ | |
"variables" : { | |
"zone" : "YOUR ZONE", | |
"project" : "YOUR PROJECT ID", | |
"source_image" : "centos-7-v20181210", | |
"ssh_username" : "packer", | |
"credentials_path" : "PATH/account.json" | |
}, | |
"builders" : [ | |
{ | |
"type": "googlecompute", | |
"account_file": "{{user `credentials_path`}}", | |
"project_id": "{{user `project`}}", | |
"source_image": "{{user `source_image`}}", | |
"ssh_username": "{{user `ssh_username`}}", | |
"zone": "{{user `zone`}}", | |
"image_name" : "nexus-v3-14-0-04" | |
} | |
], | |
"provisioners" : [ | |
{ | |
"type" : "file", | |
"source" : "./nexus.rc", | |
"destination" : "/tmp/nexus.rc" | |
}, | |
{ | |
"type" : "file", | |
"source" : "./repository.json", | |
"destination" : "/tmp/repository.json" | |
}, | |
{ | |
"type" : "shell", | |
"script" : "./setup.sh", | |
"execute_command" : "sudo -E -S sh '{{ .Path }}'" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment