Skip to content

Commit 9dc5a73

Browse files
committed
feat: LibreOffice v6.4.0.1 & ca-central-1 region
1 parent 544b4a4 commit 9dc5a73

File tree

6 files changed

+45
-9
lines changed

6 files changed

+45
-9
lines changed

.circleci/config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ jobs:
8282
steps:
8383
- publish
8484

85+
ca_central_1:
86+
executor: aws-cli/default
87+
environment:
88+
TARGET_REGION: ca-central-1
89+
steps:
90+
- publish
91+
8592
workflows:
8693
version: 2
8794
publish:
@@ -148,3 +155,10 @@ workflows:
148155
branches:
149156
only:
150157
- master
158+
159+
- ca_central_1:
160+
context: libreoffice-lambda-layer
161+
filters:
162+
branches:
163+
only:
164+
- master

layer.zip

91.2 MB
Binary file not shown.

publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
LO_VERSION=6.1.0.0.alpha0
3+
LO_VERSION=6.4.0.1
44
LAYER_NAME='libreoffice'
55

66
aws s3 cp ./layer.zip s3://shelf-libreoffice-lambda-layer-"$TARGET_REGION"/layer.zip

readme.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# LibreOffice for AWS Lambda as a layer
22

3-
> 85 MB LibreOffice to fit inside AWS Lambda Layer compressed with Brotli
3+
> 95 MB LibreOffice to fit inside AWS Lambda Layer compressed with Brotli
44
55
Based on the [serverless-libreoffice](https://github.com/vladgolubev/serverless-libreoffice) project.
66

@@ -12,7 +12,7 @@ Click on Layers and choose "Add a layer", and "Provide a layer version
1212
ARN" and enter the following ARN.
1313

1414
```
15-
arn:aws:lambda:us-east-1:764866452798:layer:libreoffice:8
15+
arn:aws:lambda:us-east-1:764866452798:layer:libreoffice:9
1616
```
1717

1818
See the table below for other supported regions.
@@ -21,14 +21,27 @@ Works well with [aws-lambda-libreoffice npm package](https://github.com/shelfio/
2121

2222
## What does this layer contain?
2323

24-
This layer contains `lo.tar.gz` file which is LibreOfficee v6.1.0.0.alpha (https://github.com/vladgolubev/serverless-libreoffice/releases/tag/v6.1.0.0.alpha0).
24+
This layer contains `lo.tar.br` file which is LibreOfficee v6.4.0.1 (https://github.com/vladgolubev/serverless-libreoffice/releases/tag/v6.4.0.1).
2525

2626
## Where is LibreOffice inside of Lambda?
2727

28-
It is at `/opt/lo.tar.gz`.
28+
It is at `/opt/lo.tar.br`.
2929

3030
## Version ARNs
3131

32+
### LibreOffice v6.4.0.1
33+
34+
* `arn:aws:lambda:us-east-1:764866452798:layer:libreoffice:9`
35+
* `arn:aws:lambda:eu-west-1:764866452798:layer:libreoffice:2`
36+
* `arn:aws:lambda:eu-central-1:764866452798:layer:libreoffice:2`
37+
* `arn:aws:lambda:us-west-2:764866452798:layer:libreoffice:2`
38+
* `arn:aws:lambda:us-east-2:764866452798:layer:libreoffice:2`
39+
* `arn:aws:lambda:ap-southeast-2:764866452798:layer:libreoffice:2`
40+
* `arn:aws:lambda:eu-west-2:764866452798:layer:libreoffice:2`
41+
* `arn:aws:lambda:ap-southeast-1:764866452798:layer:libreoffice:2`
42+
* `arn:aws:lambda:ap-south-1:764866452798:layer:libreoffice:2`
43+
* `arn:aws:lambda:ca-central-1:764866452798:layer:libreoffice:1`
44+
3245
### LibreOffice 6.1.0.0.alpha0
3346

3447
* `arn:aws:lambda:us-east-1:764866452798:layer:libreoffice:8`

test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ tar -xvf lo.tar
99

1010
cd ../test
1111

12-
docker run --rm -v "$PWD":/var/task -v "$PWD"/../layer:/opt lambci/lambda:nodejs8.10
12+
docker run --rm \
13+
-v "$PWD":/var/task \
14+
-v "$PWD"/../layer:/opt \
15+
lambci/lambda:nodejs12.x \
16+
index.handler
1317

1418
rm -rf layer

test/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
const {writeFileSync} = require('fs');
22
const {execSync} = require('child_process');
33

4-
const convertCommand = `cd /tmp && /opt/instdir/program/soffice --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --convert-to pdf --outdir /tmp test.txt`;
4+
const convertCommand = `export HOME=/tmp && /opt/instdir/program/soffice.bin --headless --norestore --invisible --nodefault --nofirststartwizard --nolockcheck --nologo --convert-to "pdf:writer_pdf_Export" --outdir /tmp /tmp/test.txt`;
55

6-
exports.handler = () => {
6+
module.exports.handler = () => {
77
writeFileSync('/tmp/test.txt', Buffer.from('Hello World!'));
88

9-
console.log(execSync(convertCommand).toString('utf8'));
9+
try {
10+
console.log(execSync(convertCommand).toString('utf8'));
11+
} catch (e) {
12+
console.log(execSync(convertCommand).toString('utf8'));
13+
}
14+
1015
console.log(execSync('ls -alh /tmp').toString('utf8'));
1116
};

0 commit comments

Comments
 (0)