-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
57 lines (56 loc) · 1.58 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
inputs:
DBMS:
required: true
default: "mysql"
CLUSTER:
required: true
SECRETS_JSON:
required: true
ACTION:
required: true
default: "create"
description: "create, delete, import or export"
PREFIX_NAME:
required: true
DB_USER:
required: true
DB_NAME:
required: true
DUMP_FILENAME:
required: true
# without sql.gz extension
default: "latest"
DUMP_SUBSTITUTIONS:
required: true
default: "[]"
description: "json array of search/replacement to apply before inserting dump (or inverted during dump). This must not contains # (used as sed delimiter)"
runs:
using: "composite"
steps:
## For debug only
#- shell: bash
# run: |
# base64 <<EOF
# ${{ toJSON(inputs) }}
# EOF
#- shell: bash
# run: |
# env | sort
- shell: bash
# a checkout action of `coopTilleuls/action-database` must be set with `path: 'action-database'`
run: |
set -e
cd action-database
test -f cloud_sql_proxy || wget -nv https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy
test -x cloud_sql_proxy || chmod +x cloud_sql_proxy
bash script.sh
env:
SECRETS_JSON: ${{ inputs.SECRETS_JSON }}
DBMS: ${{ inputs.DBMS }}
ACTION: ${{ inputs.ACTION }}
CLUSTER: ${{ inputs.CLUSTER }}
PREFIX_NAME: ${{ inputs.PREFIX_NAME }}
DB_USER: ${{ inputs.DB_USER }}
DB_NAME: ${{ inputs.DB_NAME }}
DUMP_FILENAME: ${{ inputs.DUMP_FILENAME }}
DUMP_SUBSTITUTIONS: ${{ inputs.DUMP_SUBSTITUTIONS }}