Skip to content

Commit e252b62

Browse files
committed
add 11.7 support and improve scripts
1 parent f85b937 commit e252b62

9 files changed

Lines changed: 43 additions & 23 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ branches:
2929
- master
3030

3131
script:
32-
- ./lint.sh --sh
32+
- ./dev/util/shellcheck.sh

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG alpine_version
22
FROM alpine:${alpine_version}
33

44
ARG alpine_version
5-
ARG pg_package_version
5+
ARG pg_full_version
66

77
#--------------------------------------------------------------------------------
88
# Install dependencies
@@ -12,7 +12,7 @@ ARG pg_package_version
1212
#--------------------------------------------------------------------------------
1313
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v${alpine_version}/main" >> /etc/apk/repositories
1414

15-
RUN apk --no-cache --update add dumb-init postgresql=${pg_package_version} py-pip && \
15+
RUN apk --no-cache --update add dumb-init postgresql=${pg_full_version} py-pip && \
1616
pip install awscli && \
1717
apk --purge -v del py-pip
1818

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
Cron based download from s3 and database restore.
44

5+
## Build
6+
7+
`./build_push.sh [-p <FILE>, --package <FILE>]`
8+
9+
`./build_push.sh -p 11.7-3.8`
10+
11+
### Package files
12+
13+
Each package file represents a release for a particular `postgres` branch.
14+
15+
The contents of the latest package file may look like this:
16+
17+
```
18+
ALPINE_VERSION='3.8'
19+
PG_BASE_VERSION='11'
20+
PG_FULL_VERSION='11.7'
21+
PG_LATEST=true
22+
```
23+
524
## Usage
625

726
Typically this image is instantiated as a container among many others and would have the responsibility of getting downloading a dump file from s3 and restoring a database at a particular time of day.

dev/shellcheck.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env sh
2+
3+
printf '\n%s\n' "Checking shell scripts..."
4+
5+
SHELLCHECK_OPTS=""
6+
7+
RUN_SHELLCHECK="shellcheck ${ALLOW_EXTERNAL_SOURCE:-} ${SHELLCHECK_OPTS} {} +"
8+
eval "find ./*.sh -type f -exec ${RUN_SHELLCHECK}"

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ version: '3'
1111

1212
services:
1313
postgres-restore-from-s3:
14-
image: postgres-restore-from-s3:10.10
14+
image: postgres-restore-from-s3:11.7
1515
network_mode: 'host'
1616
build:
1717
context: ./
1818
dockerfile: ./Dockerfile
1919
args:
20-
pg_alpine_branch: '3.8'
21-
pg_version: '10.10-r0'
20+
alpine_version: '3.9'
21+
pg_full_version: '11.7-r0'
2222
environment:
2323
AWS_BUCKET: <AWS_BUCKET_NAME>
2424
AWS_REGION: <AWS_REGION_NAME>

lint.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

package/10.12-3.8.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALPINE_VERSION='3.8'
2+
PG_BASE_VERSION='10'
3+
PG_FULL_VERSION='10.12'

package/11.7-3.9.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ALPINE_VERSION='3.9'
2+
PG_LATEST=false
3+
PG_BASE_VERSION='11'
4+
PG_FULL_VERSION='11.7'

package/9.6.13-3.6.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALPINE_VERSION='3.6'
2+
PG_BASE_VERSION='9'
3+
PG_FULL_VERSION='9.6.13'

0 commit comments

Comments
 (0)