#!/usr/bin/env ruby
# SPDX-License-Identifier: MulanPSL-2.0+
# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
# frozen_string_literal: true

require_relative '../defconfig.rb'

start_pod

docker_rm 'webhook'

cmd = %W[
  docker run
  --restart=always
  --name webhook
  -d
  -v #{ENV['CCI_SRC']}/container/webhook/root:/js
  -p 20005:20005
  node:webhook
]

cmd += ['sh', '-c', 'node /js/webhook.js']
system(*cmd)
