Skip to content

Commit

Permalink
Remove wkhtmltopdf-binary gem and wicked configuration (decidim#13616)
Browse files Browse the repository at this point in the history
* Remove wkhtmltopdf-binary gem and wicked configuration

* Update installation doc

* Add release notes note

* Add wkhtmltopdf package in CI configuration
  • Loading branch information
andreslucena authored Nov 7, 2024
1 parent fe8de3c commit f57ea66
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ jobs:
with:
chromedriver-version: ${{inputs.chrome_version}}
name: Install Chrome version ${{inputs.chrome_version}}
- run: |
sudo apt install wkhtmltopdf
- uses: actions/cache@v4
id: app-cache
with:
Expand Down
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ PATH
decidim-core (= 0.30.0.dev)
decidim-meetings (= 0.30.0.dev)
wicked_pdf (~> 2.7)
wkhtmltopdf-binary (= 0.12.6.6)
decidim-core (0.30.0.dev)
active_link_to (~> 1.0)
acts_as_list (~> 1.0)
Expand Down Expand Up @@ -152,7 +151,6 @@ PATH
decidim-forms (0.30.0.dev)
decidim-core (= 0.30.0.dev)
wicked_pdf (~> 2.1)
wkhtmltopdf-binary (= 0.12.6.6)
decidim-generators (0.30.0.dev)
decidim-core (= 0.30.0.dev)
decidim-initiatives (0.30.0.dev)
Expand All @@ -162,7 +160,6 @@ PATH
decidim-verifications (= 0.30.0.dev)
hexapdf (~> 0.32.0)
wicked_pdf (~> 2.1)
wkhtmltopdf-binary (= 0.12.6.6)
decidim-meetings (0.30.0.dev)
decidim-core (= 0.30.0.dev)
decidim-forms (= 0.30.0.dev)
Expand Down Expand Up @@ -788,7 +785,6 @@ GEM
activesupport
wisper (2.0.1)
wisper-rspec (1.1.0)
wkhtmltopdf-binary (0.12.6.6)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.18)
Expand Down
13 changes: 13 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ gem "decidim-dev", github: "decidim/decidim"

```console
sudo apt install p7zip # or the alternative installation process for your operating system. See "2.1. 7zip dependency introduction"
sudo apt install wkhtmltopdf # or the alternative installation process for your operating system. See "2.7. wkhtmltopdf binary change"
bundle remove spring spring-watcher-listen
bundle update decidim
bin/rails decidim:upgrade
Expand Down Expand Up @@ -110,6 +111,18 @@ bin/rails decidim_proposals:upgrade:set_categories

You can read more about this change on PR [#13395](https://github.com/decidim/decidim/pull/13395).

### 2.7. wkhtmltopdf binary change

For improving the support with latest versions of Ubuntu, and keeping a low size in Heroku/Docker images, we removed the `wkhtmltopdf-binary` gem dependency. This means that your package manager should have the `wkhtmltopdf` binary installed.

In the case of Ubuntu/Debian, this is done with the following command:

```bash
sudo apt install wkhtmltopdf
```

You can read more about this change on PR [#XXXX](https://github.com/decidim/decidim/pull/XXXX).

## 3. One time actions

These are one time actions that need to be done after the code is updated in the production database.
Expand Down
1 change: 0 additions & 1 deletion decidim-conferences/config/initializers/wicked_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# one of the wkhtmltopdf-binary family of gems.
# or
# config.exe_path = '/usr/local/bin/wkhtmltopdf',
config.exe_path = Gem.bin_path("wkhtmltopdf-binary", "wkhtmltopdf")

# Layout file to be used for all PDFs
# (but can be overridden in `render :pdf` calls)
Expand Down
4 changes: 0 additions & 4 deletions decidim-conferences/decidim-conferences.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ Gem::Specification.new do |s|
s.add_dependency "decidim-core", Decidim::Conferences.version
s.add_dependency "decidim-meetings", Decidim::Conferences.version
s.add_dependency "wicked_pdf", "~> 2.7"
# Latest version of wkhtmltopdf-binary downloads more versions of the binary
# This brings problems with deployment in certain environments, as Heroku
# Hopefully they will fix this situation soon
s.add_dependency "wkhtmltopdf-binary", "= 0.12.6.6"

s.add_development_dependency "decidim-admin", Decidim::Conferences.version
s.add_development_dependency "decidim-dev", Decidim::Conferences.version
Expand Down
1 change: 0 additions & 1 deletion decidim-forms/config/initializers/wicked_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# one of the wkhtmltopdf-binary family of gems.
# or
# config.exe_path = '/usr/local/bin/wkhtmltopdf',
config.exe_path = Gem.bin_path("wkhtmltopdf-binary", "wkhtmltopdf")

# Layout file to be used for all PDFs
# (but can be overridden in `render :pdf` calls)
Expand Down
4 changes: 0 additions & 4 deletions decidim-forms/decidim-forms.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ Gem::Specification.new do |s|

s.add_dependency "decidim-core", Decidim::Forms.version
s.add_dependency "wicked_pdf", "~> 2.1"
# Latest version of wkhtmltopdf-binary downloads more versions of the binary
# This brings problems with deployment in certain environments, as Heroku
# Hopefully they will fix this situation soon
s.add_dependency "wkhtmltopdf-binary", "= 0.12.6.6"

s.add_development_dependency "decidim-admin", Decidim::Forms.version
s.add_development_dependency "decidim-dev", Decidim::Forms.version
Expand Down
4 changes: 0 additions & 4 deletions decidim-generators/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ PATH
decidim-core (= 0.30.0.dev)
decidim-meetings (= 0.30.0.dev)
wicked_pdf (~> 2.7)
wkhtmltopdf-binary (= 0.12.6.6)
decidim-core (0.30.0.dev)
active_link_to (~> 1.0)
acts_as_list (~> 1.0)
Expand Down Expand Up @@ -152,7 +151,6 @@ PATH
decidim-forms (0.30.0.dev)
decidim-core (= 0.30.0.dev)
wicked_pdf (~> 2.1)
wkhtmltopdf-binary (= 0.12.6.6)
decidim-generators (0.30.0.dev)
decidim-core (= 0.30.0.dev)
decidim-initiatives (0.30.0.dev)
Expand All @@ -162,7 +160,6 @@ PATH
decidim-verifications (= 0.30.0.dev)
hexapdf (~> 0.32.0)
wicked_pdf (~> 2.1)
wkhtmltopdf-binary (= 0.12.6.6)
decidim-meetings (0.30.0.dev)
decidim-core (= 0.30.0.dev)
decidim-forms (= 0.30.0.dev)
Expand Down Expand Up @@ -790,7 +787,6 @@ GEM
activesupport
wisper (2.0.1)
wisper-rspec (1.1.0)
wkhtmltopdf-binary (0.12.6.6)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.18)
Expand Down
1 change: 0 additions & 1 deletion decidim-initiatives/config/initializers/wicked_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# one of the wkhtmltopdf-binary family of gems.
# or
# config.exe_path = '/usr/local/bin/wkhtmltopdf',
config.exe_path = Gem.bin_path("wkhtmltopdf-binary", "wkhtmltopdf")

# Layout file to be used for all PDFs
# (but can be overridden in `render :pdf` calls)
Expand Down
4 changes: 0 additions & 4 deletions decidim-initiatives/decidim-initiatives.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ Gem::Specification.new do |s|
s.add_dependency "decidim-verifications", Decidim::Initiatives.version
s.add_dependency "hexapdf", "~> 0.32.0"
s.add_dependency "wicked_pdf", "~> 2.1"
# Latest version of wkhtmltopdf-binary downloads more versions of the binary
# This brings problems with deployment in certain environments, as Heroku
# Hopefully they will fix this situation soon
s.add_dependency "wkhtmltopdf-binary", "= 0.12.6.6"

s.add_development_dependency "decidim-dev", Decidim::Initiatives.version
s.add_development_dependency "decidim-meetings", Decidim::Initiatives.version
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/install/pages/manual.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ First, we are going to install https://github.com/rbenv/rbenv[rbenv], for managi
[source,bash]
----
sudo apt update
sudo apt install -y build-essential curl git libssl-dev zlib1g-dev p7zip
sudo apt install -y build-essential curl git libssl-dev zlib1g-dev p7zip wkhtmltopdf
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
Expand Down

0 comments on commit f57ea66

Please sign in to comment.