jenkins推送代码到aws的s3存储桶

1.aws创建用户










2.服务器配置安装aws

pip3.6 install awscli

AWS Access Key ID [None]: 公钥
AWS Secret Access Key [None]: 私钥
Default region name [None]: 地域
Default output format [None]: json

3.s3存储桶要提前建好

4.pipline

pipeline {
    environment {
        APPNAME = sh(script: "echo ${env.JOB_NAME}|awk -F_ '{print \$NF}'", returnStdout: true).trim()
    }
    stages {
        stage('拉取代码'){
            steps{
                git branch: 'test', credentialsId: '417948ae-4050fca40c9', url: '${GITURL}'
            }
        }
        stage('构建代码') {
            steps {
                sh " npm config -g set registry  https://registry.npmmirror.com/ "
                sh " npm install  && npm run build "
            }
        }
        stage('发布代码'){
            steps{
                sh """ aws s3 cp ./dist/cloud-computer-custom.umd.min.js s3://cdndeve.baidu.com/test/cloudComputerComponent/ """
            }
        }
    }
}

posted @   六月OvO  阅读(63)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
历史上的今天:
2022-08-16 centos安装buildah指定版本1.19.6
点击右上角即可分享
微信分享提示