Verified Commit 08b391b9 authored by Sven-Hendrik Haase's avatar Sven-Hendrik Haase
Browse files

Merge local.json into vagrant.json

parent b3997007
...@@ -29,7 +29,6 @@ validate-packer: ...@@ -29,7 +29,6 @@ validate-packer:
- pacman -Syu --needed --noconfirm packer - pacman -Syu --needed --noconfirm packer
script: script:
- packer validate -var "iso_checksum_url=https://mirror.pkgbuild.com/iso/latest/sha1sums.txt" -except=vagrant-cloud vagrant.json - packer validate -var "iso_checksum_url=https://mirror.pkgbuild.com/iso/latest/sha1sums.txt" -except=vagrant-cloud vagrant.json
- packer validate local.json
- packer validate cloud.json - packer validate cloud.json
# Note: We explicitly need the `ipv6` tag here because otherwise we'd get random # Note: We explicitly need the `ipv6` tag here because otherwise we'd get random
...@@ -43,7 +42,7 @@ build:cloud-qemu: ...@@ -43,7 +42,7 @@ build:cloud-qemu:
script: script:
- packer build -except=sign cloud.json - packer build -except=sign cloud.json
artifacts: artifacts:
name: "cloud-qemu" name: "qcow2"
paths: paths:
- "release/Arch-Linux-x86_64-cloudimg-*.qcow2" - "release/Arch-Linux-x86_64-cloudimg-*.qcow2"
expire_in: 2d expire_in: 2d
...@@ -55,7 +54,7 @@ build:vagrant-qemu: ...@@ -55,7 +54,7 @@ build:vagrant-qemu:
before_script: before_script:
- pacman -Syu --needed --noconfirm packer qemu-headless - pacman -Syu --needed --noconfirm packer qemu-headless
script: script:
- packer build -only=qemu local.json - packer build -only=qemu -except publish vagrant.json
publish: publish:
stage: publish stage: publish
...@@ -65,7 +64,7 @@ publish: ...@@ -65,7 +64,7 @@ publish:
before_script: before_script:
- pacman -Syu --needed --noconfirm qemu-headless virtualbox packer - pacman -Syu --needed --noconfirm qemu-headless virtualbox packer
script: script:
- packer build -parallel-builds=1 -var "vagrant_cloud_token=$VAGRANT_API_TOKEN" -except=vmware-iso vagrant.json - packer build -var "vagrant_cloud_token=$VAGRANT_API_TOKEN" vagrant.json
only: only:
variables: variables:
- $SCHEDULED_PUBLISH == "TRUE" - $SCHEDULED_PUBLISH == "TRUE"
......
...@@ -17,11 +17,10 @@ You'll need the following dependencies: ...@@ -17,11 +17,10 @@ You'll need the following dependencies:
* vagrant (for vagrant images) * vagrant (for vagrant images)
* qemu (for libvirt provider support) * qemu (for libvirt provider support)
* virtualbox (for virtualbox support) * virtualbox (for virtualbox support)
* VMware Workstation Pro (for vmware support)
## Variables ## Variables
Here is an overview over all variables you can set in `vagrant.json` or Here is an overview over all variables you can set in `vagrant.json` or
`local.json`: `cloud.json`:
* `iso_url`: the url to the ISO. This can be an url or a filepath * `iso_url`: the url to the ISO. This can be an url or a filepath
beginning with `file://` beginning with `file://`
...@@ -30,8 +29,6 @@ Here is an overview over all variables you can set in `vagrant.json` or ...@@ -30,8 +29,6 @@ Here is an overview over all variables you can set in `vagrant.json` or
* `iso_checksum_type`: this specifies the hashing algorithm for the * `iso_checksum_type`: this specifies the hashing algorithm for the
checksum. checksum.
* `disk_size`: this specifices the disk size in bytes. * `disk_size`: this specifices the disk size in bytes.
* `memory`: this specifies the size of the RAM in bytes.
* `cpus`: this specifies the number of cores for your VM.
* `headless`: this sets GUI on or off. * `headless`: this sets GUI on or off.
* `vagrant_cloud_token`: here you can specify the vagrant cloud token for * `vagrant_cloud_token`: here you can specify the vagrant cloud token for
uploading your box to the vagrantcloud. If you don't have a vagrant cloud uploading your box to the vagrantcloud. If you don't have a vagrant cloud
...@@ -42,14 +39,14 @@ Here is an overview over all variables you can set in `vagrant.json` or ...@@ -42,14 +39,14 @@ Here is an overview over all variables you can set in `vagrant.json` or
## How to start the build process locally ## How to start the build process locally
If you want to build the boxes locally without uploading them to the Vagrant If you want to build the boxes locally without uploading them to the Vagrant
cloud you need to edit the `local.json` before you start the build. set the cloud you need to edit the `vagrant.json` before you start the build. set the
right `iso_url` and the right `iso_checksum_url`. Then you can start the build right `iso_url` and the right `iso_checksum_url`. Then you can start the build
for virtualbox only with the following command: for virtualbox only with the following command:
`packer build -only=virtualbox-iso local.json` `packer build -only=qemu -except=publish vagrant.json`
## How to start the build process for official builds ## How to start the build process for official builds
The official builds are done on our Arch Linux Buildserver. The official builds are done in our Arch Linux GitLab CI.
`packer build vagrant.json` `packer build vagrant.json`
...@@ -57,7 +54,6 @@ The official builds are done on our Arch Linux Buildserver. ...@@ -57,7 +54,6 @@ The official builds are done on our Arch Linux Buildserver.
* virtualbox-iso * virtualbox-iso
* qemu/libvirt * qemu/libvirt
* vmware-iso
## Post-processors ## Post-processors
......
{
"variables": {
"iso_url": "https://mirror.pkgbuild.com/iso/latest/archlinux-{{isotime \"2006.01\"}}.01-x86_64.iso",
"iso_checksum_url": "https://mirror.pkgbuild.com/iso/latest/sha1sums.txt",
"disk_size": "20480",
"headless": "true",
"boot_wait": "60s",
"accelerator": "",
"mirror": "https://mirror.pkgbuild.com/$repo/os/$arch"
},
"builders": [
{
"type": "virtualbox-iso",
"cpus": 2,
"memory": 1024,
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"hard_drive_discard": "true",
"guest_os_type": "ArchLinux_64",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "2000s",
"shutdown_command": "sudo systemctl poweroff",
"guest_additions_mode": "disable",
"headless": "{{user `headless`}}",
"boot_command": [
"<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>",
"curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>",
"MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>"
]
},
{
"type": "qemu",
"cpus": 2,
"memory": 1024,
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"disk_discard": "unmap",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "2000s",
"shutdown_command": "sudo systemctl poweroff",
"headless": "{{user `headless`}}",
"accelerator": "{{user `accelerator`}}",
"disk_compression": true,
"boot_command": [
"<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>",
"curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>",
"MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>"
]
},
{
"type": "vmware-iso",
"cpus": 2,
"memory": 1024,
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "2000s",
"shutdown_command": "sudo systemctl poweroff",
"headless": "{{user `headless`}}",
"boot_command": [
"<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>",
"curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>",
"MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>"
]
}
],
"provisioners": [
{
"type": "shell",
"scripts": [
"provision/postinstall.sh",
"provision/virtualbox.sh",
"provision/cleanup.sh"
],
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
"only": [
"virtualbox-iso"
]
},
{
"type": "shell",
"scripts": [
"provision/postinstall.sh",
"provision/qemu.sh",
"provision/cleanup.sh"
],
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
"only": [
"qemu"
]
},
{
"type": "shell",
"scripts": [
"provision/postinstall.sh",
"provision/vmware.sh",
"provision/cleanup.sh"
],
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
"only": [
"vmware-iso"
]
}
],
"post-processors": [
[
{
"type": "vagrant",
"keep_input_artifact": false,
"output": "Arch-Linux-x86_64-{{ .Provider }}-{{isotime \"2006-01-02\"}}.box"
}
]
]
}
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"headless": "true", "headless": "true",
"vagrant_cloud_token": "PLACEHOLDER", "vagrant_cloud_token": "PLACEHOLDER",
"boot_wait": "60s", "boot_wait": "60s",
"mirror": "" "accelerator": "",
"mirror": "https://mirror.pkgbuild.com/$repo/os/$arch"
}, },
"builders": [ "builders": [
{ {
...@@ -56,27 +57,6 @@ ...@@ -56,27 +57,6 @@
"curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>", "curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>",
"MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>" "MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>"
] ]
},
{
"type": "vmware-iso",
"cpus": 2,
"memory": 1024,
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "2000s",
"shutdown_command": "sudo systemctl poweroff",
"headless": "{{user `headless`}}",
"boot_command": [
"<enter><wait10><wait10><wait10><wait10><wait10><enter><enter>",
"curl -O 'http://{{.HTTPIP}}:{{.HTTPPort}}/install{,-common,-chroot}.sh'<enter><wait>",
"MIRROR='{{user `mirror`}}' bash install.sh < <(cat install-{chroot,common}.sh) && systemctl reboot<enter>"
]
} }
], ],
"provisioners": [ "provisioners": [
...@@ -103,23 +83,12 @@ ...@@ -103,23 +83,12 @@
"only": [ "only": [
"qemu" "qemu"
] ]
},
{
"type": "shell",
"scripts": [
"provision/postinstall.sh",
"provision/vmware.sh",
"provision/cleanup.sh"
],
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
"only": [
"vmware-iso"
]
} }
], ],
"post-processors": [ "post-processors": [
[ [
{ {
"name": "publish",
"type": "vagrant", "type": "vagrant",
"keep_input_artifact": false, "keep_input_artifact": false,
"output": "Arch-Linux-x86_64-{{ .Provider }}-{{isotime \"2006-01-02\"}}.box" "output": "Arch-Linux-x86_64-{{ .Provider }}-{{isotime \"2006-01-02\"}}.box"
...@@ -141,15 +110,6 @@ ...@@ -141,15 +110,6 @@
"access_token": "{{user `vagrant_cloud_token`}}", "access_token": "{{user `vagrant_cloud_token`}}",
"box_tag": "archlinux/archlinux", "box_tag": "archlinux/archlinux",
"version": "{{isotime \"2006.01.02\"}}" "version": "{{isotime \"2006.01.02\"}}"
},
{
"type": "vagrant-cloud",
"only": [
"vmware-iso"
],
"access_token": "{{user `vagrant_cloud_token`}}",
"box_tag": "archlinux/archlinux",
"version": "{{isotime \"2006.01.02\"}}"
} }
] ]
] ]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment