From 6046dc427d14740d5d246df8af4512d67c0ee961 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 18:31:54 +0000 Subject: [PATCH 01/30] Update README.md: Add table of contents, improve formatting, add troubleshooting, and detail contributing instructions --- README.md | 162 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 97 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index d6a455a..31cbe0e 100644 --- a/README.md +++ b/README.md @@ -1,86 +1,118 @@ # homebrew-docker -containerized equivalent of your usual tools/app with [homebrew](http://brew.sh) workflow :) + +Containerized equivalent of your usual tools/app with [homebrew](http://brew.sh) workflow :) + +## Table of Contents + +* [Usage](#usage) + * [Get dockbrew](#get-dockbrew) + * [Search all dockbrew formulas](#search-all-dockbrew-formulas) + * [Install dockbrew powered app/tools/package](#install-dockbrew-powered-apptoolspackage) +* [Known caveats & issues](#known-caveats--issues) +* [Troubleshooting](#troubleshooting) +* [Contributing](#contributing) +* [License](#license) + ## Usage ### Get dockbrew - $ brew tap dockbrew/tap - ==> Tapping dockbrew/tap - Cloning into '/usr/local/Library/Taps/dockbrew/homebrew-tap'... + +```bash +brew tap dockbrew/tap +``` ### Search all dockbrew formulas - brew search dockbrew - dockbrew/tap/ab dockbrew/tap/docker-composer - dockbrew/tap/docker-ansible dockbrew/tap/docker-hugo + +```bash +brew search dockbrew +``` ### Install dockbrew powered app/tools/package Here is an example: Get ApacheBench (ab) - $ brew install dockbrew/tap/ab - ==> Installing ab from dockbrew/homebrew-tap - ==> Downloading https://github.com/dockbrew/ab/archive/2.3.tar.gz - Already downloaded: /Library/Caches/Homebrew/ab-2.3.tar.gz - 🍺 /usr/local/Cellar/ab/2.3: 2 files, 8.0K, built in 2 seconds +```bash +brew install dockbrew/tap/ab +``` And run it as you usually do - $ ab -n10 -c10 http://www.google.fr/ - This is ApacheBench, Version 2.3 <$Revision: 1663405 $> - Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ - Licensed to The Apache Software Foundation, http://www.apache.org/ - - Benchmarking www.google.fr (be patient).....done - - - Server Software: gws - Server Hostname: www.google.fr - Server Port: 80 - - Document Path: / - Document Length: 153980 bytes - - Concurrency Level: 10 - Time taken for tests: 2.003 seconds - Complete requests: 10 - Failed requests: 9 - (Connect: 0, Receive: 0, Length: 9, Exceptions: 0) - Total transferred: 1547790 bytes - HTML transferred: 1539572 bytes - Requests per second: 4.99 [#/sec] (mean) - Time per request: 2003.045 [ms] (mean) - Time per request: 200.305 [ms] (mean, across all concurrent requests) - Transfer rate: 754.61 [Kbytes/sec] received - - Connection Times (ms) - min mean[+/-sd] median max - Connect: 27 30 2.6 31 34 - Processing: 922 1454 362.1 1608 1975 - Waiting: 70 206 233.0 163 861 - Total: 950 1484 363.1 1639 2003 - - Percentage of the requests served within a certain time (ms) - 50% 1639 - 66% 1696 - 75% 1790 - 80% 1889 - 90% 2003 - 95% 2003 - 98% 2003 - 99% 2003 - 100% 2003 (longest request) - -## Known caveats && issues -Dockbrew is in pre-alpha release state, it leverage docker to unclutter your MacOSX host. You first need to run a docker-host locally on your Mac host (`docker-machine` comes in handy, jusr run `docker-machine create dockbrew -d virtualbox && eval "$(docker-machine env dockbrew)"`) +```bash +ab -n10 -c10 http://www.google.fr/ +``` + +This will output benchmarking results similar to the example below: + +``` +This is ApacheBench, Version 2.3 <$Revision: 1663405 $> +Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ +Licensed to The Apache Software Foundation, http://www.apache.org/ + +Benchmarking www.google.fr (be patient).....done + + +Server Software: gws +Server Hostname: www.google.fr +Server Port: 80 + +Document Path: / +Document Length: 153980 bytes + +Concurrency Level: 10 +Time taken for tests: 2.003 seconds +Complete requests: 10 +Failed requests: 9 + (Connect: 0, Receive: 0, Length: 9, Exceptions: 0) +Total transferred: 1547790 bytes +HTML transferred: 1539572 bytes +Requests per second: 4.99 [#/sec] (mean) +Time per request: 2003.045 [ms] (mean) +Time per request: 200.305 [ms] (mean, across all concurrent requests) +Transfer rate: 754.61 [Kbytes/sec] received + +Connection Times (ms) + min mean[+/-sd] median max +Connect: 27 30 2.6 31 34 +Processing: 922 1454 362.1 1608 1975 +Waiting: 70 206 233.0 163 861 +Total: 950 1484 363.1 1639 2003 + +Percentage of the requests served within a certain time (ms) + 50% 1639 + 66% 1696 + 75% 1790 + 80% 1889 + 90% 2003 + 95% 2003 + 98% 2003 + 99% 2003 + 100% 2003 (longest request) +``` + +## Known caveats & issues + +Dockbrew is in pre-alpha release state; it leverages Docker to unclutter your MacOSX host. You first need to run a Docker host locally on your Mac host (`docker-machine` comes in handy; just run `docker-machine create dockbrew -d virtualbox && eval "$(docker-machine env dockbrew)"`). + +## Troubleshooting + +* **Error: `docker-machine` not found:** Ensure Docker Machine is installed and configured correctly. Refer to the Docker documentation for installation and setup instructions. +* **Error: Permission denied:** Check your Docker permissions and ensure the user has the necessary privileges to run Docker commands. +* **Error during installation:** Check your internet connection and try again. If the problem persists, check the [issues](https://github.com/dockbrew/homebrew-tap/issues) page for similar problems or open a new issue. + ## Contributing -First, thank you for contributing! We love pull requests from everyone. -Here are a few technical guidelines to follow: -1. Open an [issue](https://github.com/dockbrew/homebrew-tap/issues) to discuss a new feature. -1. Open a Pull Request. -1. Edit/Squash after receiving feedback. -1. Party! +First, thank you for contributing! We love pull requests from everyone. Please follow these steps: + +1. Fork the repository. +2. Create a new branch for your feature or bug fix. +3. Make your changes and commit them with clear and concise messages. +4. Push your branch to your forked repository. +5. Open a pull request, clearly describing your changes and their purpose. +6. Address any feedback provided by the maintainers. + ## License + [GNU GENERAL PUBLIC LICENSE v2](http://www.gnu.org/licenses/gpl-2.0.fr.html) From f6efa393f56432b328e1a8ab2135bb610114b4c8 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 18:39:31 +0000 Subject: [PATCH 02/30] Update GitHub Actions workflow to dynamically test formulas --- .github/workflows/test-formulas.yml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/test-formulas.yml diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml new file mode 100644 index 0000000..19c3482 --- /dev/null +++ b/.github/workflows/test-formulas.yml @@ -0,0 +1,35 @@ +name: Test Homebrew Formulas + +on: + push: + branches: + - feature/update + +jobs: + test: + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Homebrew + run: brew update + + - name: Install dependencies + run: brew install coreutils + + - name: Get formula names + id: get_formulas + run: | + formulas=$(find Formula -maxdepth 1 -type f -name '*.rb' -print0 | xargs -0 -n1 basename | sed 's/.rb//') + echo "::set-output name=formulas::$formulas" + + - name: Test each formula + run: | + echo "Formulas to test: ${{ steps.get_formulas.outputs.formulas }}" + for formula in ${{ steps.get_formulas.outputs.formulas }}; do + echo "Testing formula: $formula" + brew install dockbrew/tap/$formula || echo "Error installing $formula" + # Add usage command based on README if available. This requires more sophisticated parsing of the README. + # For now, just check if the formula installed successfully. + done From bd439dd7def17fe06197d6399f8c50f4970e83c6 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 18:43:52 +0000 Subject: [PATCH 03/30] Fix formula path in workflow and update set-output --- .github/workflows/test-formulas.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 19c3482..d29ad91 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -21,8 +21,8 @@ jobs: - name: Get formula names id: get_formulas run: | - formulas=$(find Formula -maxdepth 1 -type f -name '*.rb' -print0 | xargs -0 -n1 basename | sed 's/.rb//') - echo "::set-output name=formulas::$formulas" + formulas=$(find ./Formula -maxdepth 1 -type f -name '*.rb' -print0 | xargs -0 -n1 basename | sed 's/.rb//') + echo "::set-output name=formulas::$formulas" >> $GITHUB_OUTPUT - name: Test each formula run: | @@ -30,6 +30,4 @@ jobs: for formula in ${{ steps.get_formulas.outputs.formulas }}; do echo "Testing formula: $formula" brew install dockbrew/tap/$formula || echo "Error installing $formula" - # Add usage command based on README if available. This requires more sophisticated parsing of the README. - # For now, just check if the formula installed successfully. done From 5c6e3c2aa5382e90fb840bec86bb887f0f97b6a2 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 18:44:48 +0000 Subject: [PATCH 04/30] Update workflow to use environment files and specify node version --- .github/workflows/test-formulas.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index d29ad91..74efddc 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -11,6 +11,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + node-version: 20 - name: Install Homebrew run: brew update @@ -22,12 +24,12 @@ jobs: id: get_formulas run: | formulas=$(find ./Formula -maxdepth 1 -type f -name '*.rb' -print0 | xargs -0 -n1 basename | sed 's/.rb//') - echo "::set-output name=formulas::$formulas" >> $GITHUB_OUTPUT + echo "formulas=$formulas" >> $GITHUB_ENV - name: Test each formula run: | - echo "Formulas to test: ${{ steps.get_formulas.outputs.formulas }}" - for formula in ${{ steps.get_formulas.outputs.formulas }}; do + echo "Formulas to test: ${FORMULAS}" + for formula in ${FORMULAS}; do echo "Testing formula: $formula" brew install dockbrew/tap/$formula || echo "Error installing $formula" done From 183b040bac90e9f28dbe71e8e50fb409dba93562 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 18:47:52 +0000 Subject: [PATCH 05/30] Add comments about Node.js and set-output warnings --- .github/workflows/test-formulas.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 74efddc..b6d7aa8 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -13,19 +13,15 @@ jobs: uses: actions/checkout@v3 with: node-version: 20 - - name: Install Homebrew run: brew update - - name: Install dependencies run: brew install coreutils - - name: Get formula names id: get_formulas run: | formulas=$(find ./Formula -maxdepth 1 -type f -name '*.rb' -print0 | xargs -0 -n1 basename | sed 's/.rb//') echo "formulas=$formulas" >> $GITHUB_ENV - - name: Test each formula run: | echo "Formulas to test: ${FORMULAS}" @@ -33,3 +29,7 @@ jobs: echo "Testing formula: $formula" brew install dockbrew/tap/$formula || echo "Error installing $formula" done + - name: Add comment about warnings + run: | + echo "::warning title=Node.js Version Warning::The Node.js version warning related to actions/checkout@v3 might require updating the action to a version that supports Node.js 20. See https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ for more information." >> $GITHUB_OUTPUT + echo "::warning title=set-output Warning::Although the workflow uses environment files, the set-output warning might persist due to caching. See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for more information." >> $GITHUB_OUTPUT From f6967cae389e055c899ea96d77101cfb4e249e96 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 18:53:54 +0000 Subject: [PATCH 06/30] Add debug steps to workflow --- .github/workflows/test-formulas.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index b6d7aa8..7755ba4 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -13,15 +13,25 @@ jobs: uses: actions/checkout@v3 with: node-version: 20 + + - name: Debug - Print working directory + run: pwd + + - name: Debug - List files + run: ls -l + - name: Install Homebrew run: brew update + - name: Install dependencies run: brew install coreutils + - name: Get formula names id: get_formulas run: | formulas=$(find ./Formula -maxdepth 1 -type f -name '*.rb' -print0 | xargs -0 -n1 basename | sed 's/.rb//') echo "formulas=$formulas" >> $GITHUB_ENV + - name: Test each formula run: | echo "Formulas to test: ${FORMULAS}" @@ -29,7 +39,3 @@ jobs: echo "Testing formula: $formula" brew install dockbrew/tap/$formula || echo "Error installing $formula" done - - name: Add comment about warnings - run: | - echo "::warning title=Node.js Version Warning::The Node.js version warning related to actions/checkout@v3 might require updating the action to a version that supports Node.js 20. See https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ for more information." >> $GITHUB_OUTPUT - echo "::warning title=set-output Warning::Although the workflow uses environment files, the set-output warning might persist due to caching. See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for more information." >> $GITHUB_OUTPUT From 837bb57a662be9f4c9d8bb5beb51f35e3e7a6b77 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 18:55:11 +0000 Subject: [PATCH 07/30] move files --- ab.rb => Formula/ab.rb | 10 +++++++++ .../docker-ansible.rb | 13 +++++++++++- Formula/docker-composer.rb | 21 +++++++++++++++++++ Formula/docker-hugo.rb | 21 +++++++++++++++++++ docker-composer.rb | 11 ---------- docker-hugo.rb | 11 ---------- 6 files changed, 64 insertions(+), 23 deletions(-) rename ab.rb => Formula/ab.rb (57%) rename docker-ansible.rb => Formula/docker-ansible.rb (54%) create mode 100644 Formula/docker-composer.rb create mode 100644 Formula/docker-hugo.rb delete mode 100644 docker-composer.rb delete mode 100644 docker-hugo.rb diff --git a/ab.rb b/Formula/ab.rb similarity index 57% rename from ab.rb rename to Formula/ab.rb index e9cf791..a6c29ee 100644 --- a/ab.rb +++ b/Formula/ab.rb @@ -1,10 +1,20 @@ +# Class definition for the ab formula class Ab < Formula + # Description of the formula desc "install ApacheBench as a docker container" + # Homepage URL homepage "https://github.com/jfrazelle/dockerfiles/tree/master/ab" + # URL of the formula source url "https://github.com/dockbrew/ab/archive/2.3.tar.gz" + # Version number version "2.3" + # SHA256 checksum for verification sha256 "8818e940beb458743bdf3a1fc3c3b373956fc89379eb5025ad0f6b8c2465aad6" + # Dependency on Docker + depends_on "docker" + + # Installation method def install bin.install "ab" end diff --git a/docker-ansible.rb b/Formula/docker-ansible.rb similarity index 54% rename from docker-ansible.rb rename to Formula/docker-ansible.rb index cf9dc4f..89332c8 100644 --- a/docker-ansible.rb +++ b/Formula/docker-ansible.rb @@ -1,11 +1,22 @@ +# Class definition for the docker-ansible formula class DockerAnsible < Formula + # Description of the formula desc "install ansible as a docker container" - homepage "" + # Homepage URL (updated if possible, otherwise left as is) + homepage "https://github.com/dockbrew/docker-ansible" # Updated homepage if available, otherwise leave blank. + # URL of the formula source url "https://github.com/dockbrew/docker-ansible/archive/1.9.2.tar.gz" + # Version number version "1.9.2" + # SHA256 checksum for verification sha256 "395fba36e42c2f08f21ddfabdf48c2b6de08a8e514bbf611e51548fa38bc5016" + # Dependency on Docker + depends_on "docker" + + # Installation method def install + # Install the various ansible binaries bin.install "docker-ansible" bin.install "docker-ansible-galaxy" bin.install "docker-ansible-playbook" diff --git a/Formula/docker-composer.rb b/Formula/docker-composer.rb new file mode 100644 index 0000000..837ce3e --- /dev/null +++ b/Formula/docker-composer.rb @@ -0,0 +1,21 @@ +# Class definition for the docker-composer formula +class DockerComposer < Formula + # Description of the formula + desc "install composer as a docker container" + # Homepage URL (updated if possible, otherwise left as is) + homepage "https://github.com/dockbrew/docker-composer" # Updated homepage if available, otherwise leave blank. + # URL of the formula source + url "https://github.com/dockbrew/docker-composer/archive/0.1.1.tar.gz" + # Version number + version "0.1.1" + # SHA256 checksum for verification + sha256 "105797a9977ad0e426bb52c1bf045f63f55d3c924e6bff2214e0b856b973fa6a" + + # Dependency on Docker + depends_on "docker" + + # Installation method + def install + bin.install "docker-composer" + end +end diff --git a/Formula/docker-hugo.rb b/Formula/docker-hugo.rb new file mode 100644 index 0000000..de9d0e6 --- /dev/null +++ b/Formula/docker-hugo.rb @@ -0,0 +1,21 @@ +# Class definition for the docker-hugo formula +class DockerHugo < Formula + # Description of the formula + desc "install hugo as a docker container" + # Homepage URL (updated if possible, otherwise left as is) + homepage "https://github.com/dockbrew/docker-hugo" # Updated homepage if available, otherwise leave blank. + # URL of the formula source + url "https://github.com/dockbrew/docker-hugo/archive/0.13.tar.gz" + # Version number + version "0.13" + # SHA256 checksum for verification + sha256 "1d6aa5e07fed2a58dbe7e066f82b74c554af489d7ea0196682a1871b78cf56c2" + + # Dependency on Docker + depends_on "docker" + + # Installation method + def install + bin.install "docker-hugo" + end +end diff --git a/docker-composer.rb b/docker-composer.rb deleted file mode 100644 index 75c43a9..0000000 --- a/docker-composer.rb +++ /dev/null @@ -1,11 +0,0 @@ -class DockerComposer < Formula - desc "install composer as a docker container" - homepage "" - url "https://github.com/dockbrew/docker-composer/archive/0.1.1.tar.gz" - version "0.1.1" - sha256 "105797a9977ad0e426bb52c1bf045f63f55d3c924e6bff2214e0b856b973fa6a" - - def install - bin.install "docker-composer" - end -end diff --git a/docker-hugo.rb b/docker-hugo.rb deleted file mode 100644 index e5af07a..0000000 --- a/docker-hugo.rb +++ /dev/null @@ -1,11 +0,0 @@ -class DockerHugo < Formula - desc "install hugo as a docker container" - homepage "" - url "https://github.com/dockbrew/docker-hugo/archive/0.13.tar.gz" - version "0.13" - sha256 "1d6aa5e07fed2a58dbe7e066f82b74c554af489d7ea0196682a1871b78cf56c2" - - def install - bin.install "docker-hugo" - end -end From 837d2bac1abadf38c665679d9ff0cca939c36fdc Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 18:58:30 +0000 Subject: [PATCH 08/30] Simplify formula name extraction in workflow --- .github/workflows/test-formulas.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 7755ba4..d17def7 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -14,12 +14,6 @@ jobs: with: node-version: 20 - - name: Debug - Print working directory - run: pwd - - - name: Debug - List files - run: ls -l - - name: Install Homebrew run: brew update @@ -29,7 +23,11 @@ jobs: - name: Get formula names id: get_formulas run: | - formulas=$(find ./Formula -maxdepth 1 -type f -name '*.rb' -print0 | xargs -0 -n1 basename | sed 's/.rb//') + formulas="" + find ./Formula -maxdepth 1 -type f -name '*.rb' -print0 | while IFS= read -r -d $'\0' formula_file; do + formula_name=$(basename "$formula_file" .rb) + formulas="$formulas $formula_name" + done echo "formulas=$formulas" >> $GITHUB_ENV - name: Test each formula From 38e726b5724c0c78dcb5fe1ef35bf8db2e141f1e Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 19:02:01 +0000 Subject: [PATCH 09/30] Add step to print environment variables --- .github/workflows/test-formulas.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index d17def7..5c927b2 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -20,6 +20,9 @@ jobs: - name: Install dependencies run: brew install coreutils + - name: List Formula directory contents + run: ls -l ./Formula + - name: Get formula names id: get_formulas run: | @@ -28,8 +31,12 @@ jobs: formula_name=$(basename "$formula_file" .rb) formulas="$formulas $formula_name" done + # Set the environment variable FORMULAS so it can be used in later steps echo "formulas=$formulas" >> $GITHUB_ENV + - name: Print environment variables + run: env + - name: Test each formula run: | echo "Formulas to test: ${FORMULAS}" From 722d1e5e2f712a6b6196cecb047a1ff70fa29eb8 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 19:04:14 +0000 Subject: [PATCH 10/30] Simplify loop and add debug output in get_formulas step --- .github/workflows/test-formulas.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 5c927b2..002aa1a 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -29,13 +29,11 @@ jobs: formulas="" find ./Formula -maxdepth 1 -type f -name '*.rb' -print0 | while IFS= read -r -d $'\0' formula_file; do formula_name=$(basename "$formula_file" .rb) - formulas="$formulas $formula_name" + echo "Found formula: $formula_name" + formulas+=" $formula_name" done - # Set the environment variable FORMULAS so it can be used in later steps echo "formulas=$formulas" >> $GITHUB_ENV - - - name: Print environment variables - run: env + echo "Final formulas: $formulas" - name: Test each formula run: | From aa2d21b5ec872ab15815b92f51e55abccb2c8ef6 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 19:06:01 +0000 Subject: [PATCH 11/30] Use array to build formula list --- .github/workflows/test-formulas.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 002aa1a..c4a0413 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -26,14 +26,15 @@ jobs: - name: Get formula names id: get_formulas run: | - formulas="" + formulas=() find ./Formula -maxdepth 1 -type f -name '*.rb' -print0 | while IFS= read -r -d $'\0' formula_file; do formula_name=$(basename "$formula_file" .rb) echo "Found formula: $formula_name" - formulas+=" $formula_name" + formulas+=("$formula_name") done - echo "formulas=$formulas" >> $GITHUB_ENV - echo "Final formulas: $formulas" + formula_string=$(IFS=" "; echo "${formulas[*]}") + echo "formulas=$formula_string" >> $GITHUB_ENV + echo "Final formulas: $formula_string" - name: Test each formula run: | From 9a15e1d2dc5729177cb8aad4b1d4a902f133f039 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 19:08:51 +0000 Subject: [PATCH 12/30] Fix formula string concatenation --- .github/workflows/test-formulas.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index c4a0413..0e0ae4a 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -26,13 +26,12 @@ jobs: - name: Get formula names id: get_formulas run: | - formulas=() + formula_string="" find ./Formula -maxdepth 1 -type f -name '*.rb' -print0 | while IFS= read -r -d $'\0' formula_file; do formula_name=$(basename "$formula_file" .rb) echo "Found formula: $formula_name" - formulas+=("$formula_name") + formula_string="$formula_string $formula_name" done - formula_string=$(IFS=" "; echo "${formulas[*]}") echo "formulas=$formula_string" >> $GITHUB_ENV echo "Final formulas: $formula_string" From 844483297412bc2f00c5ce288b170ef573fae6ea Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 19:13:03 +0000 Subject: [PATCH 13/30] fix with o1-mini --- .github/workflows/test-formulas.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 0e0ae4a..8e64a04 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -27,11 +27,11 @@ jobs: id: get_formulas run: | formula_string="" - find ./Formula -maxdepth 1 -type f -name '*.rb' -print0 | while IFS= read -r -d $'\0' formula_file; do + while IFS= read -r -d $'\0' formula_file; do formula_name=$(basename "$formula_file" .rb) echo "Found formula: $formula_name" formula_string="$formula_string $formula_name" - done + done < <(find ./Formula -maxdepth 1 -type f -name '*.rb' -print0) echo "formulas=$formula_string" >> $GITHUB_ENV echo "Final formulas: $formula_string" From c4cc96c357fbbd9a916febbe6259b0804b25032e Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Wed, 30 Oct 2024 19:15:47 +0000 Subject: [PATCH 14/30] fix with o1-mini --- .github/workflows/test-formulas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 8e64a04..7645925 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -32,7 +32,7 @@ jobs: echo "Found formula: $formula_name" formula_string="$formula_string $formula_name" done < <(find ./Formula -maxdepth 1 -type f -name '*.rb' -print0) - echo "formulas=$formula_string" >> $GITHUB_ENV + echo "FORMULAS=$formula_string" >> $GITHUB_ENV echo "Final formulas: $formula_string" - name: Test each formula From be7defafee40574b5ed0aa0afe958e5e637fa6e2 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Fri, 22 Nov 2024 17:36:32 +0000 Subject: [PATCH 15/30] try removing node-version --- .github/workflows/test-formulas.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 7645925..7b41bc0 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -11,8 +11,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - with: - node-version: 20 - name: Install Homebrew run: brew update From 18d0fe105f6a283b29853acf8689cf1ecf2304fd Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sat, 23 Nov 2024 14:26:56 +0000 Subject: [PATCH 16/30] wip --- .github/workflows/test-formulas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 7b41bc0..66fe435 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -38,5 +38,5 @@ jobs: echo "Formulas to test: ${FORMULAS}" for formula in ${FORMULAS}; do echo "Testing formula: $formula" - brew install dockbrew/tap/$formula || echo "Error installing $formula" + brew install dockbrew/tap/$formula && brew test dockbrew/tap/$formula || echo "Error installing $formula" done From d0c7f8659948c2a4152dc87aec9c7956a851f155 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sat, 23 Nov 2024 18:41:45 +0000 Subject: [PATCH 17/30] wip --- Formula/ab.rb | 4 ++++ Formula/docker-ansible.rb | 28 ---------------------------- Formula/docker-composer.rb | 21 --------------------- 3 files changed, 4 insertions(+), 49 deletions(-) delete mode 100644 Formula/docker-ansible.rb delete mode 100644 Formula/docker-composer.rb diff --git a/Formula/ab.rb b/Formula/ab.rb index a6c29ee..d331b4c 100644 --- a/Formula/ab.rb +++ b/Formula/ab.rb @@ -18,4 +18,8 @@ class Ab < Formula def install bin.install "ab" end + + test do + system "#{bin}/ab", "-V" + end end diff --git a/Formula/docker-ansible.rb b/Formula/docker-ansible.rb deleted file mode 100644 index 89332c8..0000000 --- a/Formula/docker-ansible.rb +++ /dev/null @@ -1,28 +0,0 @@ -# Class definition for the docker-ansible formula -class DockerAnsible < Formula - # Description of the formula - desc "install ansible as a docker container" - # Homepage URL (updated if possible, otherwise left as is) - homepage "https://github.com/dockbrew/docker-ansible" # Updated homepage if available, otherwise leave blank. - # URL of the formula source - url "https://github.com/dockbrew/docker-ansible/archive/1.9.2.tar.gz" - # Version number - version "1.9.2" - # SHA256 checksum for verification - sha256 "395fba36e42c2f08f21ddfabdf48c2b6de08a8e514bbf611e51548fa38bc5016" - - # Dependency on Docker - depends_on "docker" - - # Installation method - def install - # Install the various ansible binaries - bin.install "docker-ansible" - bin.install "docker-ansible-galaxy" - bin.install "docker-ansible-playbook" - bin.install "docker-ansible-pull" - bin.install "docker-ansible-push" - bin.install "docker-ansible-vault" - bin.install "docker-ansible-doc" - end -end diff --git a/Formula/docker-composer.rb b/Formula/docker-composer.rb deleted file mode 100644 index 837ce3e..0000000 --- a/Formula/docker-composer.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Class definition for the docker-composer formula -class DockerComposer < Formula - # Description of the formula - desc "install composer as a docker container" - # Homepage URL (updated if possible, otherwise left as is) - homepage "https://github.com/dockbrew/docker-composer" # Updated homepage if available, otherwise leave blank. - # URL of the formula source - url "https://github.com/dockbrew/docker-composer/archive/0.1.1.tar.gz" - # Version number - version "0.1.1" - # SHA256 checksum for verification - sha256 "105797a9977ad0e426bb52c1bf045f63f55d3c924e6bff2214e0b856b973fa6a" - - # Dependency on Docker - depends_on "docker" - - # Installation method - def install - bin.install "docker-composer" - end -end From 85b26a950c759a2fd4de1962ac4cb5a66b503158 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sat, 23 Nov 2024 18:51:35 +0000 Subject: [PATCH 18/30] wip --- Formula/ab.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Formula/ab.rb b/Formula/ab.rb index d331b4c..511fdfd 100644 --- a/Formula/ab.rb +++ b/Formula/ab.rb @@ -1,22 +1,15 @@ -# Class definition for the ab formula class Ab < Formula - # Description of the formula desc "install ApacheBench as a docker container" - # Homepage URL homepage "https://github.com/jfrazelle/dockerfiles/tree/master/ab" - # URL of the formula source url "https://github.com/dockbrew/ab/archive/2.3.tar.gz" - # Version number version "2.3" - # SHA256 checksum for verification sha256 "8818e940beb458743bdf3a1fc3c3b373956fc89379eb5025ad0f6b8c2465aad6" - # Dependency on Docker depends_on "docker" - # Installation method def install bin.install "ab" + system "brew", "test" end test do From cbd793356d375268883d62a0c6170c8e2e69cd42 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sat, 23 Nov 2024 19:01:57 +0000 Subject: [PATCH 19/30] wip --- Formula/ab.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Formula/ab.rb b/Formula/ab.rb index 511fdfd..189718f 100644 --- a/Formula/ab.rb +++ b/Formula/ab.rb @@ -9,10 +9,9 @@ class Ab < Formula def install bin.install "ab" - system "brew", "test" end test do - system "#{bin}/ab", "-V" + system "#{bin}/ab", "Apache", shell_output("#{bin}/ab help") end end From 78bdd9b916972b6fbb5226e63234df173db56bf9 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sat, 23 Nov 2024 19:14:24 +0000 Subject: [PATCH 20/30] wip --- .github/workflows/test-formulas.yml | 5 ++++- Formula/ab.rb | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 66fe435..407fab7 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -38,5 +38,8 @@ jobs: echo "Formulas to test: ${FORMULAS}" for formula in ${FORMULAS}; do echo "Testing formula: $formula" - brew install dockbrew/tap/$formula && brew test dockbrew/tap/$formula || echo "Error installing $formula" + brew install dockbrew/tap/$formula || echo "Error installing $formula" + ls `brew --repository`/Library/Taps/*/* + ab -V + brew test dockbrew/tap/$formula done diff --git a/Formula/ab.rb b/Formula/ab.rb index 189718f..c77abbf 100644 --- a/Formula/ab.rb +++ b/Formula/ab.rb @@ -12,6 +12,7 @@ def install end test do - system "#{bin}/ab", "Apache", shell_output("#{bin}/ab help") + system "#{bin}/ab", "-V" + assert_match "version", shell_output("#{bin}/ab help") end end From 11dc5fee9f67dd52f211008725871da6933d196c Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sun, 24 Nov 2024 17:11:01 +0000 Subject: [PATCH 21/30] wip --- .github/workflows/test-formulas.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 407fab7..ebf350b 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -12,6 +12,13 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + #- name: Check and install Homebrew + # run: | + # if ! command -v brew &>/dev/null; then + # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + # echo "/home/linuxbrew/.linuxbrew/bin/" >> $PATH + # fi + - name: Install Homebrew run: brew update From 792a4de9def14fc80bcccb2669537d343724262b Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sun, 24 Nov 2024 17:11:45 +0000 Subject: [PATCH 22/30] wip --- .github/workflows/test-formulas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index ebf350b..4c3c2ba 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -20,7 +20,7 @@ jobs: # fi - name: Install Homebrew - run: brew update + run: echo $PATH && brew update - name: Install dependencies run: brew install coreutils From 502631ef0a9b310f1f7f8a607f250ba70b4f41cd Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sun, 24 Nov 2024 17:14:05 +0000 Subject: [PATCH 23/30] remove hugo --- Formula/docker-hugo.rb | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 Formula/docker-hugo.rb diff --git a/Formula/docker-hugo.rb b/Formula/docker-hugo.rb deleted file mode 100644 index de9d0e6..0000000 --- a/Formula/docker-hugo.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Class definition for the docker-hugo formula -class DockerHugo < Formula - # Description of the formula - desc "install hugo as a docker container" - # Homepage URL (updated if possible, otherwise left as is) - homepage "https://github.com/dockbrew/docker-hugo" # Updated homepage if available, otherwise leave blank. - # URL of the formula source - url "https://github.com/dockbrew/docker-hugo/archive/0.13.tar.gz" - # Version number - version "0.13" - # SHA256 checksum for verification - sha256 "1d6aa5e07fed2a58dbe7e066f82b74c554af489d7ea0196682a1871b78cf56c2" - - # Dependency on Docker - depends_on "docker" - - # Installation method - def install - bin.install "docker-hugo" - end -end From 3dfdaa63458ce5ed8c614b9059b01e944e38a382 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sun, 24 Nov 2024 18:06:59 +0000 Subject: [PATCH 24/30] adds docker --- .github/workflows/test-formulas.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 4c3c2ba..54b4bd1 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -10,7 +10,7 @@ jobs: runs-on: macos-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 #- name: Check and install Homebrew # run: | @@ -23,7 +23,7 @@ jobs: run: echo $PATH && brew update - name: Install dependencies - run: brew install coreutils + run: brew install coreutils docker - name: List Formula directory contents run: ls -l ./Formula From b620387b32cab4f442a8ba451098bb3c2348f7f5 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sun, 24 Nov 2024 18:13:13 +0000 Subject: [PATCH 25/30] fix --- .github/workflows/test-formulas.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 54b4bd1..97be839 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -23,7 +23,9 @@ jobs: run: echo $PATH && brew update - name: Install dependencies - run: brew install coreutils docker + run: | + brew install coreutils docker + colima start - name: List Formula directory contents run: ls -l ./Formula From 5387f7a9caa02754d8187b3b3ed5627b60ed3c8d Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sun, 24 Nov 2024 18:16:29 +0000 Subject: [PATCH 26/30] fix --- .github/workflows/test-formulas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 97be839..b694ac1 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | - brew install coreutils docker + brew install coreutils docker colima colima start - name: List Formula directory contents From 7ebb1b2ef847e95edd61f3187b62147b70785c40 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sun, 24 Nov 2024 18:19:03 +0000 Subject: [PATCH 27/30] wip --- .github/workflows/test-formulas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index b694ac1..df6603a 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: | brew install coreutils docker colima - colima start + colima start -f - name: List Formula directory contents run: ls -l ./Formula From 48787542165a1135d0727206336ef7d0d9a5480d Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sun, 24 Nov 2024 18:21:16 +0000 Subject: [PATCH 28/30] wip --- .github/workflows/test-formulas.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index df6603a..940ec01 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: | brew install coreutils docker colima - colima start -f + brew services start colima - name: List Formula directory contents run: ls -l ./Formula @@ -49,6 +49,6 @@ jobs: echo "Testing formula: $formula" brew install dockbrew/tap/$formula || echo "Error installing $formula" ls `brew --repository`/Library/Taps/*/* - ab -V + brew audit --strict --new --online dockbrew/tap/$formula brew test dockbrew/tap/$formula done From 22d1dbddc8fae24eb864b009f99cca633720831f Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sun, 24 Nov 2024 18:32:50 +0000 Subject: [PATCH 29/30] wip --- .github/workflows/test-formulas.yml | 1 - Formula/ab.rb | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-formulas.yml b/.github/workflows/test-formulas.yml index 940ec01..1c28d3e 100644 --- a/.github/workflows/test-formulas.yml +++ b/.github/workflows/test-formulas.yml @@ -48,7 +48,6 @@ jobs: for formula in ${FORMULAS}; do echo "Testing formula: $formula" brew install dockbrew/tap/$formula || echo "Error installing $formula" - ls `brew --repository`/Library/Taps/*/* brew audit --strict --new --online dockbrew/tap/$formula brew test dockbrew/tap/$formula done diff --git a/Formula/ab.rb b/Formula/ab.rb index c77abbf..c9b03ad 100644 --- a/Formula/ab.rb +++ b/Formula/ab.rb @@ -1,5 +1,5 @@ class Ab < Formula - desc "install ApacheBench as a docker container" + desc "Install ApacheBench as a docker container" homepage "https://github.com/jfrazelle/dockerfiles/tree/master/ab" url "https://github.com/dockbrew/ab/archive/2.3.tar.gz" version "2.3" @@ -12,7 +12,6 @@ def install end test do - system "#{bin}/ab", "-V" - assert_match "version", shell_output("#{bin}/ab help") + system bin/"ab", "-V" end end From 1489a24737dc7beba92165f3c432e8aaa65e5de3 Mon Sep 17 00:00:00 2001 From: Hamdi LAADHARI Date: Sun, 24 Nov 2024 18:41:36 +0000 Subject: [PATCH 30/30] wip --- Formula/ab.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Formula/ab.rb b/Formula/ab.rb index c9b03ad..08dc36b 100644 --- a/Formula/ab.rb +++ b/Formula/ab.rb @@ -1,8 +1,7 @@ class Ab < Formula desc "Install ApacheBench as a docker container" homepage "https://github.com/jfrazelle/dockerfiles/tree/master/ab" - url "https://github.com/dockbrew/ab/archive/2.3.tar.gz" - version "2.3" + url "https://github.com/dockbrew/ab/archive/refs/tags/2.3.tar.gz" sha256 "8818e940beb458743bdf3a1fc3c3b373956fc89379eb5025ad0f6b8c2465aad6" depends_on "docker"