Commit Graph

261 Commits

Author SHA1 Message Date
Paulo Castro
2ad0b60aeb Unify the CLI instructions between capitanodoc.ts and README.md, move
the installation instructions to INSTALL.md, and update the markdown
generation scripts.

Change-type: minor
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-04-29 14:27:32 +01:00
Cameron Diver
57fba32fa2
Add better semantics for detached mode + live for push
Now if you pass both --live and --detached, the logs won't be displayed
but livepush will continue to run.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-26 16:50:27 +01:00
Cameron Diver
a6d2950260 Allow filtering of system logs with push and logs commands
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-24 17:30:18 +01:00
Cameron Diver
56c74af1ff Add per-service filtering to logs and push
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-24 15:05:05 +01:00
Cameron Diver
97c15208b5 push: Add detached flag to avoid streaming logs after local push
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-24 14:31:30 +01:00
Cameron Diver
d412d39164 Add ability to use balena logs with a local mode device
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-24 12:48:52 +01:00
Cameron Diver
4676396b5f logs: Make device logs consistent across the CLI
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-24 12:25:09 +01:00
Cameron Diver
b97565d2e7 refactor: Create and use validation functions for input
This includes IP address, application name and dotlocal url parsing.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-24 12:11:46 +01:00
Paulo Castro
db25a65753 Add --dockerfile option to the build, deploy and push commands
It allows the selection of an alternative Dockerfile in single-
container projects that do not include a docker-compose file.

Change-type: minor
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-04-23 15:34:19 +01:00
Cameron Diver
7c71098d86
Update livepush documentation and required versions
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-23 14:00:05 +01:00
Cameron Diver
490f833a33
Cleanup intermediate containers on exit of livepush
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-23 14:00:05 +01:00
Cameron Diver
a81c1971f1
livepush: Perform full rebuild on Dockerfile-like file change
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-23 14:00:05 +01:00
Cameron Diver
76034696e9
Fix lint warnings
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-23 14:00:04 +01:00
Cameron Diver
6a9a9e1fdb
Add livepush ability to balena push
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-23 14:00:04 +01:00
Cameron Diver
cf2ad66955
log: Add livepush logging functions
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-23 12:14:09 +01:00
Cameron Diver
4cfaf6e666
Add device status endpoint api function
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-23 12:14:05 +01:00
Thodoris Greasidis
1ee51ca9a7 Ensure not marking successful releases as canceled
Resolves: #1178
Change-type: patch
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
2019-04-22 20:09:32 +03:00
Akis Kesoglou
9b52dec725 Fix file ignore rules matching metadata folders breaking qemu builds
Change-type: patch
2019-04-12 16:16:56 +03:00
Paulo Castro
30698c62e3 Remove 'quickstart' command and deprecate 'local push'.
Change-type: major
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-04-03 17:34:55 +01:00
Cameron Diver
b9bf00d329
Support nocache flag in push <ip>
Change-type: patch
Closes: #1128
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-03-28 13:29:52 +00:00
Paulo Castro
6b21f5aa5a Allow 'balena push <deviceIpAddress>' when not logged in to balenaCloud.
Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-03-25 17:46:38 +00:00
Paulo Castro
a883948d56 Bump resin-multibuild (2.1.4), docker-progress (3.0.5), resin-lint (3.0.1)
The new resin-multibuild and docker-progress versions widen the range
of errors caught by the 'balena push' and 'balena build' commands.

Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-03-18 14:09:06 +00:00
Paulo Castro
5ec9dce507 Retry image push a few times (balena deploy, 'unknown blob')
Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-03-05 15:02:52 +00:00
Paulo Castro
1e81638433 Harden 'remote-build' error handling (balena push)
Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-03-05 13:17:37 +00:00
Paulo Castro
de3837f777 Minor doc updates (add DEBUG hint)
Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-03-04 19:53:18 +00:00
Paulo Castro
05e80094de Add registry-secrets help msg for build and deploy commands
Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-02-27 21:58:44 +00:00
Paulo Castro
211fb824a1 Extend private registry support to balena build and deploy commands
Resolves: #1116
Change-type: minor
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-02-27 13:16:09 +00:00
Paulo Castro
c1e94e661f Integrate new resin-multibuild major version (private docker registry
authentication support for the docker-compose 'image' instruction).

Resolves: #1114
Change-type: minor
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-02-27 10:33:25 +00:00
Paulo Castro
0bff122b1c Fix parsing of not-really-numeric device UUID parameters
Change-type: patch
Signed-off-by: Paulo Castro <paulo@balena.io>
2019-02-26 10:43:57 +00:00
Rich Bayliss
f72b556d92
tunnel: Refactor to improve log output
Improve the log output and error handling in the tunnel
command code.

Signed-off-by: Rich Bayliss <rich@balena.io>
Change-type: patch
2019-02-20 21:42:59 +00:00
Rich Bayliss
aac668dfca
tunnel: Add the tunnel command
This allows a user to easily use the tunneling service
to open connections into their balena-managed devices.

Signed-off-by: Rich Bayliss <rich@balena.io>
Change-type: patch
2019-02-15 16:08:00 +00:00
Cameron Diver
af948e76f3
Rename localcommit to localrelease in target state for local mode
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-02-05 16:55:49 +00:00
Pagan Gazzard
77196746b3 Lazy load the sdk as much as possible
Change-type: patch
2019-01-13 18:03:06 +00:00
Pagan Gazzard
ce1aff1557 Lazy-load docker-toolbelt
Change-type: patch
2019-01-13 13:43:21 +00:00
Pagan Gazzard
3cc632fbbb Lazy-load etcher-sdk to speed up startup
Change-type: patch
2019-01-11 18:29:58 +00:00
Pagan Gazzard
f780d47198 Lazy-load resin-cli-form and resin-cli-visuals to speed up startup
Change-type: patch
2019-01-11 18:11:32 +00:00
Alexis Svinartchouk
f9390ceb10 Update lib/actions/local/flash.coffee
* switch to typescript
 * replace etcher-image-stream with etcher-sdk

Change-type: patch
2019-01-11 17:56:34 +01:00
Matthew McGinn
a42a1a97ba Request access to previously pushed release via balena deploy
This access is used to cross mount the old layers, rather than
reuploading the layers each time.

Connects-to: #1045
Change-type: minor
Signed-off-by: Matthew McGinn <mamcgi@gmail.com>
2019-01-10 08:27:53 -05:00
Paulo Castro
0f302d30ec Add push --registry-secrets option for private docker registry authentication
Change-type: minor
Signed-off-by: Paulo Castro <paulo@balena.io>
2018-12-18 00:01:15 +00:00
Thodoris Greasidis
952d74207d Check that the provided device type option is of the same arch
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
2018-12-14 15:46:27 +02:00
Thodoris Greasidis
97d6a39677 Add explicit device type option to os configure & config generate
Resolves: #1013
Change-type: minor
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
2018-12-14 12:56:43 +02:00
Alexis Svinartchouk
03a3ef38e1 Fix deploy action on node 6
Downgrade @types/node to version 6 as we support node6

Change-type: patch
2018-12-14 11:26:59 +01:00
Cameron Diver
a357405f3a
Make architecture checking more stringent when installing emulators
Also change the documentation to an armv7hf.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2018-12-03 13:10:54 +00:00
Akis Kesoglou
8291c96e69 Make specifying the version during configuration optional
`version` used to be optional but it seems we recently had to make it a required parameter. However it really feels redundant when all it’s used for is to determine whether the command should issue a legacy user API key or a provisioning key.

This makes version optional but tries to figure it out by itself by reading os-release from the image's boot partition. This is not foul-proof however, and while it'll work with most recent images it won't work with all and in that case it'll bail out and only then warn the user to specify it via the --version argument.

Change-type: minor
2018-11-16 19:39:43 +02:00
Cameron Diver
b799f3a46d
Fix the architecture string used when downloading qemu versions
Closes: #1019
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2018-11-12 15:57:04 +00:00
Edward Keeble
b83b7145af Remove unnecessary parentheses 2018-11-07 20:58:27 +01:00
Edward Keeble
26c4e466bd Store separate local qemu binaries for aarch64 and arm architectures.
Copy the correct binary into the local build context when executing a build.
2018-11-07 17:49:20 +01:00
Edward Keeble
42f752e400 Use existing tar-stream dependency to untar qemu archive rather than adding a new dependency. 2018-11-07 17:49:20 +01:00
Edward Keeble
0b67a40d57 Update qemu to v3, and automatically use the correct architecture (arm/aarch64)
When building with emulation mode enabled, this downloads the version of qemu
appropriate to the architecture of the project (either arm or aarch64).

Change-type: minor
2018-11-07 17:49:20 +01:00
Tim Perry
75bc937995 Stop validating device config, now that it's API-generated
Change-type: patch
2018-11-06 12:31:05 +01:00
Cameron Diver
0deb59b6e2
Dont ignore balena metadata directories when balena pushing
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2018-11-01 13:58:54 +00:00
Tim Perry
c6eca9f895 Rewrite the env commands in TypeScript 2018-10-29 22:29:02 +01:00
Tim Perry
4907fccf48 Rename everything from 'resin' to 'balena'
Change-type: major
2018-10-29 22:29:02 +01:00
Thodoris Greasidis
b6266878d4 utils/promote: Use the application slug for filtering & presenting
Change-type: minor
Depends-on: https://github.com/resin-io/resin-api/pull/1570
Depends-on: https://github.com/resin-io/resin-sdk/pull/596
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
2018-10-29 22:29:02 +01:00
Thodoris Greasidis
c2df87bcc6 Code formatting
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
2018-10-29 22:29:02 +01:00
Akis Kesoglou
79f33c749b fix deploy 2018-10-29 22:29:02 +01:00
Thodoris Greasidis
fd316167d8 Sort device types by name
Change-type: minor
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
2018-10-29 22:29:02 +01:00
Thodoris Greasidis
f60d857c93 utils/promote: Do not rely on the user to always be there
Change-type: minor
Depends-on: https://github.com/resin-io/resin-sdk/pull/595
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
2018-10-29 22:29:02 +01:00
Thodoris Greasidis
31628cfdcb promote: Use ResinSdk type namespace
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
2018-10-29 22:29:02 +01:00
Thodoris Greasidis
4d42f74c0c Add support for the Opensource provisioning flow
Connects-to: #978
Change-type: major
Depends-on: https://github.com/resin-io/resin-sdk/pull/594
HQ: https://github.com/resin-io/balena/pull/1140
Signed-off-by: Thodoris Greasidis <thodoris@resin.io>
2018-10-29 22:29:02 +01:00
Thodoris Greasidis
948e6ea6f8 utils/patterns: Drop resin-sdk-preconfigured
Change-type: patch
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
2018-10-20 18:35:34 +02:00
Heds Simons
bf71f9ea16 Merge pull request #981 from resin-io/local-mode-v2
Local mode v2
2018-10-19 17:09:28 +02:00
Cameron Diver
fe751fdb23 Check supervisor version before attempting to do a local push
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:45:23 +02:00
Cameron Diver
947f91d570 Support multicontainer local mode in resin push
Change-type: minor
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:44:56 +02:00
Cameron Diver
c5d4e30e24 logger: Add logs logging function
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:44:53 +02:00
Cameron Diver
f560aa7523 export resolveProject function from compose module
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:44:49 +02:00
Cameron Diver
6bcfb2dd51 logs: Add log build function to logger
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:44:44 +02:00
Cameron Diver
bf062124f7 compose: Add compose typings
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:44:39 +02:00
Cameron Diver
221666f59a Stop accepting resin-compose.yml as a build composition definition
These files are not supported by any other part of the resin
infrastructure, and it could cause confusion with it not being
supported everywhere. The idea was originally added because we
thought we might need to make extensions on docker-compose, but
that hasn't happened.

Change-type: major
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:43:49 +02:00
Cameron Diver
cd6ee4ef5e Send push source packages as gzipped data
Change-type: minor
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:43:39 +02:00
Cameron Diver
872b17cf24 refactor: Allow setting of a remote build error message
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:43:32 +02:00
Cameron Diver
a3dd489c70 Respect ignore files when tarring sources
This commit brings in the ignore and dockerignore libraries, which when
provided with the patterns in the aforementioned files will ignore them.

Change-type: major
Closes: 889
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:43:22 +02:00
Cameron Diver
ec589c2639 Correctly error out on failed remote builds
The push command was relying on the output from the builder to indicate
the build status, but this isn't helpful for CI. This commit makes the
remote build module respect the `isError` flag which the builder sends
in any errors. Any errors which come from the builder indicate the
release will not be deployed.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-19 16:42:14 +02:00
Pagan Gazzard
71eca70a22 Fix errors in getRequestStream not being propogated
Change-type: patch
Signed-off-by: Pagan Gazzard <page@resin.io>
2018-08-14 18:21:10 -07:00
Cameron Diver
e7c68c1a5c
Support emulated and nocache options for remote builds
Change-type: minor
Closes: #901
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-08-09 14:36:34 +01:00
Tim Perry
802ccc1b9a Fix bug where the sudo helper failed in os initialize
Change-type: patch
Signed-off-by: Tim Perry <tim@resin.io>
2018-08-09 12:11:26 +02:00
Tim Perry
d8aaccf80c Update typed-error to fix some TS complaints
Signed-off-by: Tim Perry <tim@resin.io>
2018-08-09 11:21:45 +02:00
Tim Perry
7c75346a1a Update klaw
The changes from our fork have now been completed and released

Change-type: patch
Signed-off-by: Tim Perry <tim@resin.io>
2018-08-01 16:43:26 +02:00
Tim Perry
e350f9b335 Follow links found during builds
Change-Type: patch
2018-07-25 12:38:17 +02:00
Akis Kesoglou
916cc36430 Lazily import resin-image-fs
If for whatever reason resin-image-fs is not importable — eg. if it’s built for another arch — any command that imports `helpers.ts` will just quit without any error/traceback.
2018-07-20 13:04:26 +03:00
Akis Kesoglou
27b877dd33 Forward root CA to device config if one is present 2018-07-19 22:34:31 +03:00
Akis Kesoglou
5cbe1c410f Add join/leave commands to promote and move devices between platforms
Both commands work with local devices by remotely invoking the `os-config` executable via SSH. This requires an as of yet unreleased resinOS (that will most likely be v2.14) and the commands ascertain compatibility merely by looking for the `os-config` executable in the device, and bail out if it’s not present.

`join` and `leave` accept a couple of optional arguments and implement a wizard-style interface if these are not given. They allow to interactively select the device and the application to promote to. If the user has no apps, `join` will offer the user to create one. `join` will also offer the user to login or create an account if they’re not logged in already without exiting the wizard.

`resin-sync` (that's used internally to discover local devices) requires admin privileges. If no device has been specified as an argument, the commands will launch the device scanning process in a privileged subprocess via two new internal commands: `internal sudo` and `internal scanDevices`. This avoids having the user to invoke the commands with sudo and only request escalation if truly needed. This commit also removes the dependency to “president”, implementing “sudo” functionality within the CLI.

Change-Type: minor
2018-07-19 22:18:02 +03:00
Akis Kesoglou
7846af390e Improve selectFromList function signature to be much more reusable 2018-07-19 21:53:43 +03:00
Tim Perry
70be2ae596 Tweaks to config options handling after review 2018-07-17 15:38:38 +02:00
Tim Perry
36eb0a108e Post-review tweaks to OS actions 2018-07-13 19:34:59 +02:00
Tim Perry
0bf6fb1739 Add --version options to os configure & config generate
This is used to ensure the correct type of API key is used in all
configuration.

Change-Type: patch
2018-07-13 19:34:59 +02:00
Tim Perry
892adf4c47 Update OS & config actions to the latest SDK
Fixes #915
Change-Type: patch
2018-07-13 19:34:59 +02:00
Tim Perry
52f93f8f12 Add --generate-device-api-key parameter to config generate
Change-Type: minor
2018-07-10 19:57:56 +02:00
Tim Perry
398c34d842 Includes new prettier changes, and pin prettier to stop more appearing 2018-06-12 17:43:15 +02:00
Ariel Flesler
b7f94a222d Update resin-compose-parse dependency version to 1.10.2
Change-type: minor
2018-05-30 11:57:04 -03:00
Cameron Diver
439d8d396f
Add push command which starts a build on remote resin servers
Change-type: minor
Connects-to: #843
2018-05-10 11:43:45 +01:00
Tim Perry
2c46c59a79 Update resin-image-fs to stop non-config commands failing in node 10
This doesn't fix actual usage of image fs, just makes it possible to
stop commands that don't use it from failing entirely.

Connects-To: #869
Change-Type: patch
2018-04-30 11:14:39 +02:00
Tim Perry
37e4ec6364 Rename expectedError to exitWithExpectedError 2018-04-17 15:18:06 +02:00
Tim Perry
6a8b947c2e Don't report lots of user input errors
Change-Type: patch
2018-04-17 15:18:06 +02:00
Akis Kesoglou
4f167cb836 Address review feedback 2018-03-22 13:26:47 +02:00
Akis Kesoglou
9455d438e2 Formatting fixes 2018-03-22 13:26:47 +02:00
Akis Kesoglou
a356ecf9b6 Remove unused code 2018-03-22 13:26:47 +02:00
Akis Kesoglou
62f006b89a Add legacy deploy method back
This mostly reverts the removal of the legacy deploy code that pushed image tars via the builder. It’s needed for users to avoid having to switch between CLI versions in order to push to legacy apps as well.

Note: this pins resin-sdk to 9.0.0-beta14 as I couldn’t get it to install otherwise — npm would always install 9.0.0-beta9 instead.

Change-Type: minor
2018-03-22 13:26:47 +02:00
Akis Kesoglou
242c3731ee Remove redundant import 2018-03-19 20:52:51 +02:00
Akis Kesoglou
5f7eee8eac Make sure image name is all lowercase
Change-Type: patch
2018-03-19 20:52:51 +02:00