将SQLPlus下载到Jenkins Server

发布于 2025-02-13 14:58:54 字数 225 浏览 0 评论 0原文

我正在尝试在Jenkins构建中运行SQLPLU(我在本地安装了SQLPLU)。当前,我的构建中有一个称为路径的变量:

PATH=/usr/local/Cellar/instantclient

我的构建稳定,詹金斯能够连接到数据库并执行命令。是否可以在未安装SQLPLU的Jenkins服务器上运行SQLPLUS命令。我正在尝试避免使用SQLPLUS脚本Runner插件。

I'm trying to run SQLPlus in a Jenkins build (I have SQLPlus installed on my local). Currently, I have a variable in my build called PATH:

PATH=/usr/local/Cellar/instantclient

My build is stable and Jenkins is able to connect to the database and execute commands. Is there a way to run SQLPlus commands on a Jenkins server that doesn't have SQLPlus installed. I'm trying to avoid using the SQLPlus script runner plug in as well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

埋葬我深情 2025-02-20 14:58:54

您可以通过管道本身安装SQLPLU。例如,请参阅以下内容。话虽如此,如果您有一个静态的Jenkins实例,则最好的选择是安装服务器本身需要的任何工具。

pipeline {
    agent any

    stages {
        stage('SetUpSQLPLus') {
            steps {
                echo 'Setup'
                cleanWs()
                sh """
                curl -LO https://download.oracle.com/otn_software/linux/instantclient/216000/instantclient-sqlplus-linux.x64-21.6.0.0.0dbru.zip
                unzip instantclient-sqlplus*.zip
                cd instantclient_21_6
                chmod +x sqlplus
                ./sqlplus --version
                """
            }
        }
    }
}

You can install SQLPlus through the pipeline itself. For example, refer to the following. Having said that, if you have a static Jenkins instance best option is to install whatever tools that are required in the server itself.

pipeline {
    agent any

    stages {
        stage('SetUpSQLPLus') {
            steps {
                echo 'Setup'
                cleanWs()
                sh """
                curl -LO https://download.oracle.com/otn_software/linux/instantclient/216000/instantclient-sqlplus-linux.x64-21.6.0.0.0dbru.zip
                unzip instantclient-sqlplus*.zip
                cd instantclient_21_6
                chmod +x sqlplus
                ./sqlplus --version
                """
            }
        }
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文