Skip to content

Commit

Permalink
Merge pull request #1 from dafyddj/ci/github-actions
Browse files Browse the repository at this point in the history
ci: run a build in Github Actions
  • Loading branch information
dafyddj authored Mar 12, 2021
2 parents 230f353 + d808b01 commit 34d4ca0
Show file tree
Hide file tree
Showing 52 changed files with 736 additions and 452 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Packer Build

on:
workflow_dispatch:

jobs:
packer-build:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: Packer Build
run: packer build -only=virtualbox-iso -var-file=tkl150-core.json -var "version=2021.3.23" -except=publish,manifest,shell-local tkl.json
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ tmp
*.swp
Makefile.local
box/
builds/

.DS_Store
.tmpatlas/
.kitchen/
.kitchen.local.yml
46 changes: 46 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
stages:
- validate
- build
- publish

before_script:
- export VER_DATE=$(date +%Y.%-m) && echo $VER_DATE
- packer --version
- VBoxManage --version
- vagrant --version
- kitchen --version
- bundle install

variables:
PACKER_ARGS: -only=virtualbox-iso -var-file=tkl150-core.json tkl.json

validate:
stage: validate
image:
name: hashicorp/packer
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
before_script:
- packer --version
script:
- packer validate -except=upload $PACKER_ARGS

build:
stage: build
except:
- master
tags:
- virtualbox
script:
- packer build -except=publish -var "version=$VER_DATE.$CI_PIPELINE_IID" $PACKER_ARGS

publish:
stage: publish
only:
- master
when: manual
tags:
- virtualbox
script:
- packer build -var "version=$VER_DATE.$CI_PIPELINE_IID" $PACKER_ARGS
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file lists all individuals having contributed content to the repository.
# If you're submitting a patch, please add your name here in alphabetical order as part of the patch.
#
André Lucas <andre@ae-35.com>
Dominic <dev@snowgarden.ch>
Matt Black <github@mafro.net>
Mischa Taylor <mischa@misheska.com>
Expand All @@ -10,3 +11,5 @@ Ross Smith II <ross@smithii.com>
Ronen Narkis <narkisr@gmail.com>
Ruben Barkow <github@r.z11.de>
Sam <sammcj@users.noreply.github.com>
Stephen Reay <stephen.reay@me.com>
Vasyl Vavrychuk <vvavrychuk@gmail.com>
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 2.0.8 (2016-12-04)

* Upgrade Parallels Tools to 12.1.1
* Upgrade VirtualBox guest additions to 5.1.10
## 2.0.7 (2016-09-28)

* Change naming scheme dropping point releases from names
* Upgrade VMware tools to 10.0.10 for VMware Fusion 8.5.0
* Upgrade to Parallels 12 and Parallels Tools 12.0.2

## 2.0.6 (2016-08-28)

* Add Debian 8.5 template
* Add Debian 8.5 desktop template
* Add Debian 7.11 template
* Upgrade VirtualBox guest additions to 5.0.26
* Upgrade VMware tools to 10.0.6
* Upgrade Parallels tools to 11.2.1

## 2.0.5 (2016-01-11)

* Upgrade Parallels tools to 11.1.2
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "kitchen-salt"
71 changes: 71 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
GEM
remote: https://rubygems.org/
specs:
builder (3.2.3)
erubis (2.7.0)
ffi (1.10.0)
gssapi (1.2.0)
ffi (>= 1.0.1)
gyoku (1.3.1)
builder (>= 2.1.2)
hashie (3.6.0)
httpclient (2.8.3)
kitchen-salt (0.5.0)
hashie (>= 3.5)
test-kitchen (~> 1.4)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
mixlib-install (3.11.11)
mixlib-shellout
mixlib-versioning
thor
mixlib-shellout (2.4.4)
mixlib-versioning (1.2.7)
multi_json (1.13.1)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (4.2.0)
net-ssh-gateway (1.3.0)
net-ssh (>= 2.6.5)
nori (2.6.0)
rubyntlm (0.6.2)
rubyzip (1.2.2)
test-kitchen (1.24.0)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
net-ssh (>= 2.9, < 5.0)
net-ssh-gateway (~> 1.2)
thor (~> 0.19)
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
thor (0.20.3)
winrm (2.3.1)
builder (>= 2.1.2)
erubis (~> 2.7)
gssapi (~> 1.2)
gyoku (~> 1.0)
httpclient (~> 2.2, >= 2.2.0.2)
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.1)
winrm-elevated (1.1.1)
winrm (~> 2.0)
winrm-fs (~> 1.0)
winrm-fs (1.3.2)
erubis (~> 2.7)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 1.1)
winrm (~> 2.0)

PLATFORMS
ruby

DEPENDENCIES
kitchen-salt

BUNDLED WITH
1.17.3
44 changes: 27 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
# Possible values for CM: (nocm | chef | chefdk | salt | puppet)
CM ?= nocm
# Possible values for CM_VERSION: (latest | x.y.z | x.y)
CM_VERSION ?=
ifndef CM_VERSION
ifneq ($(CM),nocm)
CM_VERSION = latest
endif
endif
BOX_VERSION ?= $(shell cat VERSION)
ifeq ($(CM),nocm)
BOX_SUFFIX := -$(CM)-$(BOX_VERSION).box
else
BOX_SUFFIX := -$(CM)$(CM_VERSION)-$(BOX_VERSION).box
endif

BOX_SUFFIX := -$(BOX_VERSION).box
BUILDER_TYPES ?= vmware virtualbox parallels
TEMPLATE_FILENAMES := $(filter-out debian.json,$(wildcard *.json))
BOX_NAMES := $(basename $(TEMPLATE_FILENAMES))
Expand All @@ -31,13 +17,30 @@ PARALLELS_TEMPLATE_FILENAMES = $(TEMPLATE_FILENAMES)
PARALLELS_BOX_FILENAMES := $(PARALLELS_TEMPLATE_FILENAMES:.json=$(BOX_SUFFIX))
PARALLELS_BOX_FILES := $(foreach box_filename, $(PARALLELS_BOX_FILENAMES), $(PARALLELS_BOX_DIR)/$(box_filename))
BOX_FILES := $(VMWARE_BOX_FILES) $(VIRTUALBOX_BOX_FILES) $(PARALLELS_BOX_FILES)
ISO_FILES := $(shell sed -nE 's/^.*iso_name.*:\s*"([^"]+\.iso)".*$$/iso\/\1/p' $(TEMPLATE_FILENAMES))

box/vmware/%$(BOX_SUFFIX) box/virtualbox/%$(BOX_SUFFIX) box/parallels/%$(BOX_SUFFIX): %.json
bin/box build $<

.PHONY: all clean assure deliver assure_atlas assure_atlas_vmware assure_atlas_virtualbox assure_atlas_parallels
.PHONY: all clean isos assure deliver assure_atlas assure_atlas_vmware assure_atlas_virtualbox assure_atlas_parallels

all: isos build assure deliver

all: build assure deliver
iso/%.iso:
mkdir -p iso
@cd iso && ( \
CURRENT_URL="http://cdimage.debian.org/debian-cd/$(shell echo "$@" | cut -d- -f2,3 --output-delimiter=/)/jigdo-dvd/$(notdir $(basename $@)).jigdo" ; \
ARCHIVE_URL="http://cdimage.debian.org/mirror/cdimage/archive/$(shell echo "$@" | cut -d- -f2,3 --output-delimiter=/)/jigdo-dvd/$(notdir $(basename $@)).jigdo" ; \
\
if curl -sfI "$$CURRENT_URL" >/dev/null ; then \
URL="$$CURRENT_URL" ; \
else \
URL="$$ARCHIVE_URL" ; \
fi ; \
jigdo-lite --noask "$$URL" ; \
)

isos: $(ISO_FILES)

build: $(BOX_FILES)

Expand Down Expand Up @@ -101,3 +104,10 @@ clean:
find box/$$builder -maxdepth 1 -type f -name "*.box" ! -name .gitignore -exec rm '{}' \; ; \
fi ; \
done
@if [ -L iso ] ; then \
echo "NOT deleting iso (it is a symlink)" ; \
else \
echo rm -rf iso ; \
rm -rf iso ; \
fi ;

Loading

0 comments on commit 34d4ca0

Please sign in to comment.