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 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 Mergebot (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 Mergebot (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 Mergebot (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
diff --git a/image/build_scripts/build_app b/image/build_scripts/build_app
index cb0f0e0..9d6d04a 100755
--- a/image/build_scripts/build_app
+++ b/image/build_scripts/build_app
@@ -14,9 +14,10 @@ cd ${CONTAINER_APP_ROOT}
14git clone --depth 1 --branch ${CONTAINER_APP_VERSION} https://github.com/discourse/discourse.git ${CONTAINER_APP_VERSION}14git clone --depth 1 --branch ${CONTAINER_APP_VERSION} https://github.com/discourse/discourse.git ${CONTAINER_APP_VERSION}
1515
16# Apply patch for LP#190369516# Apply patch for LP#1903695
17cd ${CONTAINER_APP_VERSION}17git -C "${CONTAINER_APP_VERSION}" apply /srv/build_scripts/lp1903695.patch
18git apply /srv/build_scripts/lp1903695.patch18
19cd ${CONTAINER_APP_ROOT}19# Apply patch to use terser rather than uglifier
20git -C "${CONTAINER_APP_VERSION}" apply /srv/build_scripts/terser.patch
2021
21chown -R ${CONTAINER_APP_USERNAME}:${CONTAINER_APP_GROUP} ${CONTAINER_APP_VERSION}22chown -R ${CONTAINER_APP_USERNAME}:${CONTAINER_APP_GROUP} ${CONTAINER_APP_VERSION}
22ln -s ${CONTAINER_APP_ROOT}/${CONTAINER_APP_VERSION} app23ln -s ${CONTAINER_APP_ROOT}/${CONTAINER_APP_VERSION} app
diff --git a/image/build_scripts/get_app_dependencies b/image/build_scripts/get_app_dependencies
index 0c78012..8f9a0f6 100755
--- a/image/build_scripts/get_app_dependencies
+++ b/image/build_scripts/get_app_dependencies
@@ -16,6 +16,7 @@ apt-get install -y brotli \
16 libxml2-dev \16 libxml2-dev \
17 libxslt1-dev \17 libxslt1-dev \
18 libz-dev \18 libz-dev \
19 node-terser \
19 node-uglify \20 node-uglify \
20 optipng \21 optipng \
21 pngquant \22 pngquant \
diff --git a/image/build_scripts/terser.patch b/image/build_scripts/terser.patch
22new file mode 10064423new file mode 100644
index 0000000..55e20ff
--- /dev/null
+++ b/image/build_scripts/terser.patch
@@ -0,0 +1,13 @@
1diff --git a/config/environments/production.rb b/config/environments/production.rb
2index a523888a8d..7f41985b17 100644
3--- a/config/environments/production.rb
4+++ b/config/environments/production.rb
5@@ -14,7 +14,7 @@ Discourse::Application.configure do
6 # Disable Rails's static asset server (Apache or nginx will already do this)
7 config.public_file_server.enabled = GlobalSetting.serve_static_assets || false
8
9- config.assets.js_compressor = :uglifier
10+ config.assets.js_compressor = :terser
11
12 # stuff should be pre-compiled
13 config.assets.compile = false

Subscribers

People subscribed via source and target branches