Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
tekton-postgresql
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f8a89cc6
authored
2022-02-23 15:37:40 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add beginning of upload support to exporting.
1 parent
1cd3bc42
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
scripts/export-dumps.sh
scripts/export-dumps.sh
View file @
f8a89cc
...
...
@@ -7,8 +7,26 @@ chmod 0600 /tmp/pgpass
echo
"*:*:*:*:CHANGEME"
> /tmp/pgpass
export
PGPASSFILE
=
/tmp/pgpass
_pgdump
()
{
pg_dump -w -h
${
POSTGRESQL_HOST
}
-U postgres
"
$1
"
}
ls /workspace
for
database
in
"
$@
"
;
do
pg_dump -w -h
${
POSTGRESQL_HOST
}
-U postgres
"
$database
"
| gzip -9v >
"/workspace/exports/
$database
.gz"
for
item
in
"
$@
"
;
do
target
=
"
${
item
%%
:
*
}
"
remote
=
"
${
item
#*
:
}
"
case
"
$target
"
in
(
*
.sql.gz
)
database
=
"
$(
basename
"
$file
"
.sql.gz
)
"
_pgdump
"
$database
"
| gzip -9v >
"/workspace/exports/
$database
.sql.gz"
;;
(
*
.sql
)
database
=
"
$(
basename
"
$file
"
.sql
)
"
_pgdump
"
$database
"
>
"/workspace/exports/
$database
.sql"
;;
(
*
)
_pgdump
"
$item
"
>
"/workspace/exports/
$item
.sql"
;;
esac
done
...
...
Please
register
or
sign in
to post a comment