-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from riotkit-org/release-1.0.0
Release 1.0.0
- Loading branch information
Showing
20 changed files
with
266 additions
and
485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
ARG POSTGRES_VERSION | ||
ARG GO_VERSION | ||
|
||
# ============================================= | ||
# Build application && embed PostgreSQL in it | ||
# ============================================= | ||
FROM golang:${GO_VERSION} as builder | ||
|
||
ADD . /workspace | ||
RUN apt-get update && apt-get install make -y | ||
|
||
RUN cd /workspace && \ | ||
make build | ||
|
||
|
||
# ============================================================ | ||
# Create target image basing on a specific PostgreSQL version | ||
# ============================================================ | ||
FROM postgres:${POSTGRES_VERSION} | ||
|
||
RUN apt-get update && apt-get install -y gpg | ||
|
||
COPY --from=builder /workspace/.build/pgbr /usr/bin/pgbr | ||
RUN chmod +x /usr/bin/pgbr | ||
|
||
ENTRYPOINT ["/usr/bin/pgbr"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,15 @@ | ||
include test.mk | ||
include ci.mk | ||
|
||
PG_DATA=assets/.build/data | ||
|
||
copy_libs_and_executables: | ||
mkdir -p ${PG_DATA} | ||
cp -p /usr/lib/postgresql/${POSTGRES_VERSION}/bin/psql ${PG_DATA}/psql | ||
cp -p /usr/lib/postgresql/${POSTGRES_VERSION}/bin/pg_dumpall ${PG_DATA}/pg_dumpall | ||
cp -p /usr/lib/postgresql/${POSTGRES_VERSION}/bin/pg_dump ${PG_DATA}/pg_dump | ||
cp -p /usr/lib/postgresql/${POSTGRES_VERSION}/bin/pg_restore ${PG_DATA}/pg_restore | ||
|
||
./hack/get-binary-with-libs.py /usr/lib/postgresql/${POSTGRES_VERSION}/bin/psql ./${PG_DATA} | ||
./hack/get-binary-with-libs.py /usr/lib/postgresql/${POSTGRES_VERSION}/bin/pg_dump ./${PG_DATA} | ||
./hack/get-binary-with-libs.py /usr/lib/postgresql/${POSTGRES_VERSION}/bin/pg_dumpall ./${PG_DATA} | ||
./hack/get-binary-with-libs.py /usr/lib/postgresql/${POSTGRES_VERSION}/bin/pg_restore ./${PG_DATA} | ||
|
||
clean: | ||
rm -rf .build/* | ||
|
||
assets_build: ## Builds PostgreSQL assets using docker | ||
docker build . -f build.Dockerfile --build-arg POSTGRES_VERSION=${POSTGRES_VERSION} --build-arg GO_VERSION=${GO_VERSION} -t build | ||
@docker rm -f builder 2>/dev/null | ||
docker create --name builder build | ||
docker cp builder:/workspace/.build ./ | ||
docker cp builder:/workspace/assets ./ | ||
|
||
build: | ||
CGO_ENABLED=0 GO111MODULE=on go build -tags nomemcopy -o ./.build/pgbr | ||
chmod +x ./.build/pgbr | ||
|
||
test: | ||
export PGBR_USE_CONTAINER=true; \ | ||
export PGBR_CONTAINER_IMAGE=bitnami/postgresql; \ | ||
export POSTGRES_VERSION=${POSTGRES_VERSION}; \ | ||
go test -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.