From 3cce3e7b9eb3539ef87f8e3291b46aa76be456bc Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:12:18 -0300 Subject: [PATCH 01/35] Update ci.yml --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67397acf..575c121d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,22 +3,33 @@ name: CI on: [push, pull_request] jobs: - tests: + vagrantfile: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] - ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0] + os: [ubuntu-latest] steps: - uses: actions/checkout@v2 - - name: Install Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} + - name: Check Vagrant version + run: vagrant --version - - name: Install dependencies - run: bundle install + #tests: + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [ubuntu-latest, macos-latest] + # ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0] + # steps: + # - uses: actions/checkout@v2 - - name: Run tests with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} - run: bundle exec rake + # - name: Install Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} + # uses: ruby/setup-ruby@v1 + # with: + # ruby-version: ${{ matrix.ruby-version }} + + # - name: Install dependencies + # run: bundle install + + # - name: Run tests with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} + # run: bundle exec rake From 9cf9ae5961f6225fd9365b55afa0f9843679dd0f Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:14:08 -0300 Subject: [PATCH 02/35] Create Vagrantfile --- Vagrantfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Vagrantfile diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1 @@ + From e4462110329ac1814951a03eb8bdd1306b4bd1e3 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:15:13 -0300 Subject: [PATCH 03/35] Update ci.yml --- .github/workflows/ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 575c121d..65a2c287 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,22 +14,22 @@ jobs: - name: Check Vagrant version run: vagrant --version - #tests: - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [ubuntu-latest, macos-latest] - # ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0] - # steps: - # - uses: actions/checkout@v2 + tests: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0] + steps: + - uses: actions/checkout@v2 - # - name: Install Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} - # uses: ruby/setup-ruby@v1 - # with: - # ruby-version: ${{ matrix.ruby-version }} + - name: Install Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} - # - name: Install dependencies - # run: bundle install + - name: Install dependencies + run: bundle install - # - name: Run tests with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} - # run: bundle exec rake + - name: Run tests with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} + run: bundle exec rake From 7cad3c7473a9271985e7fbd9ff25efdbd34f3e34 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:15:28 -0300 Subject: [PATCH 04/35] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65a2c287..08a7fd7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] jobs: vagrantfile: From 6688466445e4823ffa59069b5cfb7e1c5fc7c244 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:15:54 -0300 Subject: [PATCH 05/35] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08a7fd7b..65a2c287 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [push, pull_request, workflow_dispatch] +on: [push, pull_request] jobs: vagrantfile: From fff59fa326a923a721e56aa913d3a010b3da6def Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:16:47 -0300 Subject: [PATCH 06/35] Update ci.yml --- .github/workflows/ci.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65a2c287..a40ea602 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,23 +13,3 @@ jobs: - name: Check Vagrant version run: vagrant --version - - tests: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0] - steps: - - uses: actions/checkout@v2 - - - name: Install Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - - - name: Install dependencies - run: bundle install - - - name: Run tests with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} - run: bundle exec rake From 5cc607892db90945def4d8144ff5f8cfe07f0cd7 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:17:06 -0300 Subject: [PATCH 07/35] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a40ea602..c65ea26a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest] + os: [macos-latest] steps: - uses: actions/checkout@v2 From 4659a5dad1f732c6fa51fc928a0fbe0d4f3c56a2 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:20:36 -0300 Subject: [PATCH 08/35] Update ci.yml --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c65ea26a..dc9be7ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,5 +11,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Check Vagrant version + - name: Vagrant version run: vagrant --version + + - name: Vagrant up + run: vagrant up + + - name: Test Vagrant ouput + run: vagrant ssh -c "echo 'hello world!'" From 22c36b829ea1e9392cadaea9724887b452aa3414 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:22:31 -0300 Subject: [PATCH 09/35] Update Vagrantfile --- Vagrantfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 8b137891..9a0d1671 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1 +1,8 @@ - +Vagrant.configure("2") do |config| + config.vm.box = "hashicorp/precise64" + config.vm.provision "shell", inline: <<-SHELL + export DEBIAN_FRONTEND=noninteractive + sudo apt-get update -y + echo "END OF SCRIPT ..." + SHELL +end From 0a0875f60803bebb5386a444afcba54b8cbab794 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:26:09 -0300 Subject: [PATCH 10/35] Update ci.yml --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc9be7ea..100eefa5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,14 @@ jobs: os: [macos-latest] steps: - uses: actions/checkout@v2 + + - name: Vagrant cache of box + uses: actions/cache@v2 + with: + path: ~/.vagrant.d/boxes + key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }} + restore-keys: | + ${{ runner.os }}-vagrant- - name: Vagrant version run: vagrant --version From 7a138b90c1e8af8b6e1aa757cefe0766ec500b70 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:26:51 -0300 Subject: [PATCH 11/35] Update Vagrantfile --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 9a0d1671..c87b8d4b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,5 +1,5 @@ Vagrant.configure("2") do |config| - config.vm.box = "hashicorp/precise64" + config.vm.box = "ubuntu/focal64" config.vm.provision "shell", inline: <<-SHELL export DEBIAN_FRONTEND=noninteractive sudo apt-get update -y From 8a8f7f1798a788c53e77521b37cad71edf0fd769 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:32:44 -0300 Subject: [PATCH 12/35] Update Vagrantfile --- Vagrantfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index c87b8d4b..4fdb2496 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,7 +2,9 @@ Vagrant.configure("2") do |config| config.vm.box = "ubuntu/focal64" config.vm.provision "shell", inline: <<-SHELL export DEBIAN_FRONTEND=noninteractive + export RUNNER_OS=Linux sudo apt-get update -y + sudo apt-get install docker.io docker-compose ruby echo "END OF SCRIPT ..." SHELL end From 3042d03b9309e696cd96f424f6813d2e5ab4f890 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:36:37 -0300 Subject: [PATCH 13/35] Update Vagrantfile --- Vagrantfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 4fdb2496..60a664e3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,7 +4,9 @@ Vagrant.configure("2") do |config| export DEBIAN_FRONTEND=noninteractive export RUNNER_OS=Linux sudo apt-get update -y - sudo apt-get install docker.io docker-compose ruby + sudo apt-get install -y docker.io docker-compose ruby + cd /vagrant + bundle install echo "END OF SCRIPT ..." SHELL end From 381ceff1257aa4e9a40753dbffbe8124cb98458d Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:37:45 -0300 Subject: [PATCH 14/35] Update ci.yml --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 100eefa5..4bcf85f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,5 +25,14 @@ jobs: - name: Vagrant up run: vagrant up - - name: Test Vagrant ouput - run: vagrant ssh -c "echo 'hello world!'" + - name: Vagrant ouput - Docker + run: vagrant ssh -c "docker --version" + + - name: Vagrant ouput - Docker compose + run: vagrant ssh -c "docker-compose --version" + + - name: Vagrant ouput - Ruby + run: vagrant ssh -c "ruby --version" + + - name: Vagrant ouput - Bundler + run: vagrant ssh -c "bundler --version" From 93921e788426ccc8517147b69e5acd1e840395db Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:44:06 -0300 Subject: [PATCH 15/35] Update Vagrantfile --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 60a664e3..e6fe737d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,8 +5,8 @@ Vagrant.configure("2") do |config| export RUNNER_OS=Linux sudo apt-get update -y sudo apt-get install -y docker.io docker-compose ruby + gem install bundler cd /vagrant bundle install - echo "END OF SCRIPT ..." SHELL end From 9744006ef6a12195b76486a97e36e949745388fe Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:55:00 -0300 Subject: [PATCH 16/35] Update Vagrantfile --- Vagrantfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index e6fe737d..edeee200 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,7 +2,6 @@ Vagrant.configure("2") do |config| config.vm.box = "ubuntu/focal64" config.vm.provision "shell", inline: <<-SHELL export DEBIAN_FRONTEND=noninteractive - export RUNNER_OS=Linux sudo apt-get update -y sudo apt-get install -y docker.io docker-compose ruby gem install bundler From 957bb90214ede72eb8185b3c7a79afdc97ed1bd1 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 16:57:21 -0300 Subject: [PATCH 17/35] Update ci.yml --- .github/workflows/ci.yml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bcf85f9..7d9814af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,20 +4,9 @@ on: [push, pull_request] jobs: vagrantfile: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest] + runs-on: macos-latest steps: - uses: actions/checkout@v2 - - - name: Vagrant cache of box - uses: actions/cache@v2 - with: - path: ~/.vagrant.d/boxes - key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }} - restore-keys: | - ${{ runner.os }}-vagrant- - name: Vagrant version run: vagrant --version @@ -25,14 +14,17 @@ jobs: - name: Vagrant up run: vagrant up - - name: Vagrant ouput - Docker + - name: Vagrant output - Docker run: vagrant ssh -c "docker --version" - - name: Vagrant ouput - Docker compose + - name: Vagrant output - Docker compose run: vagrant ssh -c "docker-compose --version" - - name: Vagrant ouput - Ruby + - name: Vagrant output - Ruby run: vagrant ssh -c "ruby --version" - - name: Vagrant ouput - Bundler + - name: Vagrant output - Bundler run: vagrant ssh -c "bundler --version" + + - name: Vagrant output - Linux-only tests + run: vagrant ssh -c "cd /vagrant/ && RUNNER_OS=Linux bundle exec rake" From 7c113a5e7d478223925c50b0e1549d36f7f4e928 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 17:16:00 -0300 Subject: [PATCH 18/35] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d9814af..246d92ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,4 +27,4 @@ jobs: run: vagrant ssh -c "bundler --version" - name: Vagrant output - Linux-only tests - run: vagrant ssh -c "cd /vagrant/ && RUNNER_OS=Linux bundle exec rake" + run: vagrant ssh -c "sudo su && cd /vagrant/ && RUNNER_OS=Linux bundle exec rake" From dc7ea7974b5d72959a517524406575bbf0ef0e44 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 17:21:14 -0300 Subject: [PATCH 19/35] Update ci.yml --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 246d92ae..e4cb5de4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,9 +14,12 @@ jobs: - name: Vagrant up run: vagrant up - - name: Vagrant output - Docker + - name: Vagrant output - Docker Engine run: vagrant ssh -c "docker --version" + - name: Vagrant output - Docker Daemon + run: vagrant ssh -c "sudo systemctl start dockerd && systemctl status dockerd" + - name: Vagrant output - Docker compose run: vagrant ssh -c "docker-compose --version" From 495a22259fc129b790bc0f89317bf328891f5fa4 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 17:24:20 -0300 Subject: [PATCH 20/35] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4cb5de4..1ac1c633 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: run: vagrant ssh -c "docker --version" - name: Vagrant output - Docker Daemon - run: vagrant ssh -c "sudo systemctl start dockerd && systemctl status dockerd" + run: vagrant ssh -c "sudo systemctl start docker && systemctl status docker" - name: Vagrant output - Docker compose run: vagrant ssh -c "docker-compose --version" From f2800a54ffc0d31874d61b776a66ac8daa2b8781 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 17:32:25 -0300 Subject: [PATCH 21/35] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ac1c633..17847b03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,4 +30,4 @@ jobs: run: vagrant ssh -c "bundler --version" - name: Vagrant output - Linux-only tests - run: vagrant ssh -c "sudo su && cd /vagrant/ && RUNNER_OS=Linux bundle exec rake" + run: vagrant ssh -c "sudo su && cd /vagrant/ && RUNNER_OS=Linux DOCKER_HOST=127.0.0.1 bundle exec rake" From c3c594467aab783c4215867c693be34cd2e62c20 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 17:42:03 -0300 Subject: [PATCH 22/35] Update ci.yml --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17847b03..f0644f1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,6 @@ jobs: - name: Vagrant output - Docker Engine run: vagrant ssh -c "docker --version" - - name: Vagrant output - Docker Daemon - run: vagrant ssh -c "sudo systemctl start docker && systemctl status docker" - - name: Vagrant output - Docker compose run: vagrant ssh -c "docker-compose --version" @@ -30,4 +27,4 @@ jobs: run: vagrant ssh -c "bundler --version" - name: Vagrant output - Linux-only tests - run: vagrant ssh -c "sudo su && cd /vagrant/ && RUNNER_OS=Linux DOCKER_HOST=127.0.0.1 bundle exec rake" + run: vagrant ssh -c "sudo su && cd /vagrant/ && RUNNER_OS=Linux bundle exec rake" From 92cea26c958723e9d3bf1744ec6c783638b859f3 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Mon, 26 Jul 2021 17:42:28 -0300 Subject: [PATCH 23/35] Update Vagrantfile --- Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Vagrantfile b/Vagrantfile index edeee200..b820a00c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,6 +4,7 @@ Vagrant.configure("2") do |config| export DEBIAN_FRONTEND=noninteractive sudo apt-get update -y sudo apt-get install -y docker.io docker-compose ruby + sudo service docker restart gem install bundler cd /vagrant bundle install From 01e42b8decb55d9665ef59655319a028924f1740 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 27 Jul 2021 15:31:12 -0300 Subject: [PATCH 24/35] Update Vagrantfile --- Vagrantfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Vagrantfile b/Vagrantfile index b820a00c..880ca312 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,6 +4,7 @@ Vagrant.configure("2") do |config| export DEBIAN_FRONTEND=noninteractive sudo apt-get update -y sudo apt-get install -y docker.io docker-compose ruby + sudo chmod 666 /var/run/docker.sock sudo service docker restart gem install bundler cd /vagrant From 30b156bb672bcb52d6f52bda20f18196f8007e4e Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 27 Jul 2021 15:54:48 -0300 Subject: [PATCH 25/35] Update README.md --- README.md | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 38c63243..1598bdac 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +[![CI](https://github.com/zakird/wkhtmltopdf_binary_gem/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/zakird/wkhtmltopdf_binary_gem/actions/workflows/ci.yml) +[![Vagrantfile](https://github.com/zakird/wkhtmltopdf_binary_gem/actions/workflows/vagrantfile.yml/badge.svg?branch=master)](https://github.com/zakird/wkhtmltopdf_binary_gem/actions/workflows/vagrantfile.yml) +[![Gem Version](https://badge.fury.io/rb/wkhtmltopdf-binary.svg)](https://badge.fury.io/rb/wkhtmltopdf-binary) +[![Gem](https://img.shields.io/gem/dt/wkhtmltopdf-binary.svg)]() +[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/zakird/wkhtmltopdf_binary_gem) + # Installation and usage Install in your Gemfile as usual @@ -9,25 +15,23 @@ gem 'wkhtmltopdf-binary' In many environments, this is all you need to do. This gem installs a binary stub that tries to determine which wkhtmltopdf binary will work on your system, and point to the packaged binary that most closely matches. In some environments, invoking this binary will result in an error, saying the needed permissions are not available. -This is because `wkhtmltopdf-binary` ships with gzipped binaries for many platforms, and then picks the appropriate one -upon first use and unzips it into the same directory. So if your ruby gem binaries are installed here: +This is because `wkhtmltopdf-binary` ships with gzipped binaries for many platforms, and then picks the appropriate one upon first use and unzips it into the same directory. So if your ruby gem binaries are installed here (for example, considering Ruby 2.6 and gem in version 0.12.6.5): /usr/lib/ruby/versions/2.6/bin/ The various wkhtmltopdf-binaries will be installed here: - /usr/lib/ruby/versions/2.6/lib/ruby/gems/2.6.0/gems/wkhtmltopdf-binary-0.12.5.1/bin/ + /usr/lib/ruby/versions/2.6/lib/ruby/gems/2.6.0/gems/wkhtmltopdf-binary-0.12.6.5/bin/ -Giving write access whatever user is running your program (e.g. web server, background job processor), -e.g. your own personal user in a dev environment, will fix the problem. After the binary is uncompressed, write access can be revoked again if desired. +Giving write access whatever user is running your program (e.g. web server, background job processor), e.g. your own personal user in a dev environment, will fix the problem. After the binary is uncompressed, write access can be revoked again if desired. - chmod -R 777 /usr/lib/ruby/versions/2.6/lib/ruby/gems/2.6.0/gems/wkhtmltopdf-binary-0.12.5.1/bin/ + chmod -R 777 /usr/lib/ruby/versions/2.6/lib/ruby/gems/2.6.0/gems/wkhtmltopdf-binary-0.12.6.5/bin/ # Gem Development ## Extracting binaries -Hints for extracting binaries from https://wkhtmltopdf.org/downloads.html (dpkg and rpm2cpio is available on Homebrew). +Hints for extracting binaries from https://wkhtmltopdf.org/downloads.html (dpkg and rpm2cpio is available on Homebrew): Debian/Ubuntu @@ -37,7 +41,7 @@ CentOS rpm2cpio wkhtmltox-0.12.5-1.centos7.x86_64.rpm | cpio -idmv -Archlinux/manjaro +Archlinux/Manjaro tar -xf wkhtmltox-0.12.6-1.archlinux.x86_64.tar.xz @@ -46,25 +50,23 @@ macOS xar -xf wkhtmltox-0.12.5-1.macos-cocoa.pkg cat Payload | gunzip -dc | cpio -i -## Compression +## GZIP Compression Binaries should be compressed with `gzip --best` after extracting. The matching binary will be extracted on first execution of `bin/wkhtmltopdf`. ## Testing -To execute gem tests locally, install in your OS: +To execute gem tests locally, install: -- Docker -- Docker compose -- Ruby -- Bundler +- VirtualBox +- Vagrant Then, execute the commands below: ```bash git clone https://github.com/zakird/wkhtmltopdf_binary_gem cd wkhtmltopdf_binary_gem/ -bundle install -bundle exec rake +vagrant up +vagrant ssh -c 'bundle exec rake' ``` From 8d8757fbc24aa60622cf4651dec786389d7fa952 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 27 Jul 2021 15:55:42 -0300 Subject: [PATCH 26/35] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0644f1e..b6358142 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,4 +27,4 @@ jobs: run: vagrant ssh -c "bundler --version" - name: Vagrant output - Linux-only tests - run: vagrant ssh -c "sudo su && cd /vagrant/ && RUNNER_OS=Linux bundle exec rake" + run: vagrant ssh -c "bundle exec rake" From 0fe2682d857ce7536cd938238307289b051a129a Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 27 Jul 2021 16:01:23 -0300 Subject: [PATCH 27/35] Update Vagrantfile --- Vagrantfile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 880ca312..f322c9c9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,11 +1,25 @@ Vagrant.configure("2") do |config| config.vm.box = "ubuntu/focal64" config.vm.provision "shell", inline: <<-SHELL - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update -y + cat >> /etc/profile.d/wkhtmltopdf_binary_gem.sh <> /home/vagrant/.bashrc < Date: Tue, 27 Jul 2021 16:02:18 -0300 Subject: [PATCH 28/35] Update ci.yml --- .github/workflows/ci.yml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6358142..67397acf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,28 +3,22 @@ name: CI on: [push, pull_request] jobs: - vagrantfile: - runs-on: macos-latest + tests: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0] steps: - uses: actions/checkout@v2 - - name: Vagrant version - run: vagrant --version + - name: Install Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} - - name: Vagrant up - run: vagrant up + - name: Install dependencies + run: bundle install - - name: Vagrant output - Docker Engine - run: vagrant ssh -c "docker --version" - - - name: Vagrant output - Docker compose - run: vagrant ssh -c "docker-compose --version" - - - name: Vagrant output - Ruby - run: vagrant ssh -c "ruby --version" - - - name: Vagrant output - Bundler - run: vagrant ssh -c "bundler --version" - - - name: Vagrant output - Linux-only tests - run: vagrant ssh -c "bundle exec rake" + - name: Run tests with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} + run: bundle exec rake From 62113d1de285820c461c8f6f6e21931b91e94547 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 27 Jul 2021 16:04:02 -0300 Subject: [PATCH 29/35] Create vagrantfile.yml --- .github/workflows/vagrantfile.yml | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/vagrantfile.yml diff --git a/.github/workflows/vagrantfile.yml b/.github/workflows/vagrantfile.yml new file mode 100644 index 00000000..5cd07b2f --- /dev/null +++ b/.github/workflows/vagrantfile.yml @@ -0,0 +1,32 @@ +name: Vagrantfile + +on: + push: + branches: [master, vagrantfile] + +jobs: + tests: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + + - name: Vagrant version + run: vagrant --version + + - name: Vagrant up + run: vagrant up + + - name: Vagrant output - Docker Engine + run: vagrant ssh -c "docker --version" + + - name: Vagrant output - Docker compose + run: vagrant ssh -c "docker-compose --version" + + - name: Vagrant output - Ruby + run: vagrant ssh -c "ruby --version" + + - name: Vagrant output - Bundler + run: vagrant ssh -c "bundler --version" + + - name: Vagrant output - Linux tests + run: vagrant ssh -c "bundle exec rake" From 462b657695a4df56a83a3f8df20aef9686151d30 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 27 Jul 2021 16:13:25 -0300 Subject: [PATCH 30/35] Update vagrantfile.yml --- .github/workflows/vagrantfile.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/vagrantfile.yml b/.github/workflows/vagrantfile.yml index 5cd07b2f..ccc4377e 100644 --- a/.github/workflows/vagrantfile.yml +++ b/.github/workflows/vagrantfile.yml @@ -28,5 +28,11 @@ jobs: - name: Vagrant output - Bundler run: vagrant ssh -c "bundler --version" + - name: Vagrant output - Default user + run: vagrant ssh -c "whoami" + + - name: Vagrant output - Default folder + run: vagrant ssh -c "pwd" + - name: Vagrant output - Linux tests run: vagrant ssh -c "bundle exec rake" From 9b9508150f253347ccacf1a253cf2278637acb8b Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 27 Jul 2021 17:29:32 -0300 Subject: [PATCH 31/35] Update Vagrantfile --- Vagrantfile | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index f322c9c9..8f0b6059 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,22 +1,7 @@ Vagrant.configure("2") do |config| config.vm.box = "ubuntu/focal64" config.vm.provision "shell", inline: <<-SHELL - cat >> /etc/profile.d/wkhtmltopdf_binary_gem.sh <> /home/vagrant/.bashrc < Date: Tue, 27 Jul 2021 17:30:06 -0300 Subject: [PATCH 32/35] Update vagrantfile.yml --- .github/workflows/vagrantfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vagrantfile.yml b/.github/workflows/vagrantfile.yml index ccc4377e..469ef6eb 100644 --- a/.github/workflows/vagrantfile.yml +++ b/.github/workflows/vagrantfile.yml @@ -35,4 +35,4 @@ jobs: run: vagrant ssh -c "pwd" - name: Vagrant output - Linux tests - run: vagrant ssh -c "bundle exec rake" + run: vagrant ssh -c "sudo su && cd /vagrant && RUNNER_OS=Linux bundle exec rake" From aa8210625f9b0684736221d98c017245eb54257f Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 27 Jul 2021 17:30:29 -0300 Subject: [PATCH 33/35] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1598bdac..485b703c 100644 --- a/README.md +++ b/README.md @@ -68,5 +68,5 @@ Then, execute the commands below: git clone https://github.com/zakird/wkhtmltopdf_binary_gem cd wkhtmltopdf_binary_gem/ vagrant up -vagrant ssh -c 'bundle exec rake' +vagrant ssh -c "sudo su && cd /vagrant && RUNNER_OS=Linux bundle exec rake" ``` From 4c477a45ab00736834ef633085bf4a18de43e35e Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 27 Jul 2021 18:19:10 -0300 Subject: [PATCH 34/35] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 485b703c..301ce128 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Giving write access whatever user is running your program (e.g. web server, back ## Extracting binaries -Hints for extracting binaries from https://wkhtmltopdf.org/downloads.html (dpkg and rpm2cpio is available on Homebrew): +Hints for extracting binaries from https://wkhtmltopdf.org/downloads.html (dpkg and rpm2cpio is available on Homebrew). Debian/Ubuntu From c570b2373eb88f1e804941424c76ae7f43a6717d Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Tue, 27 Jul 2021 18:42:51 -0300 Subject: [PATCH 35/35] Update vagrantfile.yml --- .github/workflows/vagrantfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vagrantfile.yml b/.github/workflows/vagrantfile.yml index 469ef6eb..ee7dc00a 100644 --- a/.github/workflows/vagrantfile.yml +++ b/.github/workflows/vagrantfile.yml @@ -2,7 +2,7 @@ name: Vagrantfile on: push: - branches: [master, vagrantfile] + branches: [master] jobs: tests: