pipeline {
    agent any

    options {
        ansiColor('xterm')
        disableConcurrentBuilds()
        timestamps()
        timeout(time: 20, unit: 'MINUTES')
        buildDiscarder(logRotator(numToKeepStr: '60'))
    }

    triggers {
        cron('45 5 * * 1-5')
    }

    stages {
        stage('Load Shared Libraries') {
            steps {
                library "jenkins-global-libraries@master"
            }
        }

        stage('Run Playwright E2E Prod Cookie Banner Tests') {
            environment {
                TAGS = "@songwhip_cookie_banner_prod"
            }
            steps {
                script {
                    playwrightTests(tags: env.TAGS, configEnvironment: 'prod', slackNotificationChannels: ['#songwhip-alerts'])
                }
            }
        }
    }
}
