Skip to content

Instantly share code, notes, and snippets.

@pimterry
Last active April 13, 2018 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pimterry/aa8728e5cf3cba561ca7d18d8e92a558 to your computer and use it in GitHub Desktop.
Save pimterry/aa8728e5cf3cba561ca7d18d8e92a558 to your computer and use it in GitHub Desktop.
Set the build for a set of resin.io devices by matching tag metadata
let APP_ID = ...;
let TAG_KEY = ...;
let TAG_VALUE = ...; // Remove this and its use below to ignore the value
let TARGET_ID = ...; // Build id (not commit hash)
sdk.pine.patch({
resource: 'device',
options: {
filter: {
belongs_to__application: APP_ID,
device_tag: {
$any: {
$alias: 'dt',
$expr: {
dt: {
tag_key: TAG_KEY,
value: TAG_VALUE
}
}
}
}
}
},
body: { should_be_running__build: TARGET_ID }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment