echo -e 'Sim Release Name:\t'${SIMREL_NAME}
echo -e 'Milestone:\t\t'${MILESTONE}
echo -e 'Version:\t\t'${VERSION_NUMBER}
################################################################################
# Validate job parameters
################################################################################
if [[ -z ${SIMREL_NAME} ]]
then
exit 1
fi
if [[ -z ${MILESTONE} ]]
then
exit 1
fi
if [[ -z ${VERSION_NUMBER} ]]
then
exit 1
fi
################################################################################
# Basic constants
################################################################################
SSH="ssh genie.tracecompass@projects-storage.eclipse.org"
BASE_DIR=/home/data/httpd/
TRACECOMPASS_DIR=${BASE_DIR}download.eclipse.org/tracecompass/
RELEASE_BASE_DIR=${TRACECOMPASS_DIR}${SIMREL_NAME}/
MILESTONE_BASE_DIR=${RELEASE_BASE_DIR}milestones/
SIMREL_STABLE_DIR=${RELEASE_BASE_DIR}stable/
SIMREL_STABLE_REPOSITORY_DIR=${SIMREL_STABLE_DIR}repository/
SIMREL_STABLE_RCP_DIR=${SIMREL_STABLE_DIR}rcp/
STABLE_DIR=${TRACECOMPASS_DIR}stable/
STABLE_RCP_DIR=${STABLE_DIR}rcp/
MASTER_ARTIFACTS_DIR=${TRACECOMPASS_DIR}master/
MASTER_REPOSITORY_DIR=${MASTER_ARTIFACTS_DIR}repository/
BACKUP_ARTIFACTS_DIR=${TRACECOMPASS_DIR}tmp/backup/artifacts/
BACKUP_DOC_DIR=${TRACECOMPASS_DIR}tmp/backup/doc/
DOC_BASE_DIR=${BASE_DIR}archive.eclipse.org/tracecompass/doc/
DOC_RELEASE_STABLE_DIR=${DOC_BASE_DIR}${SIMREL_NAME}/stable/
DOC_STABLE_DIR=${DOC_BASE_DIR}stable/
FINAL_RELEASE_DIR=${TRACECOMPASS_DIR}releases/${VERSION_NUMBER}/
FINAL_RELEASE_RCP_DIR=${FINAL_RELEASE_DIR}rcp/
MILESTONE_DIR=${MILESTONE_BASE_DIR}${MILESTONE}/
RCP_INDEX_PHP=${TRACECOMPASS_DIR}scripts/rcp_index_php
################################################################################
# Email constants
################################################################################
################################################################################
# Create milestones and stable base directories
################################################################################
################################################################################
# Create simRel milestone or release directory
################################################################################
################################################################################
# Copy files and directories
################################################################################
################################################################################
# - Create artifacts directory, if needed
# - Delete old artifacts directory content, if needed.
# - Save rcp, repository and rcp-repository in artifacts directory.
################################################################################
################################################################################
# - Create doc directory, if needed
# - Delete old doc directory content, if needed.
# - Save docs in doc directory
################################################################################
################################################################################
# - Create config.php in RCP directory
# - Copy index.php to RCP directory
################################################################################
TITLE0="Trace Compass Release ${VERSION_NUMBER}"
RCP_DIR0=${FINAL_RELEASE_RCP_DIR}
${SSH} rm -rf ${RCP_DIR0}config.php
${SSH} "echo \"<?php \\\$title='${TITLE0}'; ?>\" > ${RCP_DIR0}config.php"
TITLE1="Trace Compass Latest Stable Version"
RCP_DIR1=${STABLE_RCP_DIR}
${SSH} rm -rf ${RCP_DIR1}config.php
${SSH} "echo \"<?php \\\$title='${TITLE1}'; ?>\" > ${RCP_DIR1}config.php"
################################################################################
# Output email to console
################################################################################