-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
82 lines (70 loc) · 2.49 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
ARCH= amd64
DOCKER_TAG= nginx
ACI_VERSION= 1.15.10
build: stage
stage:
mkdir -p stage.tmp
cp deps/build.sh stage.tmp
cp deps/Dockerfile.stage0 stage.tmp/Dockerfile
cd stage.tmp && ./build.sh
mkdir -p bin
mv stage.tmp/nginx bin/
@echo "--------------------------------"
@echo " nginx binary moved to bin/"
@echo "--------------------------------"
aci:
@test -s bin/nginx || { echo "bin/nginx does not exist. Build nginx before continuing."; exit 1; }
mkdir -p nginx-layout/rootfs/
cp deps/manifest.json nginx-layout/manifest
sed -i "s/<ACI_VERSION>/$(ACI_VERSION)/g" nginx-layout/manifest
tar -xzf deps/rootfs.tar.gz -C nginx-layout/rootfs/
cp bin/nginx nginx-layout/rootfs/bin/
actool build nginx-layout nginx.aci
@echo "---------------------------------------------"
@echo " aci built, see readme for config settings"
@echo "---------------------------------------------"
travisaci:
wget https://github.com/appc/spec/releases/download/v0.8.7/appc-v0.8.7.tar.gz
tar -zxf appc-v0.8.7.tar.gz
mkdir -p nginx-layout/rootfs/
cp deps/manifest.json nginx-layout/manifest
sed -i "s/<ACI_VERSION>/$(ACI_VERSION)/g" nginx-layout/manifest
tar -xzf deps/rootfs.tar.gz -C nginx-layout/rootfs/
cp bin/nginx nginx-layout/rootfs/bin/
appc-v0.8.7/actool build nginx-layout nginx-$(ACI_VERSION)-linux-$(ARCH).aci
@echo "---------------------------------------------"
@echo " aci built, see readme for config settings"
@echo "---------------------------------------------"
#gpgsign:
# mv nginx.aci nginx-$(ACI_VERSION)-linux-$(ARCH).aci
# mv deps/sign.sh .
# chmod +x sign.sh
# ./sign.sh nginx-$(ACI_VERSION)-linux-$(ARCH) $(GPG_SEC)
importaci:
sudo rkt fetch nginx.aci --insecure-options=image
docker:
@test -s bin/nginx || { echo "bin/nginx does not exist. Build nginx before continuing."; exit 1; }
rm -rf stage.tmp/
mkdir -p stage.tmp/
cp deps/Dockerfile.stage1 stage.tmp/Dockerfile
cp deps/rootfs.tar.gz stage.tmp/
cp bin/nginx stage.tmp/
cd stage.tmp && sudo docker build --no-cache -t $(DOCKER_TAG):$(ACI_VERSION) .
@echo "----------------------------------------------"
@echo " image: '$(DOCKER_TAG)' built"
@echo "----------------------------------------------"
travispushdocker:
docker tag $(DOCKER_TAG):$(ACI_VERSION) unixvoid/$(DOCKER_TAG):$(ACI_VERSION)
docker push unixvoid/$(DOCKER_TAG):$(ACI_VERSION)
rundocker:
cd deps/test/ && \
./testdocker.sh
runrkt:
cd deps/test/ && \
./testrkt.sh
clean:
rm -rf nginx-layout/
rm -rf stage.tmp/
rm -f nginx.aci
clean-all: clean
rm -rf bin/