pipeline {
    agent any
    environment {
        DOCKER_TAG = "currency_converter:$BUILD_ID"
        CONTAINER_NAME = "currency_converter_app"
    }
    stages {
        stage('Clone Repository') {
            steps {
                git branch: 'main', credentialsId: '', url: 'https://github.com/mah-shamim/simple-currency-converter.git'
            }
        }
        stage('Build Docker Image') {
            steps {
                script {
                    dockerImage = docker.build(DOCKER_TAG)
                }
            }
        }
        stage('Run Container') {
            steps {
                sh 'bash deploy.sh'
            }
        }
    }
}
