Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit b7bb254

Browse files
committed
Add action.yml, Dockerfile, entrypoint.sh
1 parent 148fb7b commit b7bb254

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM docker:stable
2+
3+
COPY entrypoint.sh /entrypoint.sh
4+
RUN chmod +x /entrypoint.sh
5+
ENTRYPOINT ["/entrypoint.sh"]

action.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'MySQL For Testing'
2+
description: 'MySQL 3306 port, utf8mb4, allow empty password'
3+
author: 'ash84'
4+
branding:
5+
icon: 'database'
6+
color: 'blue'
7+
inputs:
8+
version:
9+
description: "mysql version"
10+
required: false
11+
default: 'latest'
12+
mysql database:
13+
description: 'database'
14+
required: true
15+
default: ''
16+
runs:
17+
using: 'docker'
18+
image: 'Dockerfile'

entrypoint.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
cmd="docker run"
4+
5+
if [ -n "$INPUT_MYSQL_DATABASE" ]; then
6+
echo "no database"
7+
cmd="cmd -e MYSQL_DATABASE=$INPUT_MYSQL_DATABASE"
8+
fi
9+
10+
cmd="cmd -d -p 3306:3306 mysql:$INPUT_MYSQL_VERSION --port=3306"
11+
cmd="cmd --character-set-server=$INPUT_CHARACTER_SET_SERVER --collation-server=$INPUT_COLLATION_SERVER"
12+
cmd="cmd -e MYSQL_ALLOW_EMPTY_PASSWORD=true"
13+
sh -c "cmd"

0 commit comments

Comments
 (0)