Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update mysql script (#7286)

Danny Xu2d58fd05c8d8
diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml
index 3f59df1ee8..620870215c 100644
--- a/.github/workflows/backend-tests.yml
+++ b/.github/workflows/backend-tests.yml
@@ -26,9 +26,15 @@ jobs:
run: |
go mod tidy
git diff --exit-code
+ - name: Cache MySQL
+ uses: actions/cache@v3
+ with:
+ path: |
+ ./backend/resources/mysql/*.tar.gz
+ ./backend/resources/mysql/*.tar.xz
+ key: ${{ runner.OS }}-build-mysql-cache
- name: Install dependencies
- run: |
- touch ./backend/resources/mysql/mysql-8.0.33-linux-glibc2.17-x86_64-minimal.tar.xz
+ run: go generate -tags mysql ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
diff --git a/backend/resources/mysql/fetch_mysql.sh b/backend/resources/mysql/fetch_mysql.sh
index 1d2efffad6..60be82a990 100755
--- a/backend/resources/mysql/fetch_mysql.sh
+++ b/backend/resources/mysql/fetch_mysql.sh
@@ -1,25 +1,8 @@
#!/bin/bash
+set -e
-ckmd5() {
- if [[ $(uname) = Darwin ]]; then
- test $(md5 -q $1) = $2
- else
- test $(md5sum $1 | awk '{ print $1 }') = $2
- fi
-}
-
-atomic_download() {
- if [[ ! -e $1 ]]; then
- echo "Downloading $1..."
- curl -o $1.tmp https://cdn.mysql.com/archives/mysql-8.0/$1
- if [ -n "$2" ]; then
- if $(ckmd5 $1.tmp $2); then
- mv $1.tmp $1
- else
- rm $1.tmp
- fi
- fi
- fi
-}
-
-atomic_download $1 $2
+if [[ ! -e $1 ]]; then
+ echo "Downloading $1..."
+ curl -o $1.tmp https://cdn.mysql.com/archives/mysql-8.0/$1
+ mv $1.tmp $1
+fi
diff --git a/backend/resources/mysql/resources_darwin_amd64.go b/backend/resources/mysql/resources_darwin_amd64.go
index 180c2d4660..e2149b5619 100644
--- a/backend/resources/mysql/resources_darwin_amd64.go
+++ b/backend/resources/mysql/resources_darwin_amd64.go
@@ -5,7 +5,7 @@ package mysql
import "embed"
-//go:generate ./fetch_mysql.sh mysql-8.0.33-macos13-x86_64.tar.gz 4ac08ea50a719c099eee3acf7dfab211
+//go:generate ./fetch_mysql.sh mysql-8.0.33-macos13-x86_64.tar.gz
// To use this package in testing, download the MySQL binary first:
// go generate -tags mysql ./...
diff --git a/backend/resources/mysql/resources_darwin_arm64.go b/backend/resources/mysql/resources_darwin_arm64.go
index 0b16a91705..74a908987d 100644
--- a/backend/resources/mysql/resources_darwin_arm64.go
+++ b/backend/resources/mysql/resources_darwin_arm64.go
@@ -5,7 +5,7 @@ package mysql
import "embed"
-//go:generate ./fetch_mysql.sh mysql-8.0.33-macos13-arm64.tar.gz 3e1698ba3cd1283ede4426f062357e1f
+//go:generate ./fetch_mysql.sh mysql-8.0.33-macos13-arm64.tar.gz
// To use this package in testing, download the MySQL binary first:
// go generate -tags mysql ./...
diff --git a/backend/resources/mysql/resources_linux_amd64.go b/backend/resources/mysql/resources_linux_amd64.go
index ac8185a31a..4a9f0ed45c 100644
--- a/backend/resources/mysql/resources_linux_amd64.go
+++ b/backend/resources/mysql/resources_linux_amd64.go
@@ -5,7 +5,7 @@ package mysql
import "embed"
-//go:generate ./fetch_mysql.sh mysql-8.0.33-linux-glibc2.17-x86_64-minimal.tar.xz 377b6ae9c88a698438a19d67efa03252
+//go:generate ./fetch_mysql.sh mysql-8.0.33-linux-glibc2.17-x86_64-minimal.tar.xz
// To use this package in testing, download the MySQL binary first:
// go generate -tags mysql ./...
diff --git a/backend/resources/mysql/resources_linux_arm64.go b/backend/resources/mysql/resources_linux_arm64.go
index 155f1e0a4d..129064fece 100644
--- a/backend/resources/mysql/resources_linux_arm64.go
+++ b/backend/resources/mysql/resources_linux_arm64.go
@@ -5,10 +5,10 @@ package mysql
import "embed"
-//go:generate ./fetch_mysql.sh mysql-8.0.33-linux-glibc2.17-aarch64-minimal.tar.gz f5e01242975453ec6db02727848975c9
+//go:generate ./fetch_mysql.sh mysql-8.0.33-linux-glibc2.17-aarch64.tar.gz
// To use this package in testing, download the MySQL binary first:
// go generate -tags mysql ./...
//
-//go:embed mysql-8.0.33-linux-glibc2.17-aarch64-minimal.tar.gz
+//go:embed mysql-8.0.33-linux-glibc2.17-aarch64.tar.gz
var resources embed.FS