forked from hypriot/image-builder-odroid-c2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (30 loc) · 1.97 KB
/
Makefile
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
default: build
build:
docker build -t image-builder-odroid-c2 .
sd-image: build
docker run --rm --privileged -v $(shell pwd):/workspace -v /boot:/boot -v /lib/modules:/lib/modules -e VERSION image-builder-odroid-c2
shell: build
docker run -ti --privileged -v $(shell pwd):/workspace -v /boot:/boot -v /lib/modules:/lib/modules -e VERSION image-builder-odroid-c2 bash
testshell: build
docker run -ti --privileged -v $(shell pwd)/builder:/builder -v $(shell pwd):/workspace -v /boot:/boot -v /lib/modules:/lib/modules image-builder-odroid-c2 bash
test:
VERSION=dirty docker run --rm -ti --privileged -v $(shell pwd):/workspace -v /boot:/boot -v /lib/modules:/lib/modules -e VERSION image-builder-odroid-c2 bash -c "unzip /workspace/hypriotos-odroid-c2-dirty.img.zip && rspec --format documentation --color /workspace/builder/test/*_spec.rb"
shellcheck: build
VERSION=dirty docker run --rm -ti -v $(shell pwd):/workspace image-builder-odroid-c2 bash -c 'shellcheck /workspace/builder/*.sh /workspace/builder/files/etc/firstboot.d/*'
vagrant:
vagrant up
docker-machine: vagrant
docker-machine create -d generic \
--generic-ssh-user $(shell vagrant ssh-config | grep ' User ' | cut -d ' ' -f 4) \
--generic-ssh-key $(shell vagrant ssh-config | grep IdentityFile | cut -d ' ' -f 4) \
--generic-ip-address $(shell vagrant ssh-config | grep HostName | cut -d ' ' -f 4) \
--generic-ssh-port $(shell vagrant ssh-config | grep Port | cut -d ' ' -f 4) \
image-builder-odroid-c2
test-integration: test-integration-image test-integration-docker
test-integration-image:
docker run --rm -ti -v $(shell pwd)/builder/test-integration:/serverspec:ro -e BOARD uzyexe/serverspec:2.24.3 bash -c "rspec --format documentation --color spec/hypriotos-image"
test-integration-docker:
docker run --rm -ti -v $(shell pwd)/builder/test-integration:/serverspec:ro -e BOARD uzyexe/serverspec:2.24.3 bash -c "rspec --format documentation --color spec/hypriotos-docker"
tag:
git tag ${TAG}
git push origin ${TAG}