import { join } from 'path' ; import * as k8s from '@pulumi/kubernetes' ; export async function deployWatcher ( app , provider , namespace ) { if ( ! provider ) return ; const labels = { app : app , tier : 'watcher' } ; const name = `${ labels . tier }` ; const podSpec = { metadata : { namespace : namespace , labels : labels , } , spec : { containers : [ { name : `${ labels . tier }` , image : 'mhart/alpine-node:14.17.3' , workingDir : '/app' , command : [ 'sh' , '-c' , 'yarn lerna run watch --scope @shapeshiftoss/* --parallel' ] , volumeMounts : [ { name : 'app' , mountPath : '/app' } ] , } , ] , volumes : [ { name : 'app' , hostPath : { path : join ( __dirname , '..' ) } } ] , } , } ; new k8s . apps . v1 . Deployment ( `${ name }` , { metadata : { name : `${ name }` , namespace : namespace , } , spec : { selector : { matchLabels : labels } , replicas : 1 , template : podSpec , } , } , { provider } ) ; }