File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,15 @@ cd homebrew-tools
1010git config user.email " ${GIT_EMAIL} "
1111git config user.name " Dinko Osrecki"
1212
13- cat << EOF > google-cloud-sql.rb
14- class GoogleCloudSql < Formula
15- desc "Connect to private Google Cloud SQL instance through Cloud SQL Auth Proxy running in GKE cluster."
13+ generate_formula () {
14+ local class_name=" $1 "
15+ cat << EOF
16+ class ${class_name} < Formula
17+ desc "Connect to private Google Cloud SQL/AlloyDB instance through Cloud SQL/AlloyDB Auth Proxy running in GKE cluster."
1618 homepage "https://github.com/edosrecki/google-cloud-sql-cli"
1719 url "$url "
1820 sha256 "$checksum "
21+ version "$version "
1922 def install
2023 bin.install "google-cloud-sql"
2124 end
@@ -24,8 +27,15 @@ class GoogleCloudSql < Formula
2427 end
2528end
2629EOF
30+ }
2731
28- git add google-cloud-sql.rb
32+ # Create latest version formula
33+ generate_formula " GoogleCloudSql" > google-cloud-sql.rb
34+ # Create versioned formula
35+ versioned_formula=" google-cloud-sql@${version} .rb"
36+ generate_formula " GoogleCloudSqlAT${version// ./ } " > " $versioned_formula "
37+
38+ git add google-cloud-sql.rb " $versioned_formula "
2939git commit -m " chore: release google-cloud-sql v$version "
3040git push
3141
You can’t perform that action at this time.
0 commit comments