File tree Expand file tree Collapse file tree 5 files changed +73
-4
lines changed
Expand file tree Collapse file tree 5 files changed +73
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ FROM python:alpine3.9
22
33RUN pip install mysql-to-sqlite3 && mkdir -p /output && touch /output/export.sqlite3
44
5+ COPY entrypoint.sh /entrypoint.sh
6+
57VOLUME [ "/output" ]
68
7- CMD [ "mysql2sqlite" , "-f /output/export.sqlite3" ]
9+ ENTRYPOINT [ "/entrypoint.sh" ]
810
Original file line number Diff line number Diff line change 1- # MySQL to SQLite3 (Docker)
1+ # MySQL to SQLite3 (Docker + Github action )
22
33Implements [ MySQL to SQLite3] [ link-sql ] as a docker utility
44
5- ## How to use
5+ ## How to use as docker
66
77```
8- docker run --rm -v ${PWD}:/output benrowe/mysql-to-sqlite3 mysql2sqlite -f /output/export.sqlite3 -d database_name -u username -h host.docker.internal -p password
8+ docker run --rm -v ${PWD}:/output benrowe/mysql-to-sqlite3 database_name username host.docker.internal password path/to/file
9+ ```
10+
11+ ## How to use as github action
12+
13+ The github action runs this command inside the docker file, so the host will need to point to the host machien
14+
15+ ```
16+ - name: Convert to SQLite
17+ uses: benrowe/mysql-to-sqlite3-docker@v1
18+ with:
19+ output: /path/to/file
20+ database: database
21+ host: localhost
22+ username: root
23+ password: password
924```
1025
1126[ link-sql ] :https://github.com/techouse/mysql-to-sqlite3
Original file line number Diff line number Diff line change 1+ name : MySQL to SQLite3 Converter
2+ description : Connect to mysql and convert to sqlite3 file
3+ 4+
5+ inputs :
6+ output :
7+ description : output file
8+ required : true
9+ database :
10+ description : mysql database name
11+ required : true
12+ host :
13+ description : mysql host address
14+ required : true
15+ username :
16+ description : mysql username
17+ required : true
18+ password :
19+ description : mysql password
20+ required : true
21+
22+ outputs :
23+ file :
24+ description : The file that is generated
25+
26+ runs :
27+ using : docker
28+ image : Dockerfile
29+ args :
30+ - ${{ inputs.host }}
31+ - ${{ inputs.database }}
32+ - ${{ inputs.username }}
33+ - ${{ inputs.password }}
34+ - ${{ inputs.output }}
35+ post-entrypoint : gh-output.sh
36+
37+ branding :
38+ icon : " filter"
39+ color : " blue"
40+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ HOST=$1
4+ DATABASE=$2
5+ USERNAME=$3
6+ PASSWORD=$4
7+ OUTPUT=$5
8+
9+ mysql2sqlite -f /output/export/ -d $DATABASE -u $USERNAME -h $HOST -p $PASSWORD -f $OUTPUT
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ echo " ::file::/path/to/dir"
You can’t perform that action at this time.
0 commit comments