40 Commits

Author SHA1 Message Date
Lorenzo Alberto Maria Ambrosi
156c25cea1 Include sass in webpack configs
Change-type: patch
Changelog-entry: Include sass in webpack configs
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzoa@balena.io>
2019-05-28 11:08:54 +02:00
Juan Cruz Viotti
3855bb4d56 Use Resin CI scripts to build Etcher
Change-type: patch
Signed-off-by: Juan Cruz Viotti <juan@resin.io>
2018-10-22 14:58:15 +02:00
Salvatore Zappalà
f9805f3bc7
minifix: add "make webpack" to travis-ci build script
Currently, the Travis CI build is failing due to the fact that
the folder 'generated/etcher' is empty.

The folder is missing because the "make webpack" step is missing
from the travis CI build.

This commit amends that by adding the "make webpack" build step
after linting.

Change-type: patch
Signed-off-by: Salvatore Zappalà <salvatore@salvatorezappala.info>
2018-08-22 10:21:23 +01:00
Lorenzo Alberto Maria Ambrosi
c0ec74bbb7 fix(webpack): Add etcher.js to webpack build
Change-type: patch
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzoa@resin.io>
2018-08-14 19:04:13 +02:00
Jonas Hermsmeier
edf924d012
test(lint): Replace ASCII-only check with ESLint rule
This replaces the `ensure-all-text-files-only-ascii` sanity-check
with an ESLint rule to only check identifiers in code against being
printable ASCII, as there are places where UTF-8 in content is required,
which would make the previous check fail.

Change-Type: patch
2018-04-02 17:10:23 +02:00
Jonas Hermsmeier
3dd646485f
chore(package): Replace custom missing require check
This replaces the custom bash script with rules from the eslint-node plugin
to check for `require()`d modules that don't exist.
This will also check requires of local modules, and installed packages,
yielding a more thorough check.

Change-Type: patch
2018-03-28 18:49:32 +02:00
Andrew Scheller
6647167d02 chore: Allow namespaced requires to be sanity-checked
Fixes #2120

Change-type: patch
2018-03-15 01:41:34 +00:00
Benedict Aas
96c76177af fix sanity-checks 2018-02-13 11:19:59 +00: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
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
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
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
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
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
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
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
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
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
1048150654 chore: check that there are no unstaged shrinkwrap changes (#1379)
See: https://github.com/resin-io/etcher/pull/1372
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-15 12:58:20 -04:00
Juan Cruz Viotti
d521fbbd2c chore(CLI): minify Etcher CLI code (#1401)
UglifyJS v3 was recently released, which includes support for
compressing ES6 code.

This commit introduces the following changes:

- Add a boolean `-m` option to `concatenate-javascript.sh`, which when
  set, will minify the final concatenated JavaScript file

- Install `uglify-es` in the CI servers

See: https://news.ycombinator.com/item?id=14285179
See: https://github.com/mishoo/UglifyJS2/tree/harmony
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-10 15:15:41 -04:00
Juan Cruz Viotti
60754250d9 chore: add ensure-npm-valid-dependencies.sh to sanity-checks make target (#1378)
We forgot to do so on the PR that introduces this script.

This commit also moves all the CI code to separate scripts.

See: https://github.com/resin-io/etcher/pull/1371
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-07 17:35:22 -04:00
Juan Cruz Viotti
4f5179f5c9 chore: ensure there are no extraneous or invalid npm dependencies (#1371)
The `npm ls` command will exit with an error code if there are invalid
or extraneous dependencies.

This commits adds that command to `make sanity-checks`, so we can catch
those cases early one.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-05-01 19:39:03 -04:00
Andrew Scheller
07dad2a0ef chore: fix a CI script to 'properly fail' on Windows (#1270) 2017-04-10 10:06:32 -04:00
Andrew Scheller
810ced3907 chore: fix CI script to work when 'require'ing nested modules (#1267) 2017-04-08 20:00:43 -04:00
Andrew Scheller
63c7eed2a9 chore: add a require() checking script (#1237)
* chore: Add a require() checking script

This adds another sanity-check bash script to scan the Etcher source files
and check all required node modules are available.

* Workaround for jq crash on Windows
2017-03-31 11:00:59 -04:00
Juan Cruz Viotti
3c1882d2b4 chore(travis): move deploy command to a separate script (#1224)
We're passing a shell conditional to `deploy.script`, however Travis CI
seems to get confused about this in the deploy section, causing
GNU/Linux to run `make publish-aws-s3` directly on the Travis CI build
instead of in the Docker container, which causes the deployment to
eventually fail because of missing dependencies.

According to Travis CI:

> `deploy.script` must be a scalar pointing to an executable file or
> command.

See https://travis-ci.org/resin-io/etcher/jobs/214723725 for a failure
example.

We also move the Appveyor deploy script to a separate file for symmetry
purposes.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-03-28 14:15:52 -04:00
Andrew Scheller
1731e77a25 chore: check that all text files only contain expected ASCII chars (#1205) 2017-03-23 14:00:14 -04:00
Andrew Scheller
5a01f4854c chore: setup .gitattributes to perform correct line-ending conversions (#1192)
This allows `npm run lint` to pass regardless of the `core.autocrlf`
setting in git
2017-03-21 14:32:21 -04:00
Juan Cruz Viotti
0873b1d161 chore: fix lzma-native build issues on Windows (#1191)
* chore: fix `lzma-native` build issues on Windows

We've been recently hitting a weird `lzma-native` build error on Windows
(both locally and on Appveyor CI):

```
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  build
  The input line is too long.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\projects\etcher\node_modules\lzma-native\build\liblzma.vcxproj]
```

After a lot of experimentation, we realised the issue was gone if we
removed `node-sass` from the development dependencies.

The issue is that `node-gyp` was recently upgraded to v3.6.0, which was
picked up by `node-sass`, which declares `node-gyp` as a dependency. For
some reason, if `node-sass` causes `node-gyp` to be updated, then
`lzma-native` fails with the above cryptic error.

I was able to trace down the error to the following `node-gyp` commit:

ae141e1906

As a solution, this commit starts to shrinkwrap development
dependencies, and locks `node-gyp` to v3.5.0 until the issue is fixed.

Fixes: https://github.com/addaleax/lzma-native/issues/30
See: https://github.com/nodejs/node-gyp/issues/1151
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>

* chore: ensure some modules in npm-shrinkwrap stay at specific versions

* Address code review comments

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-03-20 15:03:10 -04:00
Juan Cruz Viotti
66c0cb6e17 chore: automatically enforce compatible angular core module versions (#1175)
We've recently had an incident were the `angular-mocks` version we were
running was incompatible with the `angular` version.

Each AngularJS core module is versioned equally, therefore we can write
a small script that automatically tests that they match, so we're
guarded against forgetting to similarly upgrade different dependencies.

See: https://github.com/resin-io/etcher/pull/1168
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-03-15 10:43:20 -04:00
Juan Cruz Viotti
96a9b65ea7 chore: ensure npm run sass was ran and the results committed (#1121)
We recently encountered a UI regression caused by forgetting to commit
the generated CSS files.

The solution is to make the CI servers run `npm run sass` and check if
there are unstaged files afterwards. If so, the tests halt.

In order to avoid duplication between Travis CI and Appveyor CI, this
logic has been encoded into a bash script at `scripts/ci`.

See: https://github.com/resin-io/etcher/pull/1120
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
2017-02-23 11:20:47 -04:00