pipeline {
    agent {
        label "unix"
    }
    stages {
        stage('Roll back gtoolkit.com') {
            steps {
                script {
                    withCredentials([sshUserPrivateKey(credentialsId: '31ee68a9-4d6c-48f3-9769-a2b8b50452b0', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')]) {
                        def remote = [:]
                        remote.name = 'deploy'
                        remote.host = 'ec2-18-197-145-81.eu-central-1.compute.amazonaws.com'
                        remote.user = userName
                        remote.identityFile = identity
                        remote.allowAnyHosts = true
                        sshScript remote: remote, script: "scripts/rollback/rollback.sh"
                    }
                }
            }
        }
    }
}