summaryrefslogtreecommitdiff
path: root/contrib/cirrus/packer/libpod_images.yml
blob: 5c42fdae1d1f04c3206d68ea9888ad99ac11be02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---

# All of these are required
variables:
    # Names of GCE Base images to start from, in .cirrus.yml
    RHEL_BASE_IMAGE: '{{env `RHEL_BASE_IMAGE`}}'
    CENTOS_BASE_IMAGE: '{{env `CENTOS_BASE_IMAGE`}}'
    UBUNTU_BASE_IMAGE: '{{env `UBUNTU_BASE_IMAGE`}}'
    FEDORA_BASE_IMAGE: '{{env `FEDORA_BASE_IMAGE`}}'
    PRIOR_FEDORA_BASE_IMAGE: '{{env `PRIOR_FEDORA_BASE_IMAGE`}}'
    FAH_BASE_IMAGE: '{{env `FAH_BASE_IMAGE`}}'

    # libpod dependencies to build and install into images
    FEDORA_CNI_COMMIT: "{{env `FEDORA_CNI_COMMIT`}}"
    CNI_COMMIT: "{{env `CNI_COMMIT`}}"
    CRIO_COMMIT: "{{env `CRIO_COMMIT`}}"
    CRIU_COMMIT: "{{env `CRIU_COMMIT`}}"
    RUNC_COMMIT: "{{env `RUNC_COMMIT`}}"

    BUILT_IMAGE_SUFFIX: '{{env `BUILT_IMAGE_SUFFIX`}}'
    GOSRC: '{{env `GOSRC`}}'
    PACKER_BASE: '{{env `PACKER_BASE`}}'
    SCRIPT_BASE: '{{env `SCRIPT_BASE`}}'

    # Protected credentials, decrypted by Cirrus at runtime
    GCE_SSH_USERNAME: '{{env `GCE_SSH_USERNAME`}}'
    GCP_PROJECT_ID: '{{env `GCP_PROJECT_ID`}}'
    RHSM_COMMAND: '{{env `RHSM_COMMAND`}}'
    SERVICE_ACCOUNT: '{{env `SERVICE_ACCOUNT`}}'
    GOOGLE_APPLICATION_CREDENTIALS: '{{env `GOOGLE_APPLICATION_CREDENTIALS`}}'

    # Used to separate images produced during PR testing from those
    # produced from post-merge testing.  Must be empty for PR testing.
    POST_MERGE_BUCKET_SUFFIX: ''

# Don't leak sensitive values in error messages / output
sensitive-variables:
    - 'GCE_SSH_USERNAME'
    - 'GCP_PROJECT_ID'
    - 'RHSM_COMMAND'
    - 'SERVICE_ACCOUNT'

# What images to produce in which cloud
builders:
    #  v----- is a YAML anchor, allows referencing this object by name (below)
    - &gce_hosted_image
      name: 'ubuntu-18'
      type: 'googlecompute'
      image_name: '{{build_name}}{{user `BUILT_IMAGE_SUFFIX`}}'
      image_family: '{{build_name}}-libpod'
      source_image: '{{user `UBUNTU_BASE_IMAGE`}}'
      disk_size: 20
      project_id: '{{user `GCP_PROJECT_ID`}}'
      service_account_email: '{{user `SERVICE_ACCOUNT`}}'
      communicator: 'ssh'
      ssh_username: '{{user `GCE_SSH_USERNAME`}}'
      ssh_pty: 'true'
      # The only supported zone in Cirrus-CI, as of addition of this comment
      zone: 'us-central1-a'

    #      v----- is a YAML alias, allows partial re-use of the anchor object
    - <<: *gce_hosted_image
      name: 'rhel-7'
      source_image: '{{user `RHEL_BASE_IMAGE`}}'

    - <<: *gce_hosted_image
      name: 'centos-7'
      source_image: '{{user `CENTOS_BASE_IMAGE`}}'

    - <<: *gce_hosted_image
      name: 'fedora-29'
      source_image: '{{user `FEDORA_BASE_IMAGE`}}'

    - <<: *gce_hosted_image
      name: 'fedora-28'
      source_image: '{{user `PRIOR_FEDORA_BASE_IMAGE`}}'

    - <<: *gce_hosted_image
      name: 'fah-29'
      source_image: '{{user `FAH_BASE_IMAGE`}}'

# The brains of the operation, making actual modifications to the base-image.
provisioners:
    - type: 'file'
      source: '{{user `GOSRC`}}'
      destination: '/tmp/libpod'

    - type: 'shell'
      script: '{{user `GOSRC`}}/{{user `PACKER_BASE`}}/{{split build_name "-" 0}}_setup.sh'
      environment_vars:
          - 'GOSRC=/tmp/libpod'
          - 'CNI_COMMIT={{user `CNI_COMMIT`}}'
          - 'FEDORA_CNI_COMMIT={{user `FEDORA_CNI_COMMIT`}}'
          - 'CRIO_COMMIT={{user `CRIO_COMMIT`}}'
          - 'CRIU_COMMIT={{user `CRIU_COMMIT`}}'
          - 'RUNC_COMMIT={{user `RUNC_COMMIT`}}'
          - 'SCRIPT_BASE={{user `SCRIPT_BASE`}}'
          - 'RHSM_COMMAND={{user `RHSM_COMMAND`}}'

post-processors:
    - - type: 'manifest'  # writes packer-manifest.json