编程语言/Drone/示例

来自康健生活
Kangkk​(留言 | 贡献)2026年2月14日 (六) 16:04的版本 (创建页面,内容为“== 标题文本 == <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:…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

标题文本

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