Merge ~barryprice/charm-k8s-discourse/+git/charm-k8s-discourse:master into charm-k8s-discourse:master

Proposed by Barry Price
Status: Merged
Approved by: Romain Couturat
Approved revision: 37b98a2424527ab37d1e8dfda481bdb78683f8f9
Merged at revision: 6cac70c95ff72b74107ba4068a628f06a7091870
Proposed branch: ~barryprice/charm-k8s-discourse/+git/charm-k8s-discourse:master
Merge into: charm-k8s-discourse:master
Diff against target: 49 lines (+18/-3)
3 files modified
image/build_scripts/build_app (+4/-3)
image/build_scripts/get_app_dependencies (+1/-0)
image/build_scripts/terser.patch (+13/-0)
Reviewer Review Type Date Requested Status
Romain Couturat (community) Approve
🤖 prod-jenkaas-is (community) continuous-integration Needs Fixing
Joel Sing (community) +1 Approve
Canonical IS Reviewers Pending
Review via email: mp+412267@code.launchpad.net

Commit message

Add terser to our image, and use it for asset compression instead of uglifier

To post a comment you must log in.
Revision history for this message
🤖 prod-jenkaas-is (prod-jenkaas-is) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-is (prod-jenkaas-is) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Joel Sing (jsing) wrote :

LGTM, see comment (if it is easily fixed/tested then we can, otherwise ignore it)

review: Approve (+1)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Merge proposal is approved, but source revision has changed, setting status to needs review.

Revision history for this message
🤖 prod-jenkaas-is (prod-jenkaas-is) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-is (prod-jenkaas-is) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Romain Couturat (romaincout) wrote :

lgtm

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 6cac70c95ff72b74107ba4068a628f06a7091870

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/image/build_scripts/build_app b/image/build_scripts/build_app
2index cb0f0e0..9d6d04a 100755
3--- a/image/build_scripts/build_app
4+++ b/image/build_scripts/build_app
5@@ -14,9 +14,10 @@ cd ${CONTAINER_APP_ROOT}
6 git clone --depth 1 --branch ${CONTAINER_APP_VERSION} https://github.com/discourse/discourse.git ${CONTAINER_APP_VERSION}
7
8 # Apply patch for LP#1903695
9-cd ${CONTAINER_APP_VERSION}
10-git apply /srv/build_scripts/lp1903695.patch
11-cd ${CONTAINER_APP_ROOT}
12+git -C "${CONTAINER_APP_VERSION}" apply /srv/build_scripts/lp1903695.patch
13+
14+# Apply patch to use terser rather than uglifier
15+git -C "${CONTAINER_APP_VERSION}" apply /srv/build_scripts/terser.patch
16
17 chown -R ${CONTAINER_APP_USERNAME}:${CONTAINER_APP_GROUP} ${CONTAINER_APP_VERSION}
18 ln -s ${CONTAINER_APP_ROOT}/${CONTAINER_APP_VERSION} app
19diff --git a/image/build_scripts/get_app_dependencies b/image/build_scripts/get_app_dependencies
20index 0c78012..8f9a0f6 100755
21--- a/image/build_scripts/get_app_dependencies
22+++ b/image/build_scripts/get_app_dependencies
23@@ -16,6 +16,7 @@ apt-get install -y brotli \
24 libxml2-dev \
25 libxslt1-dev \
26 libz-dev \
27+ node-terser \
28 node-uglify \
29 optipng \
30 pngquant \
31diff --git a/image/build_scripts/terser.patch b/image/build_scripts/terser.patch
32new file mode 100644
33index 0000000..55e20ff
34--- /dev/null
35+++ b/image/build_scripts/terser.patch
36@@ -0,0 +1,13 @@
37+diff --git a/config/environments/production.rb b/config/environments/production.rb
38+index a523888a8d..7f41985b17 100644
39+--- a/config/environments/production.rb
40++++ b/config/environments/production.rb
41+@@ -14,7 +14,7 @@ Discourse::Application.configure do
42+ # Disable Rails's static asset server (Apache or nginx will already do this)
43+ config.public_file_server.enabled = GlobalSetting.serve_static_assets || false
44+
45+- config.assets.js_compressor = :uglifier
46++ config.assets.js_compressor = :terser
47+
48+ # stuff should be pre-compiled
49+ config.assets.compile = false

Subscribers

People subscribed via source and target branches