#!/bin/bash -ex
#
# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Distribution License v. 1.0, which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: BSD-3-Clause
#

# service id: ${serviceId}
# stage: ${stage}
export SERVICE_ID=${serviceId}
export CTX=${serviceId}:${stage}-client

# clean the log
if [ -f log.txt ]; then
    mv log.txt log-`date +%Y-%m-%d_%H-%M-%S`.txt
fi;

. shared

G_STATUS=0
L_STATUS=0

<#if shutdownPorts??>
    <#list shutdownPorts as port>
wget http://127.0.0.1:$((STOP_PORT+${port}))/stop > /dev/null 2>&1 |true
    </#list>
</#if>

clean client-classes
clean client-source
clean services
clean ../mods
clean ../mods-server
clean deploy-source
clean deploy-classes
clean shared-source

