3535# [[input-pass]INPUT_PASS] Set the mysql password
3636# The default value is env INPUT_PASS
3737# Format: String
38- # [[input-tabl]INPUT_TABL] Set the mysql table, eg: db.tbl
38+ # [[input-tabl]INPUT_TABL] Set the mysql db+ table, eg: db.tbl
3939# The default value is env INPUT_TABL
4040# Format: String
4141# [[input-debug]INPUT_DEBUG] Toggle the debug mode
4242# The default value is env INPUT_DEBUG
4343# or false
4444# Format: Boolean/Integer
45+ # [[input-timeo]INPUT_TIMEO] Set the max timeout for PDO
46+ # The default value is env INPUT_TIMEO
47+ # or 5
48+ # Format: Integer
4549#
4650# EXAMPLES
4751# ./db-processor "column1=value1;column2=value2" ...
4852#
4953#================================================================
5054#- IMPLEMENTATION
51- #- version 1 .0.0
55+ #- version 3 .0.0
5256#- author Steven Agyekum <s-8@posteo.mx>
5357#- copyright Copyright (c) Limelight Gaming Ltd.
5458#- license MIT License
@@ -64,48 +68,31 @@ We use this product in our CD workflows for tracking some commit messages.
6468
6569## Usage
6670
67- ### Standalone
68-
69- Requirements:
70-
71- - MySQL client
72- - PHP 7 with PDO extension enabled
73-
74- Permissions:
71+ Use it as standalone, docker container, or GH action:
7572
76- `` chmod +x ./db-processor ``
77-
78- Execution:
79-
80- ```
81- ./db-processor <args>
82- ```
73+ ### Docker
8374
84- or
75+ Build the container using the Dockerfile
8576
77+ ``` bash
78+ docker build -t db-processor .
8679```
87- ./db-processor
88- ```
8980
90- when using environment variables.
81+ and run:
9182
92- ### Docker
93-
94- Build the container using the Dockerfile and run:
95-
96- ```
97- docker run -e INPUT_MAPS="" -e INPUT_HOST="" -e INPUT_PORT="" -e INPUT_USER="" -e INPUT_PASS="" -e INPUT_TABL="" -e INPUT_DEBUG=true
83+ ``` bash
84+ docker run --rm -e INPUT_MAPS=" " -e INPUT_HOST=" " -e INPUT_PORT=" 3306" -e INPUT_USER=" " -e INPUT_PASS=" " -e INPUT_TABL=" " -e INPUT_DEBUG=true db-processor
9885```
9986
10087### Github Actions
10188
10289You can run this action by using the `` with: `` block
10390
104- ```
91+ ``` bash
10592 steps:
106- - uses: actions/checkout@v2
93+ - uses: actions/checkout@v6
10794 - name: Insert to database
108- uses: limelight-development/db-processor@2 .0
95+ uses: limelight-development/db-processor@3 .0
10996 with:
11097 maps: column1=value1; column2=value2;
11198 host: ${{ secrets.MYSQL_HOST } }
@@ -118,11 +105,11 @@ You can run this action by using the ``with:`` block
118105
119106or by using the `` env: `` block for environment variables
120107
121- ```
108+ ``` bash
122109 steps:
123- - uses: actions/checkout@v2
110+ - uses: actions/checkout@v6
124111 - name: Insert to database
125- uses: limelight-development/db-processor@2 .0
112+ uses: limelight-development/db-processor@3 .0
126113 env:
127114 INPUT_MAPS: column1=value1; column2=value2;
128115 INPUT_HOST: ${{ secrets.MYSQL_HOST } }
@@ -133,9 +120,9 @@ or by using the ``env:`` block for environment variables
133120 INPUT_DEBUG: true
134121```
135122
136- ** Full example:**
123+ ** Full action example:**
137124
138- ```
125+ ``` bash
139126name: CI
140127
141128on: [push]
@@ -146,9 +133,9 @@ jobs:
146133 runs-on: ubuntu-latest
147134
148135 steps:
149- - uses: actions/checkout@v2
136+ - uses: actions/checkout@v6
150137 - name: Insert to database
151- uses: limelight-development/db-processor@2 .0
138+ uses: limelight-development/db-processor@3 .0
152139 with:
153140 maps: column1=value1; column2=value2;
154141 host: ${{ secrets.MYSQL_HOST } }
@@ -157,11 +144,36 @@ jobs:
157144 pass: ${{ secrets.MYSQL_PASS } }
158145 tabl: ${{ secrets.MYSQL_TABL } }
159146 debug: true
147+ timeo: 5
160148
161149```
162- ---
163150
164- Check synopsis above to get an example.
151+ ### Standalone
152+
153+ Requirements:
154+
155+ - MySQL client
156+ - PHP 8.5+ with PDO extension enabled
157+
158+ Permissions:
159+
160+ `` chmod +x ./db-processor ``
161+
162+ Execution:
163+
164+ ```
165+ ./db-processor <args>
166+ ```
167+
168+ or
169+
170+ ```
171+ ./db-processor
172+ ```
173+
174+ when using environment variables.
175+
176+ ---
165177
166178## Demo
167179
0 commit comments