Is there any advanced script o execute the below stage . where i have used old traditional way of pre building steps modifying scripts based on the enviroment choosed

stage(‘Build stage and Warfile Backup stage’) {
steps {
script{
catchError{
echo “Build is running”
sh ‘mvn clean install -DskipTests’

            def gmtDate = sh(script: 'date -u --date="5 hours 30 minutes ago" "+%d-%m-%Y_%H:%M:%S"', returnStdout: true).trim()

            if (params.ENVIRONMENT == 'Stability') {
                sh 'mv /opt/jenkins/workspace/fDoctorWeb/target/DoctorWeb.war /opt/jenkins/workspace/fDoctorWeb/target/fDoctorWeb.war'
                sh 'cp /opt/jenkins/workspace/fDoctorWeb/target/fDoctorWeb.war  /opt/jenkins/backup_wars/fDoctorWeb/Stability'
                sh 'mv /opt/jenkins/backup_wars/fDoctorWeb/Stability/fDoctorWeb.war /opt/jenkins/backup_wars/fDoctorWeb/Stability/fDoctorWeb_' + gmtDate + '.war' 
            } else if(params.ENVIRONMENT == 'Weconnect')  {
                sh 'mv /opt/jenkins/workspace/fDoctorWeb/target/DoctorWeb.war /opt/jenkins/workspace/fDoctorWeb/target/fDoctorWeb.war'
                sh 'cp /opt/jenkins/workspace/fDoctorWeb/target/fDoctorWeb.war  /opt/jenkins/backup_wars/fDoctorWeb/Weconnect'
                sh 'mv /opt/jenkins/backup_wars/fDoctorWeb/Weconnect/fDoctorWeb.war /opt/jenkins/backup_wars/fDoctorWeb/Weconnect/fDoctorWeb_' + gmtDate + '.war' 
            }
            else{
                echo "Check Path of backup wars"
            }
                }
            }
        }
    }