-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
79 lines (68 loc) · 2.93 KB
/
docker_publish.yml
File metadata and controls
79 lines (68 loc) · 2.93 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Docker Publish
on:
push:
tags: ["v*"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USER_LOGIN }}
password: ${{ secrets.DOCKER_USER_PASSWORD }}
- name: Extract version from mysqltuner.pl
id: version
run: echo "VERSION=$(grep '\- Version ' mysqltuner.pl | awk '{ print $NF}')" >> $GITHUB_ENV
- name: Pre-publish validation
run: |
echo "Checking for critical files..."
CRITICAL_FILES=("mysqltuner.pl" "Dockerfile" "LICENSE" "vulnerabilities.csv" "basic_passwords.txt")
for file in "${CRITICAL_FILES[@]}"; do
if [ ! -f "$file" ]; then
echo "ERROR: Critical file missing: $file"
exit 1
fi
echo "✔ Found: $file"
done
echo "Checking for release notes: releases/v${{ env.VERSION }}.md..."
if [ ! -f "releases/v${{ env.VERSION }}.md" ]; then
echo "ERROR: Release notes missing: releases/v${{ env.VERSION }}.md"
exit 1
fi
echo "✔ Found release notes"
TAG=${GITHUB_REF#refs/tags/}
echo "Checking tag consistency (Tag: $TAG vs Version: v${{ env.VERSION }})..."
if [ "v${{ env.VERSION }}" != "$TAG" ]; then
echo "ERROR: Tag $TAG does not match version in mysqltuner.pl (v${{ env.VERSION }})"
exit 1
fi
echo "✔ Tag matches script version"
- name: Extract release notes
id: release_notes
run: |
{
echo 'RELEASE_NOTES<<EOF'
cat "releases/v${{ env.VERSION }}.md"
echo 'EOF'
} >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: |
jmrenouard/mysqltuner:latest
jmrenouard/mysqltuner:${{ env.VERSION }}
labels: |
org.opencontainers.image.title=MySQLTuner
org.opencontainers.image.description=**MySQLTuner** is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief format along with some basic performance suggestions. **MySQLTuner** supports ~300 indicators for MySQL/MariaDB/Percona Server in this latest version.
org.opencontainers.image.version=${{ env.VERSION }}
org.opencontainers.image.licenses=GPL-3.0
com.mysqltuner.release-notes=${{ env.RELEASE_NOTES }}