mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-07 11:26:41 +00:00
Remove resin-preload build filtering workaround.
Connects to #640 Change-Type: patch
This commit is contained in:
parent
b152482133
commit
e0d661a1da
@ -23,7 +23,8 @@ dockerUtils = require('../utils/docker');
|
||||
LATEST = 'latest';
|
||||
|
||||
getApplicationsWithSuccessfulBuilds = function(deviceType) {
|
||||
var resin;
|
||||
var preload, resin;
|
||||
preload = require('resin-preload');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.pine.get({
|
||||
resource: 'my_application',
|
||||
@ -41,25 +42,10 @@ getApplicationsWithSuccessfulBuilds = function(deviceType) {
|
||||
}
|
||||
}
|
||||
},
|
||||
expand: {
|
||||
environment_variable: {
|
||||
$select: ['name', 'value']
|
||||
},
|
||||
build: {
|
||||
$select: ['id', 'commit_hash', 'push_timestamp', 'status'],
|
||||
$orderby: 'push_timestamp desc'
|
||||
}
|
||||
},
|
||||
expand: preload.applicationExpandOptions,
|
||||
select: ['id', 'app_name', 'device_type', 'commit'],
|
||||
orderby: 'app_name asc'
|
||||
}
|
||||
}).then(function(applications) {
|
||||
applications.forEach(function(application) {
|
||||
return application.build = application.build.filter(function(build) {
|
||||
return build.status === 'success';
|
||||
});
|
||||
});
|
||||
return applications;
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -19,6 +19,7 @@ dockerUtils = require('../utils/docker')
|
||||
LATEST = 'latest'
|
||||
|
||||
getApplicationsWithSuccessfulBuilds = (deviceType) ->
|
||||
preload = require('resin-preload')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
|
||||
resin.pine.get
|
||||
@ -32,25 +33,9 @@ getApplicationsWithSuccessfulBuilds = (deviceType) ->
|
||||
$expr:
|
||||
b:
|
||||
status: 'success'
|
||||
expand:
|
||||
environment_variable:
|
||||
$select: ['name', 'value']
|
||||
build:
|
||||
$select: [ 'id', 'commit_hash', 'push_timestamp', 'status' ]
|
||||
$orderby: 'push_timestamp desc'
|
||||
# FIXME: The filter is commented because it causes an api error.
|
||||
# We manually filter out successful builds below.
|
||||
# We should move that here once this API error is resolved.
|
||||
#$filter:
|
||||
# status: 'success'
|
||||
expand: preload.applicationExpandOptions
|
||||
select: [ 'id', 'app_name', 'device_type', 'commit' ]
|
||||
orderby: 'app_name asc'
|
||||
# manual filtering
|
||||
.then (applications) ->
|
||||
applications.forEach (application) ->
|
||||
application.build = application.build.filter (build) ->
|
||||
build.status == 'success'
|
||||
applications
|
||||
|
||||
selectApplication = (deviceType) ->
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
Loading…
x
Reference in New Issue
Block a user