Skip to content

Commit

Permalink
[Update] PostgreSQL to version 12.3 (#6)
Browse files Browse the repository at this point in the history
* [Update] init script to make cdp4 user a SUPERUSER; fixes #1

* [Add] Corporate Contributor License Agreement version 2.1

* [Add] Individual Contributor License Agreement version 2.1

* [Add] Release script added

* [Update] PostgreSQL to version 12.3

Co-authored-by: samatrhea <[email protected]>
  • Loading branch information
Alex Vorobiev and samatrhea authored Jun 9, 2020
1 parent d5980dd commit 1899c01
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 12 deletions.
Binary file added CLA/Corporate Contributor License Agreement.pdf
Binary file not shown.
Binary file added CLA/Individual Contributor License Agreement.pdf
Binary file not shown.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,33 @@ This is the Git repository of the official `CDP4 Community Edition` docker image

## CDP4 Database - Community Edition

The `CDP4 Database Community Edition` image is based on the official PostgreSQL 9.6.14 image and contains the CDP4 SQL schema required to run the CDP4 Webservices Community Edition.
The `CDP4 Database Community Edition` image is based on the official PostgreSQL 12.3 image and contains the CDP4 SQL schema required to run the CDP4 Webservices Community Edition.

The docker image is available on [docker hub](https://hub.docker.com/r/rheagroup/cdp4-database-community-edition/)

## CDP4 Database Bare - Community Edition
The `CDP4 Database Bare - Community Edition` image is based on the official PostgreSQL 9.6.14 image. It does not contain the CDP4 SQL Schema, only the mininmal setup that is required to execute the [ECSS-E-TM-10-25 Annex C.2 Integration Test suite](https://github.com/RHEAGROUP/ecss-10-25-annexc-integration-tests).

The `CDP4 Database Bare - Community Edition` image is based on the official PostgreSQL 12.3 image. It does not contain the CDP4 SQL Schema, only the minimal setup that is required to execute the [ECSS-E-TM-10-25 Annex C.2 Integration Test suite](https://github.com/RHEAGROUP/ecss-10-25-annexc-integration-tests).

## CDP4 Services Community Edition

The **Dockerfile** of the [CDP4 Services Community Edition](https://github.com/RHEAGROUP/CDP4-WebServices-Community-Edition) is maintained [here](https://github.com/RHEAGROUP/CDP4-WebServices-Community-Edition/blob/master/Dockerfile).

# License
## License

The CDP4 Web Services Community Edition is licensed under the [AGPL license](LICENSE). Each docker container grants additional permission under GNU GPL version 3 section 7. See the license files in the image specific folders.

## Release Script

The repository contains a `release.bat` file intended for pushing new containers to DockerHub.

**NOTE**: In order to push the images to the registry you have to login by running `docker login` command and providing your DockerHub credentials. Owner privileges on the registry are required.

Usage:

```cmd
release.bat [version] [dry]
```

The CDP4 Web Services Community Edition is licensed under the [AGPL license](LICENSE). Each docker container grants additional permission under GNU GPL version 3 section 7. See the license files in the image specific folders.
- **version** (required) - the version tag of the images. Should be in the form `x.y.z`.
- **dry** (optional) - specify the word `dry` to make a dry-run of just building the images without pushing to the registry.
2 changes: 1 addition & 1 deletion cdp4-database-bare-community-edition/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:9.6.14
FROM postgres:12.3
MAINTAINER [email protected]

COPY LICENSE /
Expand Down
8 changes: 2 additions & 6 deletions cdp4-database-bare-community-edition/init-cdp4-cluster.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/bash
psql -U postgres -p 5432 --command="CREATE USER cdp4 WITH PASSWORD 'cdp4';"
psql -U postgres -p 5432 --command="ALTER USER cdp4 WITH SUPERUSER;"
psql -U postgres -p 5432 --command="GRANT pg_signal_backend TO cdp4;"
psql -U postgres -p 5432 --command="CREATE DATABASE cdp4manage WITH OWNER = cdp4 ENCODING 'UTF-8';"
psql -U postgres -p 5432 -d cdp4manage --command="CREATE EXTENSION IF NOT EXISTS hstore;"
psql -U postgres -p 5432 -d cdp4manage --command="CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
psql -U postgres -p 5432 --command="GRANT CONNECT ON DATABASE cdp4manage TO cdp4;"
psql -U postgres -p 5432 --command="GRANT ALL ON DATABASE cdp4manage TO cdp4;"
psql -U postgres -p 5432 --command="ALTER USER cdp4 CREATEDB;"
psql -U postgres -p 5432 --command="ALTER ROLE cdp4 SET statement_timeout = 30000;"
psql -U postgres -p 5432 -d cdp4manage --command="CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
2 changes: 1 addition & 1 deletion cdp4-database-community-edition/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:9.6.14
FROM postgres:12.3
MAINTAINER [email protected]

COPY LICENSE /
Expand Down
82 changes: 82 additions & 0 deletions release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
@echo off

IF %1.==. GOTO VersionError
set version=%1

GOTO Setup

:VersionError
ECHO.
ECHO ERROR: No version was specified
ECHO.

GOTO End

:Setup

ECHO Releasing Version %version%

set dry=false

IF %2.==. GOTO Begin
IF %2==dry GOTO Dry

:Dry

ECHO.
ECHO Performing dry run...
ECHO.

set dry=true

:Begin

ECHO.
ECHO Cleaning up...
ECHO.

REM cleanup previous if exists
docker rmi cdp4-test-database-community-edition:%version%
docker rmi rheagroup/cdp4-test-database-community-edition:%version%

docker rmi cdp4-database-community-edition:%version%
docker rmi rheagroup/cdp4-database-community-edition:%version%

REM remove local latest if exists
docker rmi cdp4-test-database-community-edition:latest
docker rmi rheagroup/cdp4-test-database-community-edition:latest

docker rmi cdp4-database-community-edition:latest
docker rmi rheagroup/cdp4-database-community-edition:latest

ECHO.
ECHO Building images...
ECHO.

REM build and tag
docker build -f cdp4-database-bare-community-edition\Dockerfile -t cdp4-test-database-community-edition:%version% -t cdp4-test-database-community-edition:latest .\cdp4-database-bare-community-edition
docker tag cdp4-test-database-community-edition:%version% rheagroup/cdp4-test-database-community-edition:%version%
docker tag cdp4-test-database-community-edition:latest rheagroup/cdp4-test-database-community-edition:latest

docker build -f cdp4-database-community-edition\Dockerfile -t cdp4-database-community-edition:%version% -t cdp4-database-community-edition:latest .\cdp4-database-community-edition
docker tag cdp4-database-community-edition:%version% rheagroup/cdp4-database-community-edition:%version%
docker tag cdp4-database-community-edition:latest rheagroup/cdp4-database-community-edition:latest

IF %dry% equ true GOTO End

ECHO.
ECHO Pushing...
ECHO.

REM push
docker push rheagroup/cdp4-test-database-community-edition:%version%
docker push rheagroup/cdp4-test-database-community-edition:latest

docker push rheagroup/cdp4-database-community-edition:%version%
docker push rheagroup/cdp4-database-community-edition:latest

:End

ECHO.
ECHO Release %version% Completed
ECHO.

0 comments on commit 1899c01

Please sign in to comment.