Skip to content

Commit 36aeff0

Browse files
committed
feat: fix makefile
1 parent b40d833 commit 36aeff0

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-13
lines changed

Makefile

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $(error VERSION is not set)
33
endif
44

55
ifeq ($(TARGET), GHCR)
6-
NAME=ghcr.io/camptocamp/odoo-project
6+
NAME=ghcr.io/camptocamp/docker-odoo-project
77
else
88
NAME=camptocamp/odoo-project
99
endif
@@ -16,6 +16,9 @@ export
1616

1717
all: build
1818

19+
.PHONY: setup
20+
setup:
21+
bash setup.sh
1922

2023
.PHONY: build
2124
build:
@@ -25,33 +28,24 @@ build:
2528
.PHONY: tag
2629
tag:
2730
docker tag $(BUILD_TAG) $(IMAGE)-$(TAG)
28-
docker tag $(BUILD_TAG)-onbuild $(IMAGE)-$(TAG)-onbuild
29-
docker tag $(BUILD_TAG)-batteries $(IMAGE)-$(TAG)-batteries
30-
docker tag $(BUILD_TAG)-batteries-onbuild $(IMAGE)-$(TAG)-batteries-onbuild
31+
3132

3233

3334
.PHONY: push
3435
push:
3536
docker push $(IMAGE)-$(TAG)
36-
docker push $(IMAGE)-$(TAG)-onbuild
37-
docker push $(IMAGE)-$(TAG)-batteries
38-
docker push $(IMAGE)-$(TAG)-batteries-onbuild
3937

4038

4139
.PHONY: tag_latest_main
4240
tag_latest_main:
4341
docker tag $(BUILD_TAG) $(NAME):latest
44-
docker tag $(BUILD_TAG)-onbuild $(NAME):latest-onbuild
45-
docker tag $(BUILD_TAG)-batteries $(NAME):latest-batteries
46-
docker tag $(BUILD_TAG)-batteries-onbuild $(NAME):latest-batteries-onbuild
42+
4743

4844

4945
.PHONY: push_latest_main
5046
push_latest_main:
5147
docker push $(NAME):latest
52-
docker push $(NAME):latest-onbuild
53-
docker push $(NAME):latest-batteries
54-
docker push $(NAME):latest-batteries-onbuild
48+
5549

5650

5751
.PHONY: test

setup.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
set -euxo pipefail
3+
4+
#
5+
# Build the image
6+
#
7+
# Normally run by the Makefile:
8+
#
9+
# $ make VERSION=$VERSION build
10+
#
11+
# It expects the following variables to be set:
12+
#
13+
# * VERSION (9.0, 10.0, 11.0, ...)
14+
# * BUILD_TAG (tag of the 'latest' image built)
15+
#
16+
if [ -z "$VERSION" ]; then
17+
echo "VERSION environment variable is missing"
18+
exit 1
19+
fi
20+
21+
SRC=${SRC:=(mktemp -d)}
22+
echo "Creating $SRC"
23+
24+
cp -r ${VERSION}/. $SRC/
25+
cp -r bin/ $SRC
26+
cp -rT common/ $SRC
27+
cp -r install/ $SRC
28+
cp -r start-entrypoint.d/ $SRC
29+
cp -r before-migrate-entrypoint.d/ $SRC

0 commit comments

Comments
 (0)