Compare commits

...
7 Commits
7 ... 11
Author SHA1 Message Date
Brad Koehn a554117ba1 upgraded to 11.2 2019-03-04 14:49:41 -06:00
Brad Koehn a08e138569 added gnupg 2019-02-20 13:25:38 -06:00
Brad Koehn 18b0d9b0ee Merge branch 'master' of ssh://gitlab.koehn.com:2201/docker/postgres-wal-g 2019-02-20 12:25:19 -06:00
Brad Koehn 5b59617f84 upgraded wal-g to fix some bugs 2019-02-20 11:33:36 -06:00
Brad Koehn c3425c6064 use PGDATA in post-recovery.sh too 2019-02-19 14:39:48 -06:00
Brad Koehn bc070c6dae better handling of PGDATA 2019-02-19 14:24:34 -06:00
Brad Koehn e14aa1d059 parallel build jobs 2019-02-19 13:35:21 -06:00
5 changed files with 38 additions and 16 deletions

No files matched your search

+15 -2
View File
@@ -1,12 +1,25 @@
build:
stages:
- build
build-9.6:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"index.docker.io\":{\"username\":\"$DOCKER_LOGIN\",\"password\":\"$DOCKER_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination koehn/postgres-wal-g:11.1-$CI_COMMIT_TAG --build-arg BASE=11.1
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination koehn/postgres-wal-g:9.6-$CI_COMMIT_TAG --build-arg BASE=9.6
only:
- tags
build-11.2:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"index.docker.io\":{\"username\":\"$DOCKER_LOGIN\",\"password\":\"$DOCKER_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination koehn/postgres-wal-g:11.2-$CI_COMMIT_TAG --build-arg BASE=11.2
only:
- tags
+2 -2
View File
@@ -4,7 +4,7 @@ FROM postgres:$BASE
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update -qq && \
apt-get install -qqy curl ca-certificates vim && \
cd /usr/local/bin && curl -L https://github.com/wal-g/wal-g/releases/download/v0.2.2/wal-g.linux-amd64.tar.gz | tar xzf -
apt-get install -qqy ca-certificates curl gnupg vim && \
cd /usr/local/bin && curl -L https://github.com/wal-g/wal-g/releases/download/v0.2.5/wal-g.linux-amd64.tar.gz | tar xzf -
COPY wal-g /wal-g
+5 -1
View File
@@ -1,3 +1,7 @@
#!/bin/bash
wal-g backup-push /var/lib/postgresql/data/pgsql
if [ -z ${PGDATA+x} ]; then
export PGDATA=/var/lib/postgresql/data/pgsql
fi
wal-g backup-push "$PGDATA"
+7 -4
View File
@@ -2,12 +2,15 @@
set -e
export DATA=/var/lib/postgresql/data/pgsql
if [ -z ${PGDATA+x} ]; then
export PGDATA=/var/lib/postgresql/data/pgsql
fi
export PG_VERSION=$(ls /usr/lib/postgresql/)
# disable recovery mode, re-enable remote connections and archive mode
mv $DATA/pg_hba.conf.orig $DATA/pg_hba.conf
sed -i -e 's/^archive_mode = off/archive_mode = on/' $DATA/postgresql.conf
mv $PGDATA/pg_hba.conf.orig $PGDATA/pg_hba.conf
sed -i -e 's/^archive_mode = off/archive_mode = on/' $PGDATA/postgresql.conf
cat <<EOF
******************
@@ -17,5 +20,5 @@ cat <<EOF
******************
EOF
bash -c "sleep 3 && /usr/lib/postgresql/$PG_VERSION/bin/pg_ctl stop -D $DATA" &
bash -c "sleep 3 && /usr/lib/postgresql/$PG_VERSION/bin/pg_ctl stop -D $PGDATA" &
+9 -7
View File
@@ -7,17 +7,19 @@ fi
set -e
DATA=/var/lib/postgresql/data/pgsql
if [ -z ${PGDATA+x} ]; then
export PGDATA=/var/lib/postgresql/data/pgsql
fi
# fetch most recent full backup
wal-g backup-fetch $DATA LATEST
wal-g backup-fetch $PGDATA LATEST
# enable recovery mode, disable remote connections and archive mode
cp /wal-g/recovery.conf $DATA/
mv $DATA/pg_hba.conf $DATA/pg_hba.conf.orig
cp /wal-g/pg_hba.conf $DATA/pg_hba.conf
sed -i -e 's/^archive_mode = on/archive_mode = off/' $DATA/postgresql.conf
cp /wal-g/recovery.conf $PGDATA/
mv $PGDATA/pg_hba.conf $PGDATA/pg_hba.conf.orig
cp /wal-g/pg_hba.conf $PGDATA/pg_hba.conf
sed -i -e 's/^archive_mode = on/archive_mode = off/' $PGDATA/postgresql.conf
PG_VERSION=$(ls /usr/lib/postgresql/)
/usr/lib/postgresql/$PG_VERSION/bin/pg_ctl start -D $DATA
/usr/lib/postgresql/$PG_VERSION/bin/pg_ctl start -D $PGDATA