File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -28,4 +28,5 @@ RUN apt-get update \
28
28
&& sudo -u postgres createuser -s root
29
29
30
30
COPY /test_protos /app/test_protos
31
- COPY Makefile *.hpp *.cpp *.rb *.sh *.sql *.control *.md /app/
31
+ COPY Makefile *.hpp *.cpp *.rb *.sh *.sql *.control *.md *.txt /app/
32
+ RUN cd /app && make clean && make -j16 dist
Original file line number Diff line number Diff line change @@ -66,16 +66,17 @@ COMPILE.cxx.bc = $(CLANG) -xc++ -Wno-ignored-attributes $(BITCODE_CPPFLAGS) $(CP
66
66
$(COMPILE.cxx.bc ) -o $@ $<
67
67
$(LLVM_BINPATH ) /opt -module-summary -f $@ -o $@
68
68
69
- DIST_DIR = dist/postgres-protobuf-$(EXT_VERSION )
69
+ DIST_TAR_BASENAME = postgres-protobuf-v$(EXT_VERSION ) -for-pg$(MAJORVERSION )
70
+ DIST_DIR = dist/$(DIST_TAR_BASENAME )
70
71
dist : all
71
72
rm -Rf dist
72
73
mkdir -p $(DIST_DIR ) /lib $(DIST_DIR ) /extension $(DIST_DIR ) /lib/bitcode
73
74
cp postgres_protobuf.so $(DIST_DIR ) /lib/
74
75
cp postgres_protobuf.control $(DIST_DIR ) /extension/
75
76
cp postgres_protobuf--* .sql $(DIST_DIR ) /extension/
76
- cp README.md $(DIST_DIR ) /extension/
77
+ cp README.md LICENSE.txt $(DIST_DIR ) /extension/
77
78
cp * .bc $(DIST_DIR ) /lib/bitcode/
78
79
cd $(DIST_DIR ) /lib/bitcode && $(LLVM_BINPATH ) /llvm-lto -thinlto -thinlto-action=thinlink -o postgres_protobuf.index.bc * .bc
79
- tar -C dist -cvzf dist/postgres-protobuf- $( EXT_VERSION ) .tar.gz postgres-protobuf- $( EXT_VERSION )
80
+ tar -C dist -cvzf dist/$( DIST_TAR_BASENAME ) .tar.gz $( DIST_TAR_BASENAME )
80
81
81
82
.PHONY : all clean protoc postgres_protobuf_clean dist
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ POSTGRES_VERSION=${POSTGRES_VERSION:-11}
7
7
8
8
if [[ -n " ${USE_DOCKER:- } " ]]; then
9
9
unset USE_DOCKER
10
- docker build -f Dockerfile.test -- build-arg=POSTGRES_VERSION=" ${POSTGRES_VERSION} " -t postgres-protobuf-test :" ${POSTGRES_VERSION} " .
11
- docker run postgres-protobuf-test :" ${POSTGRES_VERSION} " env __IN_DOCKER=1 /app/build-and-test.sh
10
+ docker build -- build-arg=POSTGRES_VERSION=" ${POSTGRES_VERSION} " -t postgres-protobuf-build :" ${POSTGRES_VERSION} " .
11
+ docker run postgres-protobuf-build :" ${POSTGRES_VERSION} " env NO_CLEAN=1 __IN_DOCKER=1 /app/build-and-test.sh
12
12
exit $?
13
13
fi
14
14
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -euxo pipefail
3
+
4
+ cd " $( dirname " ${0} " ) "
5
+
6
+ POSTGRES_VERSION=${POSTGRES_VERSION:- 11}
7
+
8
+ mkdir -p dist
9
+ docker build --build-arg=POSTGRES_VERSION=" ${POSTGRES_VERSION} " -t postgres-protobuf-build:" ${POSTGRES_VERSION} " .
10
+ docker run -it --rm --volume " $( pwd) /dist:/out" postgres-protobuf-build:" ${POSTGRES_VERSION} " pg_config --version
11
+ docker run -it --rm --volume " $( pwd) /dist:/out" postgres-protobuf-build:" ${POSTGRES_VERSION} " /bin/bash -c ' cp -f /app/dist/*.tar.gz /out/'
You can’t perform that action at this time.
0 commit comments