Skip to content

Commit f74e3c6

Browse files
authored
Add separate arm32v7 Dockerfile (#8)
1 parent 8852578 commit f74e3c6

File tree

7 files changed

+52
-34
lines changed

7 files changed

+52
-34
lines changed

app/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module.exports = class extends Generator {
6969
this._copyStatic('gitignore', '.gitignore');
7070
this._copyStatic('app.js');
7171
this._copyStatic('Dockerfile');
72+
this._copyStatic('Dockerfile.arm32v7');
7273
this._copyStatic('Dockerfile.windows-amd64');
7374

7475
this._copyTemplate('module.json', { repository: this.repository });

app/templates/Dockerfile.arm32v7

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM arm32v7/node:8
2+
3+
WORKDIR /app/
4+
5+
COPY package*.json ./
6+
7+
RUN npm install --production
8+
9+
COPY app.js ./
10+
11+
USER node
12+
13+
ENV DEBUG_OPTION " "
14+
15+
CMD ["sh", "-c", "node $DEBUG_OPTION app.js"]

app/templates/module.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"version": "0.0.1",
88
"platforms": {
99
"amd64": "./Dockerfile",
10-
"arm32v7": "./Dockerfile",
10+
"arm32v7": "./Dockerfile.arm32v7",
1111
"windows-amd64": "./Dockerfile.windows-amd64"
1212
}
1313
},

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-azure-iot-edge-module",
3-
"version": "1.0.0-rc2",
3+
"version": "1.0.0-rc3",
44
"description": "Yeoman generator for Azure IoT Edge Node module",
55
"files": [
66
"app"

test/assets/module.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"version": "0.0.1",
88
"platforms": {
99
"amd64": "./Dockerfile",
10-
"arm32v7": "./Dockerfile",
10+
"arm32v7": "./Dockerfile.arm32v7",
1111
"windows-amd64": "./Dockerfile.windows-amd64"
1212
}
1313
},

test/test-app.js

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
1-
"use strict";
1+
'use strict';
22

3-
var assert = require("yeoman-assert");
4-
var fs = require("fs");
5-
var helpers = require("yeoman-test");
6-
var path = require("path");
3+
var assert = require('yeoman-assert');
4+
var fs = require('fs');
5+
var helpers = require('yeoman-test');
6+
var path = require('path');
77

8-
describe("generator-azure-iot-edge-module: app", function () {
9-
it("should generate module files with prompts", function () {
10-
return helpers.run(path.join(__dirname, "../app"))
8+
describe('generator-azure-iot-edge-module: app', function () {
9+
it('should generate module files with prompts', function () {
10+
return helpers.run(path.join(__dirname, '../app'))
1111
.withPrompts({
12-
name: "TestModule",
13-
repository: "localhost:5555/TestModule"
12+
name: 'TestModule',
13+
repository: 'localhost:5555/TestModule'
1414
})
1515
.then(() => {
1616
assert.file([
17-
"TestModule/.gitignore",
18-
"TestModule/app.js",
19-
"TestModule/Dockerfile",
20-
"TestModule/Dockerfile.windows-amd64",
21-
"TestModule/module.json",
22-
"TestModule/package.json"
17+
'TestModule/.gitignore',
18+
'TestModule/app.js',
19+
'TestModule/Dockerfile',
20+
'TestModule/Dockerfile.arm32v7',
21+
'TestModule/Dockerfile.windows-amd64',
22+
'TestModule/module.json',
23+
'TestModule/package.json'
2324
]);
2425

25-
assert.jsonFileContent("TestModule/module.json", JSON.parse(fs.readFileSync(path.join(__dirname, "assets/module.json"), "utf-8")));
26-
assert.jsonFileContent("TestModule/package.json", JSON.parse(fs.readFileSync(path.join(__dirname, "assets/package.json"), "utf-8")));
26+
assert.jsonFileContent('TestModule/module.json', JSON.parse(fs.readFileSync(path.join(__dirname, 'assets/module.json'), 'utf-8')));
27+
assert.jsonFileContent('TestModule/package.json', JSON.parse(fs.readFileSync(path.join(__dirname, 'assets/package.json'), 'utf-8')));
2728
});
2829
});
2930

30-
it("should generate module files with options", function () {
31-
return helpers.run(path.join(__dirname, "../app"))
31+
it('should generate module files with options', function () {
32+
return helpers.run(path.join(__dirname, '../app'))
3233
.withOptions({
33-
name: "TestModule",
34-
repository: "localhost:5555/TestModule"
34+
name: 'TestModule',
35+
repository: 'localhost:5555/TestModule'
3536
})
3637
.then(() => {
3738
assert.file([
38-
"TestModule/.gitignore",
39-
"TestModule/app.js",
40-
"TestModule/Dockerfile",
41-
"TestModule/Dockerfile.windows-amd64",
42-
"TestModule/module.json",
43-
"TestModule/package.json"
39+
'TestModule/.gitignore',
40+
'TestModule/app.js',
41+
'TestModule/Dockerfile',
42+
'TestModule/Dockerfile.arm32v7',
43+
'TestModule/Dockerfile.windows-amd64',
44+
'TestModule/module.json',
45+
'TestModule/package.json'
4446
]);
4547

46-
assert.jsonFileContent("TestModule/module.json", JSON.parse(fs.readFileSync(path.join(__dirname, "assets/module.json"), "utf-8")));
47-
assert.jsonFileContent("TestModule/package.json", JSON.parse(fs.readFileSync(path.join(__dirname, "assets/package.json"), "utf-8")));
48+
assert.jsonFileContent('TestModule/module.json', JSON.parse(fs.readFileSync(path.join(__dirname, 'assets/module.json'), 'utf-8')));
49+
assert.jsonFileContent('TestModule/package.json', JSON.parse(fs.readFileSync(path.join(__dirname, 'assets/package.json'), 'utf-8')));
4850
});
4951
});
5052
});

0 commit comments

Comments
 (0)