2017-08-27 23:03:59 +00:00
|
|
|
import * as plugins from './mod.plugins'
|
|
|
|
import { Objectmap } from 'lik'
|
|
|
|
|
|
|
|
import { DockerRegistry } from './mod.classes.dockerregistry'
|
|
|
|
|
|
|
|
export class RegistryStorage {
|
|
|
|
objectMap = new Objectmap<DockerRegistry>()
|
|
|
|
constructor () {
|
|
|
|
// Nothing here
|
|
|
|
}
|
|
|
|
|
|
|
|
addRegistry (registryArg: DockerRegistry) {
|
|
|
|
this.objectMap.add(registryArg)
|
|
|
|
}
|
|
|
|
|
|
|
|
getRegistryByUrl (registryUrlArg: string) {
|
|
|
|
return this.objectMap.find(registryArg => {
|
|
|
|
return registryArg.registryUrl === registryUrlArg
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
async loginAll () {
|
|
|
|
await this.objectMap.forEach(async registryArg => {
|
|
|
|
await registryArg.login()
|
|
|
|
})
|
2017-08-27 23:35:21 +00:00
|
|
|
plugins.beautylog.success('logged in successfully into all available DockerRegistries!')
|
2017-08-27 23:03:59 +00:00
|
|
|
}
|
|
|
|
}
|