<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 憑證管理 Jenkins 的聲明式流水線語法有一個 credentials()函數,它支持 secret text(加密文本)、username 和 password(用戶名和密碼)以及 secret file(加密文件)等。接下來看一下一些常用的憑證處理方法。 ### 1.加密文本 本實例演示將兩個 Secret 文本憑證分配給單獨的環境變量來訪問 Amazon Web 服務,需要 提前創建這兩個文件的 credentials,Jenkinsfile 文件的內容如下 ~~~json //Jenkinsfile (Declarative Pipeline) pipeline { agent any environment { AWS_ACCESS_KEY_ID = credentials('txt1') AWS_SECRET_ACCESS_KEY = credentials('txt2') } stages { stage('Example stage 1') { steps { echo "$AWS_ACCESS_KEY_ID" } } stage('Example stage 2') { steps { echo "$AWS_SECRET_ACCESS_KEY" } } } } ~~~ ### 2.用戶名密碼 本示例用來演示 credentials 賬號密碼的使用,比如使用一個公用賬戶訪問Bitbucket、GitLab、 Harbor 等。假設已經配置完成了用戶名密碼形式的 credentials,憑證ID為harbor-account ~~~json //Jenkinsfile (Declarative Pipeline) pipeline { agent any environment { BITBUCKET_COMMON_CREDS = credentials('harbor-account') } stages { stage('printenv') { steps { sh "env" } } } ~~~ **上述的配置會自動生成3個環境變量** * BITBUCKET\_COMMON\_CREDS:包含一個以冒號分隔的用戶名和密碼,格式為 username:password * BITBUCKET\_COMMON\_CREDS\_USR:僅包含用戶名的附加變量 * BITBUCKET\_COMMON\_CREDS\_PSW:僅包含密碼的附加變量。 ### 3.加密文件 需要加密保存的文件,也可以使用 credential,比如鏈接到 Kubernetes 集群的 kubeconfig 文件等。 假如已經配置好了一個kubeconfig文件,此時可以在Pipeline中引用該文件 ~~~ //Jenkinsfile (Declarative Pipeline) pipeline { agent { kubernetes { cloud 'kubernetes' slaveConnectTimeout 1200 workspaceVolume emptyDirWorkspaceVolume() yaml ''' kind: Pod metadata: name: jenkins-agent spec: containers: - args: [\'$(JENKINS_SECRET)\', \'$(JENKINS_NAME)\'] image: '192.168.10.15/kubernetes/jnlp:alpine' name: jnlp imagePullPolicy: IfNotPresent - command: - "cat" image: "192.168.10.15/kubernetes/kubectl:apline" imagePullPolicy: "IfNotPresent" name: "kubectl" tty: true restartPolicy: Never ''' } } environment { MY_KUBECONFIG = credentials('kubernetes-cluster') } stages { stage('kubectl') { steps { container(name: 'kubectl') { sh """ kubectl get pod -A --kubeconfig $MY_KUBECONFIG """ } } } } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看