查看“︁编程语言/Drone/示例”︁的源代码
来自康健生活
←
编程语言/Drone/示例
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 标题文本 == <syntaxhighlight lang="yaml"> kind: pipeline name: example-service trigger: branch: - master steps: - name: npm-auth image: robertstettner/drone-npm-auth settings: username: username password: password email: username@iftech.io registry: https://npm.yourcompany.com scope: '@jike' - name: install image: node:10 commands: - npm ci - name: lint image: node:10 commands: - npm run lint - name: compile image: node:10 commands: - npm run compile - name: test image: node:10 commands: - npm t - name: ecr-build-push image: plugins/ecr settings: repo: example.ecr.region.amazonaws.com/example-service registry: example.ecr.region.amazonaws.com region: region create_repository: true tags: - ${DRONE_SOURCE_BRANCH//\//-}-${DRONE_COMMIT:0:7} - name: notify image: plugins/webhook settings: urls: http://jkdpy-dashboard-svc.infra:8000/api/images/ content_type: application/x-www-form-urlencoded template: | image_name=example.ecr.region.amazonaws.com/example-service:${DRONE_COMMIT:0:7}&\ branch_name=${DRONE_SOURCE_BRANCH}&\ service_name=example-service&\ commit_message=${DRONE_COMMIT_MESSAGE} services: - name: kafka image: spotify/kafka ports: - 9092 - name: redis image: redis ports: - 6379 - name: mongo image: mongo ports: - 27017</syntaxhighlight> <syntaxhighlight lang="yaml"> kind: pipeline # 定义一个管道 type: docker # 当前管道的类型 name: test # 当前管道的名称 volumes: # 声明数据卷(此为服务器中的实际目录) - name: node_modules # 数据卷名称 host: # Host Volume path: /volumes/drone/volumes/blog/node_modules # 宿主机目录 #绝对路径 - name: deploy_path host: path: /workspace/blog clone: disable: false # 启用代码拉取 steps: # 定义管道的执行步骤 - name: deploy # 步骤名称 image: node:16.13.2 # 当前步骤使用的镜像 depends_on: [clone] # 依赖的步骤 volumes: # 挂载数据卷(此为容器内的目录) - name: node_modules # 数据卷名称 path: /drone/src/node_modules # 容器内目录 绝对路径 - name: deploy_path path: /drone/src/html commands: # 当前步骤执行的命令 - pwd # 查看当前目录 - npm config set registry https://registry.npm.taobao.org # 切换淘宝镜像 - npm install # 安装node_modules包 - npm run build # 执行编译 # - rm -fr ./blog - ls /drone/src - cp -r ./public/* ./html</syntaxhighlight>
返回
编程语言/Drone/示例
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。