@iexec/iapp-maker 0.0.1-alpha-nightly-79e0105f6025d93833a45abc311c73fb2b5b6c26 → 0.0.1-alpha-nightly-6be476717b877e4857383c375d5f209dbd288f99

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -14,6 +14,21 @@ This CLI provides an interface to guide you through different steps:
14
14
  (`iapp init` will also propose you to do so)
15
15
  - Docker
16
16
 
17
+ > ℹ️ For MacOS users
18
+ >
19
+ > This tool use `docker buildx` to build images for `linux/amd64` platform
20
+ > compatible with iExec's decentralized workers.
21
+ >
22
+ > Make sure your docker builder supports AMD64 architecture:
23
+ >
24
+ > ```sh
25
+ > docker buildx inspect --bootstrap | grep -i platforms
26
+ > ```
27
+ >
28
+ > The output should include `linux/amd64` in the list of supported platforms. If
29
+ > not update te the latest Docker Desktop version which includes these
30
+ > requirements.
31
+
17
32
  ## Install
18
33
 
19
34
  ```sh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iexec/iapp-maker",
3
- "version": "0.0.1-alpha-nightly-79e0105f6025d93833a45abc311c73fb2b5b6c26",
3
+ "version": "0.0.1-alpha-nightly-6be476717b877e4857383c375d5f209dbd288f99",
4
4
  "description": "A CLI to guide you through the process of building an iExec iApp",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/cmd/test.js CHANGED
@@ -113,7 +113,7 @@ export async function testApp({
113
113
  const imageId = await dockerBuild({
114
114
  isForTest: true,
115
115
  progressCallback: (msg) => {
116
- spinner.text = spinner.text + +color.comment(msg);
116
+ spinner.text = spinner.text + color.comment(msg);
117
117
  },
118
118
  });
119
119
  spinner.succeed(`App docker image built (${imageId})`);
@@ -24,22 +24,19 @@ export async function dockerBuild({
24
24
  src: ['./'],
25
25
  };
26
26
 
27
- let platform;
28
- if (osType === 'Darwin') {
29
- // For MacOS
30
- if (isForTest) {
31
- // ARM64 variant for local testing only
32
- platform = 'linux/arm64';
33
- } else {
34
- // AMD64 variant to deploy to iExec stack
35
- platform = 'linux/amd64';
36
- }
27
+ // by default force to build amd64 image which is architecture used in iExec workers
28
+ // this require buildx builder to support 'linux/amd64' (some devices may need QEMU for amd64 architecture emulation)
29
+ let platform = 'linux/amd64';
30
+ // for MacOS local testing only build arm64 variant
31
+ if (osType === 'Darwin' && isForTest) {
32
+ platform = 'linux/arm64';
37
33
  }
38
34
 
39
35
  // Perform the Docker build operation
40
36
  const buildImageStream = await docker.buildImage(buildArgs, {
41
37
  t: tag,
42
38
  platform,
39
+ pull: true, // docker store does not support multi platform image, this can cause issues when switching build target platform, pulling ensures the right image is used
43
40
  });
44
41
 
45
42
  const imageId = await new Promise((resolve, reject) => {
@@ -91,6 +91,9 @@ async function copyChosenTemplateFiles({
91
91
  const files = await fs.readdir(templateDir);
92
92
  await Promise.all(files.map((file) => write(file)));
93
93
 
94
+ // rename _.gitignore (npm does not allow publishing files named .gitignore in a package)
95
+ await fs.rename('_.gitignore', '.gitignore');
96
+
94
97
  // transform template: remove unwanted feature code inside " // <<feature>> ... // <</feature>>" tags
95
98
  const code = (await fs.readFile(srcFile)).toString('utf8');
96
99
  let modifiedCode = code;
@@ -0,0 +1,9 @@
1
+ # iapp config file may contain secrets
2
+ iapp.config.json
3
+
4
+ # dependencies
5
+ node_modules
6
+
7
+ # test directories
8
+ input
9
+ output