Skip to content

Commit

Permalink
Add Ubuntu 20.04 (focal) and remove 19.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Apr 9, 2020
1 parent d26b95f commit d482e4a
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 50 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ jobs:
- my_ubuntu-18.04-server-amd64-libvirt
- ubuntu-16.04-server-amd64-libvirt
- ubuntu-18.04-server-amd64-libvirt
- ubuntu-19.10-desktop-amd64-libvirt
- ubuntu-20.04-server-amd64-libvirt
- ubuntu-20.04-desktop-amd64-libvirt
- ubuntu-18.04-desktop-amd64-libvirt
- my_windows-10-enterprise-x64-eval-libvirt
- windows-10-enterprise-x64-eval-libvirt
Expand All @@ -68,11 +69,17 @@ jobs:
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Build image - ${{ matrix.stage }}
env:
PACKER_IMAGES_OUTPUT_DIR: /var/tmp/packer-templates-images
LOGDIR: /var/tmp/packer-templates-images
run: |
ln -sv "${PACKER_CACHE_DIR}" packer_cache
./build.sh ${{ matrix.stage }}
- name: Check the created box image - ${{ matrix.stage }}
env:
LOGDIR: /var/tmp/packer-templates-images
TMPDIR: /var/tmp/packer-templates-images
run: ./vagrant_init_destroy_boxes.sh ${PACKER_IMAGES_OUTPUT_DIR}/${{ matrix.stage }}.box

- name: Upload box to Vagrant Cloud - ${{ matrix.stage }}
Expand Down Expand Up @@ -106,11 +113,12 @@ jobs:
stage:
- windows-server-2012_r2-standard-x64-eval-virtualbox
- my_centos-7-x86_64-virtualbox
- my_ubuntu-18.04-server-amd64-virtualbox
- my_ubuntu-20.04-server-amd64-virtualbox
- ubuntu-16.04-server-amd64-virtualbox
- ubuntu-18.04-server-amd64-virtualbox
- ubuntu-19.10-desktop-amd64-virtualbox
- ubuntu-20.04-server-amd64-virtualbox
- ubuntu-18.04-desktop-amd64-virtualbox
- ubuntu-20.04-desktop-amd64-virtualbox
- my_windows-10-enterprise-x64-eval-virtualbox
- windows-10-enterprise-x64-eval-virtualbox
- windows-server-2016-standard-x64-eval-virtualbox
Expand All @@ -128,11 +136,17 @@ jobs:
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Build image - ${{ matrix.stage }}
env:
PACKER_IMAGES_OUTPUT_DIR: /var/tmp/packer-templates-images
LOGDIR: /var/tmp/packer-templates-images
run: |
ln -sv "${PACKER_CACHE_DIR}" packer_cache
./build.sh ${{ matrix.stage }}
- name: Check the created box image - ${{ matrix.stage }}
env:
LOGDIR: /var/tmp/packer-templates-images
TMPDIR: /var/tmp/packer-templates-images
run: ./vagrant_init_destroy_boxes.sh ${PACKER_IMAGES_OUTPUT_DIR}/${{ matrix.stage }}.box

- name: Upload box to Vagrant Cloud - ${{ matrix.stage }}
Expand Down Expand Up @@ -164,8 +178,7 @@ jobs:
- name: Verify if the boxes are avaiable on the Vagrant Cloud
run: |
# for NAME in ubuntu-19.10-desktop-amd64 ubuntu-{18.04,16.04}-server-amd64 my_ubuntu-18.04-server-amd64 my_centos-7-x86_64 my_windows-10-enterprise-x64-eval windows-{server-{{2016,2012_r2}-standard,2019-datacenter},10-enterprise}-x64-eval; do
for NAME in ubuntu-18.04-desktop-amd64 ubuntu-{18.04,16.04}-server-amd64 my_ubuntu-18.04-server-amd64 my_centos-7-x86_64 my_windows-10-enterprise-x64-eval windows-{server-{{2016,2012_r2}-standard,2019-datacenter},10-enterprise}-x64-eval; do
for NAME in ubuntu-{20.04,18.04}-desktop-amd64 ubuntu-{20.04,18.04,16.04}-server-amd64 my_ubuntu-20.04-server-amd64 my_centos-7-x86_64 my_windows-10-enterprise-x64-eval windows-{server-{{2016,2012_r2}-standard,2019-datacenter},10-enterprise}-x64-eval; do
for VAGRANT_PROVIDER in virtualbox libvirt; do
CURRENT_VERSION=$(curl -s https://app.vagrantup.com/api/v1/box/peru/${NAME} | jq -r ".current_version.version")
CHECKSUM=$(curl https://app.vagrantup.com/api/v1/box/peru/${NAME} | jq -r ".current_version.providers[] | select (.name == \"${VAGRANT_PROVIDER}\") .checksum")
Expand All @@ -189,12 +202,12 @@ jobs:
env:
PACKER_IMAGES_OUTPUT_DIR: /var/tmp/packer-templates-images
PACKER_CACHE_DIR: /var/tmp/packer_cache
LOGDIR: /var/tmp/packer-templates-logs
VAGRANT_TMP: /var/tmp/vagrant_init_destroy_boxes
LOGDIR: /var/tmp/packer-templates-images
VAGRANT_TMP: /var/tmp/packer-templates-images
steps:
- name: Cleanup
run: |
rm -v "${PACKER_CACHE_DIR}/BOX_VERSION"
rm -v ${PACKER_IMAGES_OUTPUT_DIR}/*.box
rm -v ${LOGDIR}/*
rm -v ${LOGDIR}/*.log
rmdir -v "${PACKER_IMAGES_OUTPUT_DIR}" "${LOGDIR}" "${VAGRANT_TMP}" || true
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ for Windows:
## How to build images remotely

If you want to build the images yourself you will need password-less ssh access
to the Ubuntu Server 18.04 and locally installed Ansible. The server should
to the Ubuntu Server and locally installed Ansible. The server should
not have IPs from this range `192.168.121.0/24` - this is
used by Vagrant + libvirt by default.

Expand Down Expand Up @@ -158,13 +158,13 @@ cd packer-templates

```bash
# Ubuntu Server
./build.sh ubuntu-{18.04,16.04}-server-amd64-{libvirt,virtualbox}
./build.sh ubuntu-{20.04,18.04,16.04}-server-amd64-{libvirt,virtualbox}

# Ubuntu Desktop
./build.sh ubuntu-{19.10,18.04}-desktop-amd64-{libvirt,virtualbox}
./build.sh ubuntu-{20.04,18.04}-desktop-amd64-{libvirt,virtualbox}

# Ubuntu Server - customized
./build.sh my_ubuntu-{18.04,16.04}-server-amd64-{libvirt,virtualbox}
./build.sh my_ubuntu-{20.04,18.04,16.04}-server-amd64-{libvirt,virtualbox}
```

* Windows:
Expand Down Expand Up @@ -235,6 +235,11 @@ Use the `USE_DOCKERIZED_PACKER=true` to use Dockerized Packer to build images.

```bash
# Ubuntu Server
NAME="ubuntu-20.04-server-amd64" \
UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/images/" \
UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \
packer build -only="qemu" ubuntu-server.json

NAME="ubuntu-18.04-server-amd64" \
UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/" \
UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \
Expand All @@ -246,12 +251,17 @@ UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \
packer build -only="qemu" ubuntu-server.json

# Ubuntu Desktop
NAME="ubuntu-19.10-desktop-amd64" \
UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/eoan/main/installer-amd64/current/images/" \
NAME="ubuntu-20.04-desktop-amd64" \
UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/images/" \
UBUNTU_TYPE="desktop" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \
packer build -only="qemu" ubuntu-desktop.json

# Ubuntu Server - customized
NAME="my_ubuntu-20.04-server-amd64" \
UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/images/" \
UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \
packer build -only="qemu" my_ubuntu-server.json

NAME="my_ubuntu-18.04-server-amd64" \
UBUNTU_IMAGES_URL="http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/" \
UBUNTU_TYPE="server" PACKER_IMAGES_OUTPUT_DIR="/var/tmp/" \
Expand Down
12 changes: 7 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ List of all supported builds:
* windows-server-2019-standard-x64-eval-{libvirt,virtualbox}
* windows-server-2016-standard-x64-eval-{libvirt,virtualbox}
* windows-server-2012_r2-standard-x64-eval-{libvirt,virtualbox}
* ubuntu-19.10-desktop-amd64-{libvirt,virtualbox}
* ubuntu-20.04-desktop-amd64-{libvirt,virtualbox}
* ubuntu-18.04-desktop-amd64-{libvirt,virtualbox}
* ubuntu-20.04-server-amd64-{libvirt,virtualbox}
* ubuntu-18.04-server-amd64-{libvirt,virtualbox}
* ubuntu-16.04-server-amd64-{libvirt,virtualbox}
* my_ubuntu-20.04-server-amd64-{libvirt,virtualbox}
* my_ubuntu-18.04-server-amd64-{libvirt,virtualbox}
* my_ubuntu-16.04-server-amd64-{libvirt,virtualbox}
* my_centos-7-x86_64-{libvirt,virtualbox}
Expand All @@ -64,11 +66,11 @@ Build Windows 10 Enterprise Evaluation, Windows Server 2019 Standard Evaluation,
windows-server-2016-standard-x64-eval-{libvirt,virtualbox} \\
windows-server-2012_r2-standard-x64-eval-{libvirt,virtualbox}
Build Ubuntu Desktop 19.10, 18.04; Ubuntu Server 18.04, 16.04; My Ubuntu Server 18.04, 16.04; My CentOS 7 for libvirt and Virtualbox:
Build Ubuntu Desktop 20.04, 18.04; Ubuntu Server 20.04, 18.04, 16.04; My Ubuntu Server 20.04, 18.04, 16.04; My CentOS 7 for libvirt and Virtualbox:
$PROGNAME \\
ubuntu-{19.10,18.04}-desktop-amd64-{libvirt,virtualbox} \\
ubuntu-{18.04,16.04}-server-amd64-{libvirt,virtualbox} \\
my_ubuntu-{18.04,16.04}-server-amd64-{libvirt,virtualbox} \\
ubuntu-{20.04,18.04}-desktop-amd64-{libvirt,virtualbox} \\
ubuntu-{20.04,18.04,16.04}-server-amd64-{libvirt,virtualbox} \\
my_ubuntu-{20.04,18.04,16.04}-server-amd64-{libvirt,virtualbox} \\
my_centos-7-x86_64-{libvirt,virtualbox}
EOF
}
Expand Down
18 changes: 2 additions & 16 deletions my_ubuntu-server.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_comment0": "NAME=my_ubuntu-20.04-server-amd64 UBUNTU_IMAGES_URL=http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/images PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ packer build my_ubuntu-server.json",
"_comment1": "NAME=my_ubuntu-18.04-server-amd64 UBUNTU_IMAGES_URL=http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ packer build my_ubuntu-server.json",
"_comment2": "NAME=my_ubuntu-16.04-server-amd64 UBUNTU_IMAGES_URL=http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ packer build my_ubuntu-server.json",
"variables": {
Expand Down Expand Up @@ -77,13 +78,7 @@
"modifyvm",
"{{ .Name }}",
"--graphicscontroller",
"vboxsvga"
],
[
"modifyvm",
"{{ .Name }}",
"--audiocontroller",
"hda"
"vmsvga"
]
],
"boot_wait": "5s",
Expand All @@ -110,15 +105,6 @@
"scripts/ubuntu/virtualbox-guest.sh"
]
},
{
"type": "shell",
"environment_vars": [
"DEBIAN_FRONTEND=noninteractive"
],
"inline": [
"sudo -E apt-get install -y aptitude python > /dev/null"
]
},
{
"type": "ansible",
"user": "vagrant",
Expand Down
7 changes: 3 additions & 4 deletions tools/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
set -o pipefail

LOGFILE="/tmp/build_all.log"

PACKER_IMAGES_OUTPUT_DIR="/var/tmp/packer-templates-images"

(
cd ..
for PACKER_VAGRANT_PROVIDER in libvirt virtualbox; do
for BUILD in ubuntu-{19.10,18.04,16.04}-desktop-amd64 ubuntu-{18.04,16.04}-server-amd64 my_ubuntu-{18.04,16.04}-server-amd64 my_centos-7-x86_64 my_windows-10-enterprise-x64-eval windows-{server-{2019,2016,2012_r2}-standard,10-enterprise}-x64-eval; do
for BUILD in ubuntu-{20.04,18.04,16.04}-desktop-amd64 ubuntu-{20.04,18.04,16.04}-server-amd64 my_ubuntu-{20.04,18.04,16.04}-server-amd64 my_centos-7-x86_64 my_windows-10-enterprise-x64-eval windows-{server-{2019,2016,2012_r2}-standard,10-enterprise}-x64-eval; do
echo "**** $(date)"
./build.sh ${BUILD}-${PACKER_VAGRANT_PROVIDER}
done
done

./vagrant_init_destroy_boxes.sh

./vagrant_init_destroy_boxes.sh ${PACKER_IMAGES_OUTPUT_DIR}/*.box
) 2>&1 | tee $LOGFILE
4 changes: 2 additions & 2 deletions ubuntu-desktop.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"_comment1": "NAME=ubuntu-19.10-desktop-amd64 UBUNTU_IMAGES_URL=http://archive.ubuntu.com/ubuntu/dists/eoan/main/installer-amd64/current/images PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ packer build -only=qemu ubuntu-desktop.json",
"_comment1": "NAME=ubuntu-20.04-desktop-amd64 UBUNTU_IMAGES_URL=http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/images PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ packer build -only=qemu ubuntu-desktop.json",
"_comment2": "NAME=ubuntu-18.04-desktop-amd64 UBUNTU_IMAGES_URL=http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ packer build -only=qemu ubuntu-desktop.json",
"_comment3": "NAME=ubuntu-16.04-desktop-amd64 UBUNTU_IMAGES_URL=http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ packer build -only=qemu ubuntu-desktop.json",
"variables": {
Expand Down Expand Up @@ -78,7 +78,7 @@
"modifyvm",
"{{ .Name }}",
"--graphicscontroller",
"vboxsvga"
"vmsvga"
],
[
"modifyvm",
Expand Down
9 changes: 2 additions & 7 deletions ubuntu-server.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"_comment0": "NAME=ubuntu-20.04-server-amd64 UBUNTU_IMAGES_URL=http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/images PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ packer build -only=qemu ubuntu-server.json",
"_comment1": "NAME=ubuntu-18.04-server-amd64 UBUNTU_IMAGES_URL=http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ packer build -only=qemu ubuntu-server.json",
"_comment2": "NAME=ubuntu-16.04-server-amd64 UBUNTU_IMAGES_URL=http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images PACKER_IMAGES_OUTPUT_DIR=/var/tmp/ packer build -only=qemu ubuntu-server.json",
"variables": {
Expand Down Expand Up @@ -77,13 +78,7 @@
"modifyvm",
"{{ .Name }}",
"--graphicscontroller",
"vboxsvga"
],
[
"modifyvm",
"{{ .Name }}",
"--audiocontroller",
"hda"
"vmsvga"
]
],
"boot_wait": "5s",
Expand Down
5 changes: 3 additions & 2 deletions upload_box_to_vagrantcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ Box names with user:
* peru@my_centos-7-x86_64-{libvirt,virtualbox}.box
* peru@my_ubuntu-16.04-server-amd64-{libvirt,virtualbox}.box
* peru@my_ubuntu-18.04-server-amd64-{libvirt,virtualbox}.box
* peru@my_ubuntu-20.04-server-amd64-{libvirt,virtualbox}.box
* peru@my_windows-10-enterprise-x64-eval-{libvirt,virtualbox}.box
* [email protected]{libvirt,virtualbox}.box
* [email protected]{libvirt,virtualbox}.box
* [email protected]{libvirt,virtualbox}.box
* [email protected]{libvirt,virtualbox}.box
* [email protected]{libvirt,virtualbox}.box
* [email protected]{libvirt,virtualbox}.box
* [email protected]{libvirt,virtualbox}.box
* peru@windows-10-enterprise-x64-eval-{libvirt,virtualbox}.box
* peru@windows-server-2012_r2-standard-x64-eval-{libvirt,virtualbox}.box
Expand Down

0 comments on commit d482e4a

Please sign in to comment.