Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #22 from jdeathe/develop
Browse files Browse the repository at this point in the history
Release changes for 1.1.0 release.
  • Loading branch information
jdeathe authored Dec 24, 2016
2 parents da23d4e + 353e8ad commit 763fcca
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 100 deletions.
12 changes: 7 additions & 5 deletions CentOS-7-Minimal-Cloud-Init-virtualbox.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"variables": {
"build_export_format": "ovf",
"build_iso_checksum": "f90e4d28fa377669b2db16cbcb451fcb9a89d2460e3645993e30e137ac37d284",
"build_iso_checksum_type": "sha256",
"build_iso_filename": "CentOS-7-x86_64-Minimal-1511.iso",
"build_iso_checksum": "71a7aa147877b413497cdff5b1e0aa5bc0c9484f",
"build_iso_checksum_type": "sha1",
"build_iso_filename": "CentOS-7-x86_64-Minimal-1611.iso",
"build_iso_target_path": "isos/x86_64",
"build_name": "CentOS-7.2.1511-x86_64-Minimal-Cloud-Init-en_US",
"build_name": "CentOS-7.3.1611-x86_64-Minimal-Cloud-Init-en_US",
"build_output_directory": "builds",
"guest_boot_timeout": "0",
"guest_bootloader_append": "net.ifnames=0 biosdevname=0",
Expand All @@ -15,9 +15,10 @@
"guest_keyboard": "us",
"guest_language": "en_US.UTF-8",
"guest_lv_root_fstype": "ext4",
"guest_lv_root_mkfsoptions": "-i 4096",
"guest_lv_root_size": "1024",
"guest_lv_swap_size": "4096",
"guest_name": "CentOS-7.2.1511-x86_64-Minimal-Cloud-Init-en_US",
"guest_name": "CentOS-7.3.1611-x86_64-Minimal-Cloud-Init-en_US",
"guest_partition_boot_fstype": "ext4",
"guest_partition_boot_size": "250",
"guest_memory": "512",
Expand Down Expand Up @@ -50,6 +51,7 @@
" FIREWALL_DISABLED={{user `guest_firewall_disabled`}}",
" SELINUX={{user `guest_selinux`}}",
" LV_ROOT_FSTYPE={{user `guest_lv_root_fstype`}}",
" LV_ROOT_MKFSOPTIONS=\"{{user `guest_lv_root_mkfsoptions`}}\"",
" LV_ROOT_SIZE={{user `guest_lv_root_size`}}",
" LV_SWAP_SIZE={{user `guest_lv_swap_size`}}",
" PART_BOOT_FSTYPE={{user `guest_partition_boot_fstype`}}",
Expand Down
14 changes: 8 additions & 6 deletions CentOS-7-Minimal-virtualbox.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"variables": {
"build_export_format": "ovf",
"build_iso_checksum": "f90e4d28fa377669b2db16cbcb451fcb9a89d2460e3645993e30e137ac37d284",
"build_iso_checksum_type": "sha256",
"build_iso_filename": "CentOS-7-x86_64-Minimal-1511.iso",
"build_iso_checksum": "71a7aa147877b413497cdff5b1e0aa5bc0c9484f",
"build_iso_checksum_type": "sha1",
"build_iso_filename": "CentOS-7-x86_64-Minimal-1611.iso",
"build_iso_target_path": "isos/x86_64",
"build_name": "CentOS-7.2.1511-x86_64-Minimal-en_US",
"build_name": "CentOS-7.3.1611-x86_64-Minimal-en_US",
"build_output_directory": "builds",
"guest_boot_timeout": "0",
"guest_bootloader_append": "net.ifnames=0 biosdevname=0",
Expand All @@ -15,11 +15,12 @@
"guest_keyboard": "us",
"guest_language": "en_US.UTF-8",
"guest_lv_root_fstype": "ext4",
"guest_lv_root_mkfsoptions": "-i 4096",
"guest_lv_root_size": "1024",
"guest_lv_swap_size": "4096",
"guest_name": "CentOS-7.2.1511-x86_64-Minimal-en_US",
"guest_name": "CentOS-7.3.1611-x86_64-Minimal-en_US",
"guest_partition_boot_fstype": "ext4",
"guest_partition_boot_size": "250",
"guest_partition_boot_size": "1024",
"guest_memory": "512",
"guest_selinux": "permissive",
"guest_timezone": "Etc/UTC",
Expand Down Expand Up @@ -50,6 +51,7 @@
" FIREWALL_DISABLED={{user `guest_firewall_disabled`}}",
" SELINUX={{user `guest_selinux`}}",
" LV_ROOT_FSTYPE={{user `guest_lv_root_fstype`}}",
" LV_ROOT_MKFSOPTIONS=\"{{user `guest_lv_root_mkfsoptions`}}\"",
" LV_ROOT_SIZE={{user `guest_lv_root_size`}}",
" LV_SWAP_SIZE={{user `guest_lv_swap_size`}}",
" PART_BOOT_FSTYPE={{user `guest_partition_boot_fstype`}}",
Expand Down
16 changes: 16 additions & 0 deletions CentOS-7.3.1611-x86_64-Minimal-Cloud-Init-en_US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"build_iso_checksum": "71a7aa147877b413497cdff5b1e0aa5bc0c9484f",
"build_iso_checksum_type": "sha1",
"build_iso_filename": "CentOS-7-x86_64-Minimal-1611.iso",
"build_iso_target_path": "isos/x86_64",
"build_name": "CentOS-7.3.1611-x86_64-Minimal-Cloud-Init-en_US",
"guest_hard_disk_size": "40960",
"guest_keyboard": "us",
"guest_language": "en_US.UTF-8",
"guest_lv_swap_size": "4096",
"guest_name": "CentOS-7.3.1611-x86_64-Minimal-Cloud-Init-en_US",
"guest_partition_boot_size": "1024",
"guest_memory": "512",
"guest_selinux": "permissive",
"guest_vg_root_reserved_space": "0"
}
16 changes: 16 additions & 0 deletions CentOS-7.3.1611-x86_64-Minimal-en_US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"build_iso_checksum": "71a7aa147877b413497cdff5b1e0aa5bc0c9484f",
"build_iso_checksum_type": "sha1",
"build_iso_filename": "CentOS-7-x86_64-Minimal-1611.iso",
"build_iso_target_path": "isos/x86_64",
"build_name": "CentOS-7.3.1611-x86_64-Minimal-en_US",
"guest_hard_disk_size": "40960",
"guest_keyboard": "us",
"guest_language": "en_US.UTF-8",
"guest_lv_swap_size": "4096",
"guest_name": "CentOS-7.3.1611-x86_64-Minimal-en_US",
"guest_partition_boot_size": "1024",
"guest_memory": "512",
"guest_selinux": "permissive",
"guest_vg_root_reserved_space": "0"
}
124 changes: 62 additions & 62 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Variables (default value):
- Minimal
- Minimal-Cloud-Init
- BOX_VERSION_RELEASE The CentOS-7 Minor Release number. Note: A
(7.2.1511) corresponding template is required.
(7.3.1611) corresponding template is required.

endef

Expand All @@ -46,7 +46,7 @@ BOX_DEBUG ?= false
BOX_LANG ?= en_US
BOX_OUTPUT_PATH ?= ./builds
BOX_VARIANT ?= Minimal
BOX_VERSION_RELEASE ?= 7.2.1511
BOX_VERSION_RELEASE ?= 7.3.1611

# UI constants
COLOUR_NEGATIVE := \033[1;31m
Expand Down Expand Up @@ -162,10 +162,10 @@ endif

_require-supported-architecture:
@ if [[ ! $(BOX_ARCH) =~ $(BOX_ARCH_PATTERN) ]]; then \
echo "$(PREFIX_STEP_NEGATIVE)Unsupported architecture ($(BOX_ARCH))" >&2; \
echo "$(PREFIX_SUB_STEP)Supported values: x86_64|i386." >&2; \
exit 1; \
fi
echo "$(PREFIX_STEP_NEGATIVE)Unsupported architecture ($(BOX_ARCH))" >&2; \
echo "$(PREFIX_SUB_STEP)Supported values: x86_64|i386." >&2; \
exit 1; \
fi

_usage:
@: $(info $(USAGE))
Expand All @@ -175,57 +175,57 @@ all: _prerequisites | build
build: _prerequisites _require-supported-architecture | download-iso
@ echo "$(PREFIX_STEP)Building $(PACKER_BUILD_NAME)"
@ if [[ ! -f $(PACKER_VAR_FILE) ]]; then \
echo "$(PREFIX_SUB_STEP_NEGATIVE)Missing var-file: $(PACKER_VAR_FILE)" >&2; \
exit 1; \
elif [[ ! -f $(PACKER_TEMPLATE_NAME) ]]; then \
echo "$(PREFIX_SUB_STEP_NEGATIVE)Missing template: $(PACKER_TEMPLATE_NAME)" >&2; \
exit 1; \
echo "$(PREFIX_SUB_STEP_NEGATIVE)Missing var-file: $(PACKER_VAR_FILE)" >&2; \
exit 1; \
elif [[ ! -f $(PACKER_TEMPLATE_NAME) ]]; then \
echo "$(PREFIX_SUB_STEP_NEGATIVE)Missing template: $(PACKER_TEMPLATE_NAME)" >&2; \
exit 1; \
else \
if [[ $(BOX_DEBUG) == true ]]; then \
$(packer) build \
-debug \
-force \
-var-file=$(PACKER_VAR_FILE) \
$(PACKER_TEMPLATE_NAME); \
else \
$(packer) build \
-force \
-var-file=$(PACKER_VAR_FILE) \
$(PACKER_TEMPLATE_NAME); \
fi; \
if [[ $${?} -eq 0 ]]; then \
$(openssl) sha1 \
$(BOX_OUTPUT_PATH)/$(PACKER_BUILD_NAME)-$(BOX_PROVIDOR).box \
| awk '{ print $$2; }' \
> $(BOX_OUTPUT_PATH)/$(PACKER_BUILD_NAME)-$(BOX_PROVIDOR).box.sha1; \
echo "$(PREFIX_SUB_STEP_POSITIVE)Build complete"; \
else \
if [[ $(BOX_DEBUG) == true ]]; then \
$(packer) build \
-debug \
-force \
-var-file=$(PACKER_VAR_FILE) \
$(PACKER_TEMPLATE_NAME); \
else \
$(packer) build \
-force \
-var-file=$(PACKER_VAR_FILE) \
$(PACKER_TEMPLATE_NAME); \
fi; \
if [[ $${?} -eq 0 ]]; then \
$(openssl) sha1 \
$(BOX_OUTPUT_PATH)/$(PACKER_BUILD_NAME)-$(BOX_PROVIDOR).box \
| awk '{ print $$2; }' \
> $(BOX_OUTPUT_PATH)/$(PACKER_BUILD_NAME)-$(BOX_PROVIDOR).box.sha1; \
echo "$(PREFIX_SUB_STEP_POSITIVE)Build complete"; \
else \
rm -f $(BOX_OUTPUT_PATH)/$(PACKER_BUILD_NAME)-$(BOX_PROVIDOR).box.sha1 &> /dev/null; \
echo "$(PREFIX_SUB_STEP_NEGATIVE)Build error" >&2; \
exit 1; \
fi; \
fi
rm -f $(BOX_OUTPUT_PATH)/$(PACKER_BUILD_NAME)-$(BOX_PROVIDOR).box.sha1 &> /dev/null; \
echo "$(PREFIX_SUB_STEP_NEGATIVE)Build error" >&2; \
exit 1; \
fi; \
fi

download-iso: _prerequisites _require-supported-architecture
@ if [[ ! -f isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME) ]]; then \
if [[ ! -d ./isos/$(BOX_ARCH) ]]; then \
mkdir -p ./isos/$(BOX_ARCH); \
fi; \
echo "$(PREFIX_STEP)Downloading ISO: http://mirrors.kernel.org/centos/$(BOX_VERSION_RELEASE)/isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME)"; \
if [[ ! -d ./isos/$(BOX_ARCH) ]]; then \
mkdir -p ./isos/$(BOX_ARCH); \
fi; \
echo "$(PREFIX_STEP)Downloading ISO: http://mirrors.kernel.org/centos/$(BOX_VERSION_RELEASE)/isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME)"; \
$(curl) -LSo ./isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME) \
http://mirrors.kernel.org/centos/$(BOX_VERSION_RELEASE)/isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME); \
if [[ $${?} -eq 0 ]]; then \
rm -f ./isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME) &> /dev/null; \
echo "$(PREFIX_STEP)Download failed - trying vault: http://archive.kernel.org/centos-vault/$(BOX_VERSION_RELEASE)/isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME)"; \
$(curl) -LSo ./isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME) \
http://mirrors.kernel.org/centos/$(BOX_VERSION_RELEASE)/isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME); \
if [[ $${?} -eq 0 ]]; then \
rm -f ./isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME) &> /dev/null; \
echo "$(PREFIX_STEP)Download failed - trying vault: http://archive.kernel.org/centos-vault/$(BOX_VERSION_RELEASE)/isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME)"; \
$(curl) -LSo ./isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME) \
http://archive.kernel.org/centos-vault/$(BOX_VERSION_RELEASE)/isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME); \
fi; \
if [[ $${?} -eq 0 ]]; then \
echo "$(PREFIX_STEP_NEGATIVE)ISO Download failed" >&2; \
rm -f ./isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME) &> /dev/null; \
exit 1; \
fi; \
fi
http://archive.kernel.org/centos-vault/$(BOX_VERSION_RELEASE)/isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME); \
fi; \
if [[ $${?} -eq 0 ]]; then \
echo "$(PREFIX_STEP_NEGATIVE)ISO Download failed" >&2; \
rm -f ./isos/$(BOX_ARCH)/$(SOURCE_ISO_NAME) &> /dev/null; \
exit 1; \
fi; \
fi

help: _usage

Expand All @@ -244,13 +244,13 @@ install: _prerequisites _require-supported-architecture
| cut -c1-8 \
))
@ if [[ -f $(BOX_OUTPUT_PATH)/$(PACKER_BUILD_NAME)-$(BOX_PROVIDOR).box ]]; then \
echo "$(PREFIX_STEP)Installing $(BOX_NAMESPACE)/$($@_box_name)/$($@_box_hash)"; \
$(vagrant) box add --force \
--name $(BOX_NAMESPACE)/$($@_box_name)/$($@_box_hash) \
$(BOX_OUTPUT_PATH)/$(PACKER_BUILD_NAME)-$(BOX_PROVIDOR).box; \
echo "$(PREFIX_STEP)Vagrantfile:"; \
$(vagrant) init --output - --minimal $(BOX_NAMESPACE)/$($@_box_name)/$($@_box_hash); \
else \
echo "$(PREFIX_STEP_NEGATIVE)No box file."; \
echo "$(PREFIX_SUB_STEP)Try running: make build"; \
fi
echo "$(PREFIX_STEP)Installing $(BOX_NAMESPACE)/$($@_box_name)/$($@_box_hash)"; \
$(vagrant) box add --force \
--name $(BOX_NAMESPACE)/$($@_box_name)/$($@_box_hash) \
$(BOX_OUTPUT_PATH)/$(PACKER_BUILD_NAME)-$(BOX_PROVIDOR).box; \
echo "$(PREFIX_STEP)Vagrantfile:"; \
$(vagrant) init --output - --minimal $(BOX_NAMESPACE)/$($@_box_name)/$($@_box_hash); \
else \
echo "$(PREFIX_STEP_NEGATIVE)No box file."; \
echo "$(PREFIX_SUB_STEP)Try running: make build"; \
fi
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This provides the configuration and Makefile to build a [Vagrant](https://www.vagrantup.com) minimal base box using [Packer](https://www.packer.io). The base box is intended for server (terminal) use only so is restricted to a single locale (with `en_US` being the default) which allows for a smaller box size.

There are templates provided for `CentOS-7.2.1511` with `x86_64` architecture. There is currently no requirement to support older minor release versions or alternative architectures but they could be added if necessary.
There are templates provided for `CentOS-7.2.1511` and `CentOS-7.3.1611` with `x86_64` architecture. There is currently no requirement to support older minor release versions or alternative architectures but they could be added if necessary.

## Usage Instructions

Expand All @@ -18,24 +18,30 @@ To build the box file you will need the following installed:

### Build

To build the latest `7.2.1511`, `x86_64` base box run `make` or `make build`.
To build the latest `7.3.1611`, `x86_64` base box run `make` or `make build`.

```
$ make
```

To build the `7.2.1511` release version, use the `BOX_VERSION_RELEASE` environment variable.

```
$ BOX_VERSION_RELEASE=7.2.1511 make
```

#### Box Variants

To build a box variant from an alternative box template use `BOX_VARIANT`. The default is `Minimal` but there is an alternative `Minimal-Cloud-Init` template to build boxes that include Cloud-Init.

```
$ env BOX_VARIANT=Minimal-Cloud-Init make
$ BOX_VARIANT=Minimal-Cloud-Init make
```

### Local install

To install from a box file, generated by a successful build, use `make install` supplied with the same environment variables used to build the require box. This will add the box and output a minimal Vagrantfile template that can be used to create a Vagrantfile in a suitable directory for testing.

```
$ env BOX_VARIANT=Minimal-Cloud-Init make install
$ BOX_VARIANT=Minimal-Cloud-Init make install
```
Loading

0 comments on commit 763fcca

Please sign in to comment.