github.com/cptmikhailov/conmon@v2.0.20+incompatible/contrib/cirrus/packer/conmon_base_images.yml (about) 1 --- 2 3 variables: 4 # Complete local path to repository (Required) 5 SRC: 6 # Relative path to this (packer) subdirectory (Required) 7 PACKER_BASE: 8 # Relative path to cirrus scripts subdirectory (Required) 9 SCRIPT_BASE: 10 # Unique ID for naming new base-images (required) 11 TIMESTAMP: 12 # Required for output from qemu builders 13 TTYDEV: 14 15 # These are also required, but come in via env-vars to protect contents 16 # Path to json file (required, likely ~/.config/gcloud/legacy_credentials/*/adc.json) 17 GOOGLE_APPLICATION_CREDENTIALS: '{{env `GOOGLE_APPLICATION_CREDENTIALS`}}' 18 # The complete project ID (required, not the short name) 19 GCP_PROJECT_ID: '{{env `GCP_PROJECT_ID`}}' 20 21 # Pre-existing storage bucket w/ lifecycle-enabled 22 XFERBUCKET: "packer-import-temp" # pre-created, globally unique, lifecycle-enabled 23 # Fedora images are obtainable by direct download 24 FEDORA_IMAGE_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/29/Cloud/x86_64/images/Fedora-Cloud-Base-29-1.2.x86_64.qcow2" 25 FEDORA_CSUM_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/29/Cloud/x86_64/images/Fedora-Cloud-29-1.2-x86_64-CHECKSUM" 26 FEDORA_BASE_IMAGE_NAME: 'fedora-cloud-base-29-1-2' # Name to use in GCE 27 # The name of the image in GCE used for packer build conmon_images.yml 28 IBI_BASE_NAME: 'image-builder-image' 29 CIDATA_ISO: 'cidata.iso' # produced by Makefile 30 31 # Don't leak sensitive values in error messages / output 32 sensitive-variables: 33 - 'GOOGLE_APPLICATION_CREDENTIALS' 34 - 'GCP_PROJECT_ID' 35 36 # What images to produce in which cloud 37 builders: 38 - name: '{{user `IBI_BASE_NAME`}}' 39 type: 'googlecompute' 40 image_name: '{{user `IBI_BASE_NAME`}}-{{user `TIMESTAMP`}}' 41 image_family: '{{user `IBI_BASE_NAME`}}' 42 source_image_project_id: 'centos-cloud' 43 source_image_family: 'centos-7' 44 project_id: '{{user `GCP_PROJECT_ID`}}' 45 account_file: '{{user `GOOGLE_APPLICATION_CREDENTIALS`}}' 46 communicator: 'ssh' 47 ssh_username: 'centos' 48 ssh_pty: 'true' 49 # The only supported zone in Cirrus-CI, as of addition of this comment 50 zone: 'us-central1-f' 51 # Enable nested virtualization in case it's ever needed 52 image_licenses: 53 - 'https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx' 54 min_cpu_platform: "Intel Broadwell" # nested-virt requirement 55 56 - &nested_virt 57 name: 'fedora' 58 type: 'qemu' 59 accelerator: "kvm" 60 iso_url: '{{user `FEDORA_IMAGE_URL`}}' 61 disk_image: true 62 format: "raw" 63 disk_size: 5120 64 iso_checksum_url: '{{user `FEDORA_CSUM_URL`}}' 65 iso_checksum_type: "sha256" 66 output_directory: '/tmp/{{build_name}}' 67 vm_name: "disk.raw" # actually qcow2, name required for post-processing 68 boot_wait: '5s' 69 shutdown_command: 'shutdown -h now' 70 headless: true 71 qemu_binary: "/usr/libexec/qemu-kvm" 72 qemuargs: # List-of-list format required to override packer-generated args 73 - - "-m" 74 - "1024" 75 - - "-cpu" 76 - "host" 77 - - "-device" 78 - "virtio-rng-pci" 79 - - "-chardev" 80 - "tty,id=pts,path={{user `TTYDEV`}}" 81 - - "-device" 82 - "isa-serial,chardev=pts" 83 - - "-cdrom" 84 - "{{user `CIDATA_ISO`}}" 85 - - "-netdev" 86 - "user,id=net0,hostfwd=tcp::{{ .SSHHostPort }}-:22" 87 - - "-device" 88 - "virtio-net,netdev=net0" 89 communicator: 'ssh' 90 ssh_private_key_file: 'cidata.ssh' 91 ssh_username: 'root' 92 93 provisioners: 94 - type: 'shell' 95 inline: 96 - 'mkdir -p /tmp/conmon/{{user `SCRIPT_BASE`}}' 97 - 'mkdir -p /tmp/conmon/{{user `PACKER_BASE`}}' 98 99 - type: 'file' 100 source: '{{user `SRC`}}/.cirrus.yml' 101 destination: '/tmp/conmon/.cirrus.yml' 102 103 - type: 'file' 104 source: '{{user `SRC`}}/{{user `SCRIPT_BASE`}}/' 105 destination: '/tmp/conmon/{{user `SCRIPT_BASE`}}/' 106 107 - type: 'file' 108 source: '{{user `SRC`}}/{{user `PACKER_BASE`}}/' 109 destination: '/tmp/conmon/{{user `PACKER_BASE`}}/' 110 111 - &shell_script 112 type: 'shell' 113 inline: 114 - 'chmod +x /tmp/conmon/{{user `PACKER_BASE`}}/{{build_name}}_base-setup.sh' 115 - '/tmp/conmon/{{user `PACKER_BASE`}}/{{build_name}}_base-setup.sh pre' 116 expect_disconnect: true # Allow this to reboot the VM 117 environment_vars: 118 - 'TIMESTAMP={{user `TIMESTAMP`}}' 119 - 'SRC=/tmp/conmon' 120 - 'SCRIPT_BASE={{user `SCRIPT_BASE`}}' 121 - 'PACKER_BASE={{user `PACKER_BASE`}}' 122 123 - <<: *shell_script 124 inline: ['{{user `SRC`}}/{{user `PACKER_BASE`}}/{{build_name}}_base-setup.sh'] 125 expect_disconnect: false 126 pause_before: '10s' 127 inline: 128 - '/tmp/conmon/{{user `PACKER_BASE`}}/{{build_name}}_base-setup.sh post' 129 130 post-processors: 131 - - type: "compress" 132 only: ['fedora'] 133 output: '/tmp/{{build_name}}/disk.raw.tar.gz' 134 format: '.tar.gz' 135 compression_level: 9 136 - &gcp_import 137 only: ['fedora'] 138 type: "googlecompute-import" 139 project_id: '{{user `GCP_PROJECT_ID`}}' 140 account_file: '{{user `GOOGLE_APPLICATION_CREDENTIALS`}}' 141 bucket: '{{user `XFERBUCKET`}}' 142 gcs_object_name: '{{build_name}}-{{uuid}}.tar.gz' 143 image_name: "{{user `FEDORA_BASE_IMAGE_NAME`}}-{{user `TIMESTAMP`}}" 144 image_description: 'Based on {{user `FEDORA_IMAGE_URL`}}' 145 image_family: '{{user `FEDORA_BASE_IMAGE_NAME`}}' 146 - type: 'manifest'