summaryrefslogtreecommitdiff
path: root/grid5000/steps/export/export_g5k.yaml
blob: 04b1358134e588f8527fa691143a33804b468c10 (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
# Generate a dsc file as used on grid'5000 by kaenv

- dashes: "---" # kameleon eats my dash if I don't use this dirty hack :-(
- g5k_version: "unknown"
- g5k_kernel_path: "/vmlinuz"
- g5k_initrd_path: "/initrd.img"
- g5k_filesystem: "ext4"
- g5k_author: "support-staff@lists.grid5000.fr"
- g5k_visibility: "public"
- g5k_destructive: "false"
- g5k_tar_compression: "gzip"
- g5k_postinst_compression: "gzip"

# - save_as_tgz:
#   - check_cmd_local: guestfish
#   - check_cmd_local: gzip
#   - exec_local: echo "Exporting appliance to $${output}.tgz"
#   - exec_local: mkdir -p $${kameleon_cwd}/.mnt
#   - exec_local: LIBGUESTFS_CACHEDIR=$${kameleon_cwd} guestmount --ro -i -a $${input} $${kameleon_cwd}/.mnt
#   - exec_local: LIBGUESTFS_CACHEDIR=$${kameleon_cwd} tar -cf $${output}.tgz --gzip --numeric-owner --selinux --acls --xattrs -C $${kameleon_cwd}/.mnt .
#   - exec_local: LIBGUESTFS_CACHEDIR=$${kameleon_cwd} guestunmount $${kameleon_cwd}/.mnt
#   - exec_local: rmdir $${kameleon_cwd}/.mnt

- generate_dsc:
  - exec_local: echo "Creating description file for kaenv in $${output}.dsc"
  - exec_local: |
      if [[ "x$${g5k_variant}" != "xxen" ]]; then
      cat << EOF > $${output}.dsc
      $${dashes}
      name: $${kameleon_recipe_name}
      version: $${g5k_version}
      description: $${distrib} $${release_number} ($${release}) for $${g5k_image_arch} - $${g5k_variant}
      author: $${g5k_author}
      visibility: $${g5k_visibility}
      destructive: $${g5k_destructive}
      os: linux
      image:
        file: $${g5k_tar_path}
        kind: tar
        compression: $${g5k_tar_compression}
      postinstalls:
      - archive: $${g5k_postinst_path}
        compression: $${g5k_postinst_compression}
        script: $${g5k_postinst_script}
      boot:
        kernel_params: "$${g5k_kernel_params}"
        kernel: $${g5k_kernel_path}
        initrd: $${g5k_initrd_path}
      filesystem: $${g5k_filesystem}
      partition_type: 131
      multipart: false
      EOF
      else
      cat << EOF > $${output}.dsc
      $${dashes}
      name: $${kameleon_recipe_name}
      version: $${g5k_version}
      description: $${distrib} $${release_number} ($${release}) for $${g5k_image_arch} - $${g5k_variant}
      author: $${g5k_author}
      visibility: $${g5k_visibility}
      destructive: $${g5k_destructive}
      os: xen
      image:
        file: $${g5k_tar_path}
        kind: tar
        compression: $${g5k_tar_compression}
      postinstalls:
      - archive: $${g5k_postinst_path}
        compression: $${g5k_postinst_compression}
        script: $${g5k_postinst_script}
      boot:
        kernel_params: "$${g5k_kernel_params}"
        kernel: $${g5k_kernel_path}
        initrd: $${g5k_initrd_path}
        hypervisor: /hypervisor
        hypervisor_params: "dom0_mem=4096M no-bootscrub"
      filesystem: $${g5k_filesystem}
      partition_type: 131
      multipart: false
      EOF
      fi

- generate_md5:
  - exec_local: md5sum $${kameleon_recipe_name}.* > $${kameleon_recipe_name}.md5