File tree Expand file tree Collapse file tree 18 files changed +246
-215
lines changed
Expand file tree Collapse file tree 18 files changed +246
-215
lines changed Original file line number Diff line number Diff line change 1717set -e
1818
1919echo " Running as Primary"
20-
20+ BOOTSTRAP= " false "
2121# set password ENV
2222export PGPASSWORD=${POSTGRES_PASSWORD:- postgres}
2323
@@ -29,7 +29,8 @@ if [ ! -e "$PGDATA/PG_VERSION" ]; then
2929 rm -rf " $PGDATA " /*
3030 chmod 0700 " $PGDATA "
3131 /scripts/initdb.sh
32+ BOOTSTRAP=" true"
3233
3334fi
34- /run_scripts/role/start.sh
35+ /run_scripts/role/start.sh $BOOTSTRAP
3536exec postgres
Original file line number Diff line number Diff line change 1313# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414# See the License for the specific language governing permissions and
1515# limitations under the License.
16-
16+ BOOTSTRAP= ${1}
1717# setup postgresql.conf
1818touch /tmp/postgresql.conf
1919echo " wal_level = replica" >> /tmp/postgresql.conf
8383psql+=(--username " $POSTGRES_USER " --dbname " $POSTGRES_DB " )
8484echo
8585
86- # initialize database
87- for f in " $INITDB " /* ; do
88- case " $f " in
89- * .sh)
90- echo " $0 : running $f "
91- . " $f "
92- ;;
93- * .sql)
94- echo " $0 : running $f "
95- " ${psql[@]} " -f " $f "
96- echo
97- ;;
98- * .sql.gz)
99- echo " $0 : running $f "
100- gunzip -c " $f " | " ${psql[@]} "
101- echo
102- ;;
103- * ) echo " $0 : ignoring $f " ;;
104- esac
105- echo
106- done
86+ if [[ " $BOOTSTRAP " == " true" ]]; then
87+ # initialize database
88+ for f in " $INITDB " /* ; do
89+ case " $f " in
90+ * .sh)
91+ echo " $0 : running $f "
92+ . " $f "
93+ ;;
94+ * .sql)
95+ echo " $0 : running $f "
96+ " ${psql[@]} " -f " $f "
97+ echo
98+ ;;
99+ * .sql.gz)
100+ echo " $0 : running $f "
101+ gunzip -c " $f " | " ${psql[@]} "
102+ echo
103+ ;;
104+ * ) echo " $0 : ignoring $f " ;;
105+ esac
106+ echo
107+ done
108+ fi
107109
108110# stop server
109111pg_ctl -D " $PGDATA " -m fast -w stop
Original file line number Diff line number Diff line change 1717set -e
1818
1919echo " Running as Primary"
20-
20+ BOOTSTRAP= " false "
2121# set password ENV
2222export PGPASSWORD=${POSTGRES_PASSWORD:- postgres}
2323
@@ -29,7 +29,8 @@ if [ ! -e "$PGDATA/PG_VERSION" ]; then
2929 rm -rf " $PGDATA " /*
3030 chmod 0700 " $PGDATA "
3131 /scripts/initdb.sh
32+ BOOTSTRAP=" true"
3233
3334fi
34- /run_scripts/role/start.sh
35+ /run_scripts/role/start.sh $BOOTSTRAP
3536exec postgres
Original file line number Diff line number Diff line change 1313# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414# See the License for the specific language governing permissions and
1515# limitations under the License.
16-
16+ BOOTSTRAP= ${1}
1717# setup postgresql.conf
1818touch /tmp/postgresql.conf
1919echo " wal_level = replica" >> /tmp/postgresql.conf
9292psql+=(--username " $POSTGRES_USER " --dbname " $POSTGRES_DB " )
9393echo
9494
95- # initialize database
96- for f in " $INITDB " /* ; do
97- case " $f " in
98- * .sh)
99- echo " $0 : running $f "
100- . " $f "
101- ;;
102- * .sql)
103- echo " $0 : running $f "
104- " ${psql[@]} " -f " $f "
105- echo
106- ;;
107- * .sql.gz)
108- echo " $0 : running $f "
109- gunzip -c " $f " | " ${psql[@]} "
110- echo
111- ;;
112- * ) echo " $0 : ignoring $f " ;;
113- esac
114- echo
115- done
95+ if [[ " $BOOTSTRAP " == " true" ]]; then
96+ # initialize database
97+ for f in " $INITDB " /* ; do
98+ case " $f " in
99+ * .sh)
100+ echo " $0 : running $f "
101+ . " $f "
102+ ;;
103+ * .sql)
104+ echo " $0 : running $f "
105+ " ${psql[@]} " -f " $f "
106+ echo
107+ ;;
108+ * .sql.gz)
109+ echo " $0 : running $f "
110+ gunzip -c " $f " | " ${psql[@]} "
111+ echo
112+ ;;
113+ * ) echo " $0 : ignoring $f " ;;
114+ esac
115+ echo
116+ done
117+ fi
116118
117119# stop server
118120pg_ctl -D " $PGDATA " -m fast -w stop
Original file line number Diff line number Diff line change 1717set -e
1818
1919echo " Running as Primary"
20-
20+ BOOTSTRAP= " false "
2121# set password ENV
2222export PGPASSWORD=${POSTGRES_PASSWORD:- postgres}
2323
@@ -29,7 +29,8 @@ if [ ! -e "$PGDATA/PG_VERSION" ]; then
2929 rm -rf " $PGDATA " /*
3030 chmod 0700 " $PGDATA "
3131 /scripts/initdb.sh
32+ BOOTSTRAP=" true"
3233
3334fi
34- /run_scripts/role/start.sh
35+ /run_scripts/role/start.sh $BOOTSTRAP
3536exec postgres
Original file line number Diff line number Diff line change 1313# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414# See the License for the specific language governing permissions and
1515# limitations under the License.
16-
16+ BOOTSTRAP= ${1}
1717# setup postgresql.conf
1818touch /tmp/postgresql.conf
1919echo " wal_level = replica" >> /tmp/postgresql.conf
@@ -108,27 +108,29 @@ echo
108108psql+=(--username " $POSTGRES_USER " --dbname " $POSTGRES_DB " )
109109echo
110110
111- # initialize database
112- for f in " $INITDB " /* ; do
113- case " $f " in
114- * .sh)
115- echo " $0 : running $f "
116- . " $f "
117- ;;
118- * .sql)
119- echo " $0 : running $f "
120- " ${psql[@]} " -f " $f "
121- echo
122- ;;
123- * .sql.gz)
124- echo " $0 : running $f "
125- gunzip -c " $f " | " ${psql[@]} "
126- echo
127- ;;
128- * ) echo " $0 : ignoring $f " ;;
129- esac
130- echo
131- done
111+ if [[ " $BOOTSTRAP " == " true" ]]; then
112+ # initialize database
113+ for f in " $INITDB " /* ; do
114+ case " $f " in
115+ * .sh)
116+ echo " $0 : running $f "
117+ . " $f "
118+ ;;
119+ * .sql)
120+ echo " $0 : running $f "
121+ " ${psql[@]} " -f " $f "
122+ echo
123+ ;;
124+ * .sql.gz)
125+ echo " $0 : running $f "
126+ gunzip -c " $f " | " ${psql[@]} "
127+ echo
128+ ;;
129+ * ) echo " $0 : ignoring $f " ;;
130+ esac
131+ echo
132+ done
133+ fi
132134
133135# stop server
134136pg_ctl -D " $PGDATA " -m fast -w stop
Original file line number Diff line number Diff line change 1717set -e
1818
1919echo " Running as Primary"
20-
20+ BOOTSTRAP= " false "
2121# set password ENV
2222export PGPASSWORD=${POSTGRES_PASSWORD:- postgres}
2323
@@ -29,7 +29,8 @@ if [ ! -e "$PGDATA/PG_VERSION" ]; then
2929 rm -rf " $PGDATA " /*
3030 chmod 0700 " $PGDATA "
3131 /scripts/initdb.sh
32+ BOOTSTRAP=" true"
3233
3334fi
34- /run_scripts/role/start.sh
35+ /run_scripts/role/start.sh $BOOTSTRAP
3536exec postgres
Original file line number Diff line number Diff line change 1313# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414# See the License for the specific language governing permissions and
1515# limitations under the License.
16-
16+ BOOTSTRAP= ${1}
1717# setup postgresql.conf
1818touch /tmp/postgresql.conf
1919echo " wal_level = replica" >> /tmp/postgresql.conf
@@ -109,27 +109,29 @@ echo
109109psql+=(--username " $POSTGRES_USER " --dbname " $POSTGRES_DB " )
110110echo
111111
112- # initialize database
113- for f in " $INITDB " /* ; do
114- case " $f " in
115- * .sh)
116- echo " $0 : running $f "
117- . " $f "
118- ;;
119- * .sql)
120- echo " $0 : running $f "
121- " ${psql[@]} " -f " $f "
122- echo
123- ;;
124- * .sql.gz)
125- echo " $0 : running $f "
126- gunzip -c " $f " | " ${psql[@]} "
127- echo
128- ;;
129- * ) echo " $0 : ignoring $f " ;;
130- esac
131- echo
132- done
112+ if [[ " $BOOTSTRAP " == " true" ]]; then
113+ # initialize database
114+ for f in " $INITDB " /* ; do
115+ case " $f " in
116+ * .sh)
117+ echo " $0 : running $f "
118+ . " $f "
119+ ;;
120+ * .sql)
121+ echo " $0 : running $f "
122+ " ${psql[@]} " -f " $f "
123+ echo
124+ ;;
125+ * .sql.gz)
126+ echo " $0 : running $f "
127+ gunzip -c " $f " | " ${psql[@]} "
128+ echo
129+ ;;
130+ * ) echo " $0 : ignoring $f " ;;
131+ esac
132+ echo
133+ done
134+ fi
133135
134136# stop server
135137pg_ctl -D " $PGDATA " -m fast -w stop
Original file line number Diff line number Diff line change 1717set -e
1818
1919echo " Running as Primary"
20-
20+ BOOTSTRAP= " false "
2121# set password ENV
2222export PGPASSWORD=${POSTGRES_PASSWORD:- postgres}
2323
@@ -29,7 +29,8 @@ if [ ! -e "$PGDATA/PG_VERSION" ]; then
2929 rm -rf " $PGDATA " /*
3030 chmod 0700 " $PGDATA "
3131 /scripts/initdb.sh
32+ BOOTSTRAP=" true"
3233
3334fi
34- /run_scripts/role/start.sh
35+ /run_scripts/role/start.sh $BOOTSTRAP
3536exec postgres
Original file line number Diff line number Diff line change 1313# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414# See the License for the specific language governing permissions and
1515# limitations under the License.
16-
16+ BOOTSTRAP= ${1}
1717# setup postgresql.conf
1818touch /tmp/postgresql.conf
1919echo " wal_level = replica" >> /tmp/postgresql.conf
@@ -115,27 +115,29 @@ echo
115115psql+=(--username " $POSTGRES_USER " --dbname " $POSTGRES_DB " )
116116echo
117117
118- # initialize database
119- for f in " $INITDB " /* ; do
120- case " $f " in
121- * .sh)
122- echo " $0 : running $f "
123- . " $f "
124- ;;
125- * .sql)
126- echo " $0 : running $f "
127- " ${psql[@]} " -f " $f "
128- echo
129- ;;
130- * .sql.gz)
131- echo " $0 : running $f "
132- gunzip -c " $f " | " ${psql[@]} "
133- echo
134- ;;
135- * ) echo " $0 : ignoring $f " ;;
136- esac
137- echo
138- done
118+ if [[ " $BOOTSTRAP " == " true" ]]; then
119+ # initialize database
120+ for f in " $INITDB " /* ; do
121+ case " $f " in
122+ * .sh)
123+ echo " $0 : running $f "
124+ . " $f "
125+ ;;
126+ * .sql)
127+ echo " $0 : running $f "
128+ " ${psql[@]} " -f " $f "
129+ echo
130+ ;;
131+ * .sql.gz)
132+ echo " $0 : running $f "
133+ gunzip -c " $f " | " ${psql[@]} "
134+ echo
135+ ;;
136+ * ) echo " $0 : ignoring $f " ;;
137+ esac
138+ echo
139+ done
140+ fi
139141
140142# stop server
141143pg_ctl -D " $PGDATA " -m fast -w stop
You can’t perform that action at this time.
0 commit comments