243 Commits

Author SHA1 Message Date
Jonas Hermsmeier
6990d7632a
fix(Makefile): Support arm64 / armv8 / aarch64
This adds support for 64bit arm cpu architectures.

Change-Type: patch
Changelog-Entry: Support building Etcher on armv8
2018-02-16 15:29:47 +01:00
Benedict Aas
96c76177af fix sanity-checks 2018-02-13 11:19:59 +00:00
Jonas Hermsmeier
abfa44a088 upgrade(package): Bump electron-builder 19.9.1 -> 19.40.0 (#1905)
Change-Type: patch
Connects To: #1914
2017-12-19 13:53:26 -04:00
Jonas Hermsmeier
b086e4c2a1
refactor(scripts): Update clean-shrinkwrap script (#1816)
* refactor(scripts): Update clean-shrinkwrap script

This updates the `postshrinkwrap` script to traverse the dependency tree
and remove all `from` fields to avoid inconsistent diffs across platforms,
environments and installs when shrinkwrapping anew.

* chore(shrinkwrap): Update npm-shrinkwrap.json

* fix(scripts): Ensure `resolved` field in shrinkwrap is HTTPS

* fix(scripts): Only strip "from" of registry packages

* fix(clean-shrinkwrap): Fix linter errors

* chore(shrinkwrap): Update npm-shrinkwrap.json

* fix(scripts): fix spelling typo

Change-Type: patch
2017-12-15 16:08:33 +01:00
Juan Cruz Viotti
5432363aa1
chore(appveyor): build x86 on real x86 machines (#1912)
We do this by using Appveyor's `platform` configuration variable instead
of always running on x64 and cross-compiling to x86.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-12-08 09:57:16 -04:00
Andrew Scheller
a70935586b
chore(ci): Attempt to fix TravisCI OSX builds (#1897)
The `pip` command is now `pip2`

Change-Type: patch
2017-12-04 14:37:27 +00:00
Jonas Hermsmeier
c0d25786ef
fix(scripts): Fix pip install in docker (#1818)
This works around the "Cannot fetch index base URL http://pypi.python.org/simple/"
error by installing pip==9.0.1 directly from the pypi.python.org/packages/

Change-Type: patch
2017-10-31 14:04:00 +01:00
Benedict Aas
2556807166 feat(GUI): add optional progress bars to drive-selector drives (#1800)
We show a progress bar for any drive objects with a `progress` field
that isn't falsy, e.g. `undefined` or `0`.

Changelog-Type: minor
Changelog-Entry: Add optional progress bars to drive-selector drives.
2017-10-24 14:43:43 -04:00
Juan Cruz Viotti
f6a7b2add6 feat: implement usbboot adapter (#1686)
This commit installs `node-usb` v1.3.0 from GitHub, since that version
was never published to NPM, and is the only one that works with Visual
Studio 2015 (see https://github.com/tessel/node-usb/issues/109).

The usbboot communicates with a Raspberry Pi / Amber through USB and
eventually mounts it as a block device we can write to.

This feature bundles bootcode.bin and start.elf from the original
usbboot implementation.

The flow is the following:

- On each scan, the usbboot scanner will try to get a usbboot compatible
  USB device to the next "phase", until they are all transformed to
  block devices the user can flash to as usual

Change-Type: minor
Changelog-Entry: Integrate Raspberry Pi's usbboot technology.
Fixes: https://github.com/resin-io/etcher/issues/1541
See: https://github.com/raspberrypi/usbboot
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-10-06 14:19:35 +01:00
Juan Cruz Viotti
488f281ec7 chore: build armhf on GNU/Linux (#1482)
This commit makes use of the `resin/armv7hf-debian` Docker image to
test and generate armhf builds.

We needed to add a slash before `build` in `.gitignore` given that git
was refusing to include any changes on `scripts/build` otherwise.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-28 11:26:36 -04:00
Juan Cruz Viotti
7b308b0e50 chore: fix build system (#1695)
- Bintray deployments are broken because of some bash nested quoting
  issue
- Travis CI will attempt to cache Docker layers on macOS
- Docker caches from different architectures will override each other

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-15 15:07:15 -04:00
Juan Cruz Viotti
b5b98cf392 chore: add type option to bintray publish script (#1670)
Used to not hardcode the architecture type, and to be able to
conditionally set the Bintray Debian headers.

See: https://github.com/resin-io/etcher/pull/1611#discussion_r131349440
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-06 19:56:17 -07:00
Juan Cruz Viotti
4827267af6 chore: add a publish-all make target (#1666)
The CI servers currently call `installers-all` to deploy snapshot
builds, however that target builds the installers, but doesn't call the
phony rules that actually publishes them.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-03 18:13:50 -04:00
Juan Cruz Viotti
d8e31665a0 chore: follow standardjs guidelines (#1664)
- Extend the `standard` ESLint configuration
- Remove ESLint rules that are defined in the `standard` configuration
- Get rid of semi-colons

See: https://github.com/resin-io/etcher/pull/1657
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-03 09:01:54 -04:00
Juan Cruz Viotti
5c19b70e83 refactor: adhere mostly to StandardJS guidelines (#1657)
This commit changes the whole codebase to adhere to all StandardJS
guidelines rules except semicolons, since the removal of semicolons
affect pretty much all lines, and the final diff is very hard to follow
(and to assess other more involved changes).

In a nutshell:

- When using `function`, we now require a space before the opening
  parenthesis
- If a line with operators is broken into multiple lines, the operator
  should now go after the line break
- Unnecessary padding lines are now forbidden

There were also some minor things that the `standard` CLI caught that I
updated here.

See: https://standardjs.com
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-03 06:59:02 -04:00
Juan Cruz Viotti
de62b2e65c chore: publish development Bintray packages (#1611)
This commit includes several changes to adapt the CI configuration files
and Bintray publish script to perform development deployments.

- Move our Bintray details to the Makefile
- Deploy to a new Bintray component if `RELEASE_TYPE` is `snapshot`
- Call `publish-bintray-debian` and `publish-bintray-redhat` in the CI
  deployment script
- Call the Bintray deployment scripts for RPMs

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-08-01 10:29:09 -04:00
Juan Cruz Viotti
b64ef705e8 chore: use old custom build system to create AppImages (#1625)
electron-builder seems to ship with an older AppImages version that
doesn't play very well with the custom AppImages elevation system we
created.

More particularly, we can't execute custom binaries inside the mounted
AppImage given that the mount point seems to lose permissions, owner,
and group file information.

This commit goes back to our old custom build system just for AppImages,
until we properly solve the problem, which will likely involve updating
the AppImages version in electron-builder.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-25 09:47:33 -03:00
Juan Cruz Viotti
09bf430a1e chore: remove the concept of target and host platforms (#1610)
Its very unlikely that we will ever support cross platform builds. For
that reason, let's simplify the whole Makefile by removing the concept
of target and host platforms.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-23 23:33:05 -03:00
Andrew Scheller
fa60a746a2 chore: fix typos in target-convert.sh (#1608) 2017-07-19 10:04:15 -03:00
Juan Cruz Viotti
be8a638fce chore: pass --quiet to pip install (#1592)
This helps reduce a bit of output in the CI servers.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-13 16:15:03 -04:00
Juan Cruz Viotti
ff547035be chore: only ignore top level directories in gitignore for some cases (#1588)
We accidentally added build/ to gitignore, causing any new files from
`scripts/build` to be ignored.

See: https://github.com/resin-io/etcher/pull/1547#discussion_r126790010
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-13 10:23:22 -04:00
Juan Cruz Viotti
e52ef501bb chore: avoid brew taking a long time on macOS Travis builds (#1583)
- Homebrew now auto-updates before performing any installation, which
  can take quite some time. We can disable this by enabling
  HOMEBREW_NO_AUTO_UPDATE

- We can pass the --force-bottle option to `brew install` to force it to
  download pre-compiled binaries, and don't attempt any compilations

See: https://github.com/resin-io/etcher/pull/1582
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-11 17:12:44 -04:00
Juan Cruz Viotti
6ffba92dc8 chore: make use of pkg to package the Etcher CLI (#1547)
This commit replaces our home-grown CLI packaging mechanism based on
browserify + node-static-entry-point with pkg, an open source tool to
package Node.js applications for distribution.

Some highlights:

- Removing browserify got rid of a lot of dependencies from
  npm-shrinkwrap.json

- pkg currently has an issue where macOS binaries can't be code-signed
  (https://github.com/zeit/pkg/issues/128), therefore this commit
  comments-out the binary signing section for that operating system

- pkg currently has an issue where Windows binaries can't be branded
  (https://github.com/zeit/pkg/issues/149), therefore this commit
  comments-out the branding section for that operating system

See: https://github.com/zeit/pkg
Fixes: https://github.com/resin-io/etcher/issues/1531
Fixes: https://github.com/resin-io/etcher/issues/1450
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-11 14:37:14 -04:00
Juan Cruz Viotti
3ade1ea59b chore: don't install NSIS in Appveyor CI (#1584)
This dependency comes bundled with electron-builder, so there is no
reason to install it separately.

See: https://github.com/resin-io/etcher/pull/1582
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-11 14:14:15 -04:00
Jonas Hermsmeier
5f5a4b61b0 chore(scripts): Silence stdout for npm install (#1567)
Change-Type: patch
2017-07-03 17:08:53 -04:00
Juan Cruz Viotti
2e3a2f045e chore: pipe stdout from npm ls to /dev/null (#1566)
As part of our CI sanity checks, we run `npm ls`, to ensure we don't
have any extraneous dependencies (the command fails if so), however by
its own definition, `npm ls` prints the whole dependency tree, which
spams the builds.

This commit redirects stdout to /dev/null, which contains the dependency
tree, but still prints and extraneous dependency warning, which is
printed to stderr instead.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-03 13:14:22 -04:00
Juan Cruz Viotti
c2563c2f87 chore(npm): move retry options to INSTALL_OPTS (#1564)
See: https://github.com/resin-io/etcher/pull/1550/files#r125015773
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-03 11:48:07 -04:00
Juan Cruz Viotti
53d8118b8f chore: don't remove optional dependencies in clean-shrinkwrap.js (#1551)
If we include a platform specific optional dependency in the shrinkwrap
file, then npm will insist in installing it even if the platform doesn't
match. As a solution, we figured out we can avoid putting this platform
specific optional dependencies in the npm-shrinkwrap.json file.

In order to do this, we currently have a script called
`clean-shrinkwrap.js` that runs *before* any `npm shrinkwrap` file (its
a `preshrinkwrap` npm script) that deletes all the platform specific
modules we know about using `npm rm`.

The problem with this approach is that `npm rm` will remove the module's
code from `node_modules`, which means that if we run `npm shrinkwrap`,
we will lose certain optional dependencies, that may be needed at a
later stage.

The solution is to modify the `clean-shrinkwrap.js` script to parse
`npm-shrinkwrap.json`, and manually delete the entries that we want to
omit. Also, the script needs to be run *after* `npm shrinkwrap`, so we
change the npm script name to `postshrinkwrap`.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-07-03 10:30:04 -04:00
Jonas Hermsmeier
65210e4cbc chore(ci): Enable node_modules & ccache caching (#1553)
This enables caching of `node_modules`, and `ccache` directories,
as well as installation of ccache on Mac OS.

Change-Type: patch
2017-06-27 23:27:43 +02:00
Jonas Hermsmeier
2008c50ebf chore(scripts): Make npm output less verbose (#1554)
This adds the `--silent` flag to several npm commands,
ideally making the output less verbose, for better overview in CI logs.

Change-Type: patch
2017-06-27 22:27:34 +02:00
Juan Cruz Viotti
3ab989cf3c chore: increase npm retries and max timeout (#1550)
CI servers fail with timeouts, or network issues quite frequently,
requiring maintainers to manually restart failed builds.

Hopefully these npm settings will help mitigating these issues.

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-27 13:11:54 -04:00
Juan Cruz Viotti
a7ac28b717 chore: make use of electron-builder to build GNU/Linux packages (#1520)
Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-23 20:10:51 -04:00
Juan Cruz Viotti
dbc8aa159d chore(travis): remove unused afsctool macOS dependency (#1521)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-16 17:36:00 -04:00
Juan Cruz Viotti
a8f6275763 chore: generate single-binary portable installers on Windows (#1518)
We currently support portable builds that are basically ZIPs containing
the main Etcher executable and all its related libraries.

Turns out `electron-builder` supports NSIS-based portable builds that
can create a single executable that has everything it needs to run,
including any external assets.

This commit makes use of this new portable Windows installer
functionality, replacing the old ZIP approach.

Change-Type: patch
Changelog-Entry: Generate single-binary portable installers on Windows.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-15 12:10:22 -04:00
Juan Cruz Viotti
2f605497be chore: use electron-builder to generate macOS builds (#1511)
This commit makes use of electron-builder to replace what our scripts
were already doing.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-15 10:11:49 -04:00
Juan Cruz Viotti
07adafe6f3 chore: use the new electron-builder version to create NSIS installer (#1510)
We've been using `electron-builder` v2 all this time to create the NSIS
installer. This commit upgrade `electron-builder` to v18.6.2, and keeps
using it just to create the NSIS installer (for now).

The final package behaves exactly like the one we have before, just that
we needed various tweaks to upgrade to the latest `electron-builder`
version.

In more detail:

- Inject data to package.json using the new `--extraMetadata` option
- Remove old `.builder` package.json property
- Change the author of the project to Resin Inc. (the company name used
  in our code-signing certificate)

As an extra, the new NSIS installer allows the user to install the
application to any location, and fixes the fact that the previous
installer copied the application to C:\Program Files (x86) even on x64
systems.

Change-Type: patch
Fixes: https://github.com/resin-io/etcher/issues/1030
Fixes: https://github.com/resin-io/etcher/issues/877
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-13 11:19:29 -04:00
Juan Cruz Viotti
15b178a158 refactor(GUI): move ETCHER_DISABLE_UPDATES into package.json (#1501)
Etcher supports disabling the update notification dialog by setting the
`ETCHER_DISABLE_UPDATES` environment variable.

In order to simplify disabling updates for when these are managed by a
package manager (e.g. in a debian package), this removes support for the
`ETCHER_DISABLE_UPDATES` environment variable, and instead requires
packagers to tweak the `updates.enabled` property of the package.json
file, which is set to `true` by default.

We don't want to encourage end users to disable the update mechanism, so
the documention was removed from `USER-DOCUMENTATION.md`. This option
will remain as something only packagers should tweak.

Change-Type: minor
Changelog-Entry: Remove support for the `ETCHER_DISABLE_UPDATES` environment variable.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-13 09:07:47 -04:00
Andrew Scheller
22be831535 chore: move mkdir call from node-package-cli.sh to Makefile (#1516)
This makes it more consistent with the other Makefile rules
2017-06-13 14:00:43 +01:00
Dhruv Paranjape
f350d28dbd chore: Add support for rpm packages (#1425)
* add support for rpm packages.

* remove bintray file not my place neither do i have the keys.

* Remove last visage of publishing rpm's to bintray.

* address review comments.

* remove electron installer redhat from optional dependancies and add it to dockerfiles. also remove variable ELECTRON-INSTALLER-REDHAT inline with electron installer debian script.

* Add dependancy on libXScrnSaver and remove unsupported fields from config.json.
add rpm package to dockerfiles.
add dependancy check on rpmbuild to installer script.

* change dependancy from lsb-core-noarch to just lsb.

* address review comments.

* Add bintray target for rpm packages.

* Fix missing dependancy removed during conflict resolution.
2017-06-12 18:54:31 +01:00
Juan Cruz Viotti
cff445b64b chore: move npm targets to Makefile (#1505)
We currently have various npm script target, and some of them are
getting complex enough that making sense out of them in package.json is
not a trivial task.

This commit moves all npm targets that are not directly recognisable by
npm (like `start`, `test`, `preshrinkwrap`, etc) into the Makefile.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-10 13:50:29 -04:00
Juan Cruz Viotti
927a0aba06 chore: remove unused electron-packager dependency (#1502)
We're not using this development dependency anymore. Furthermore, we're
also not using the `packageignore.js` script, which was meant to be used
with `electron-packager`.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
2017-06-08 15:08:37 -04:00
Juan Cruz Viotti
296a554637
Revert "chore: make use of resin.io's Docker base images"
This reverts commit d39b4ba7d7687a7eea72cbf7b8702f8ea122fb39.
2017-05-31 10:51:27 -04:00
Juan Cruz Viotti
9a3900debb chore: make use of resin.io's Docker base images (#1481)
Resin.io already publishes multi-arch Docker base images running Jessie,
which is Debian version we wanted before falling back to Ubuntu 12.04.

The main reason behind this change is to be able to use other resin.io
base images (like ARM ones) without requiring a lot of per-base-image
changes.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-29 20:45:24 -04:00
Andrew Scheller
2e50ad802f chore(docker): Change APT mirror used by the Ubuntu12.04 32bit docker image (#1471)
Previously it was using http://ubuntu.stu.edu.tw but this host is no longer
active, which was causing all the 32bit Linux TravisCI builds to fail.
2017-05-25 19:06:18 +02:00
Juan Cruz Viotti
8e681b5534 fix(CLI): get rid of Browserify absolute path workaround (#1449)
We encountered a Browserify bug when releasing the CLI, where absolute
paths would be hard-coded in the final bundle. Since we were in the
middle of a release process, we added a quick and dirty
search-and-replace workaround on `concatenate-javascript.sh`.

After the release, we submitted a PR to Browserify which fixes the
issue. This commit makes use of my personal fork to be able to use such
fix while it gets merged to the main project.

See: https://github.com/substack/node-browserify/pull/1725
See: https://github.com/resin-io/etcher/pull/1409
Fixes: https://github.com/resin-io/etcher/issues/1429
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-22 11:33:09 -04:00
Juan Cruz Viotti
a12abc2a6c chore: unify CI scripts (#1434)
Currently we have almost equal CI scripts implemented in bash (for
Travis), and batch (for Appveyor). This commit takes advantage of MinGW
bash to unify all the scripts as bash scripts.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-22 09:20:28 -04:00
Juan Cruz Viotti
78f36dfd16 chore: track python dependencies with pip (#1447)
We're currently hardcoding various pip dependencies in
`appveyor-install.bat` and `travis-install.sh`.

This commit moves all the dependencies to a `requirements.txt` file in
the root of the project, and makes every install script run `pip install
-r requirements.txt`.

See: https://github.com/resin-io/etcher/pull/1401#discussion_r116547053
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-18 16:35:06 -04:00
Juan Cruz Viotti
30ed217c79 chore: create installers (but don't publish) on every pull request (#1365)
This allows us to catch changes that break our installer builds before
merging the problematic changes.

As a way to simplify the CI configuration files, this commit introduces
an `installers-all` Makefile target that builds all installers.

This commit also replaces all the `cp -rf` calls with `cp -RLf` in
Makefile to avoid some weird hard link Appveyor issues.

See: https://github.com/resin-io/etcher/pull/1078
See: https://github.com/resin-io/etcher/pull/1354
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-17 23:00:59 -04:00
Juan Cruz Viotti
a74e6b53cd chore: fix lzma-native not building for the x86 Linux CLI (#1448)
There are various problems that contributed to this issue:

- `node-pre-gyp` doesn't detect the 6.10.3 node version. We reverted to
  6.1.0, which the module recognised, and which shares the same v8 ABI

- Passing `--force` to `npm install` causes npm to swallow any errors
  and silently continue

- The x86 Docker container has problems writing to `$HOME/.node-gyp`.
  The solution is to enable `unsafe-perm` given that the container is
  running as `root`

Fixes: https://github.com/resin-io/etcher/issues/1444
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-17 17:10:00 -04:00
Andrew Scheller
57e29a5725 chore: Check for the commands used by electron-installer-debian (#1446) 2017-05-17 13:59:18 +01:00