Code Monkey home page Code Monkey logo

plugins's Introduction

plugins's People

Contributors

lowkeyrd avatar wss-git avatar xsahxl avatar heimanba avatar andymanastorm avatar mahuipengf avatar

Watchers

 avatar  avatar  avatar Anycodes avatar

plugins's Issues

s-setup 插件

s-setup是一个常用的初始化功能,负责将用户的s工具配置完成。

使用方式

在steps中声明git-checkout插件

context:
  data:
    steps:
    - plugin: "@serverless-cd/s-setup"

应用中心兼容

s-setup插件兼容了应用中心的传参逻辑,可以隐式地响应应用中心运行时的ststoken参数:

echo "Setup Serverless Devs ing..."
# 打开调试模式,将命令输出
set -x
ls -al
# aliyun cloud authentication infos.
access_key_id=${{ sts.accessKeyId || "dummy-ak" }}
access_key_secret=${{ sts.accessKeySecret || "dummy-sk" }}
security_token=${{ sts.securityToken || "dummy-token" }}
uid=${{ uid || "dummy-uid" }}
# account info alias
alias=my-account
s --version
if [[ $? -ne 0 ]]; then
  echo "Serverless Devs is not installed."
  exit 1
fi
s config add --AccessKeyID "${access_key_id}" --AccessKeySecret "${access_key_secret}" \
--AccountID "${uid}" --SecurityToken "${security_token}" --access "${alias}" -f
if [[ $? -ne 0 ]]; then
  echo "Failed to setup Serverless Devs."
  exit 1
fi
echo "Setup Serverless Devs success."

setup-runtime 插件开发

setup-runtime 可以升级您的流水线构建运行时

使用方式
在steps中声明setup-runtime插件

context:
  data:
    steps:
    - plugin: "@serverless-cd/setup-runtime"
      inputs: 
        runtime:
          - nodejs14
          - nodejs16
          # - java17
          - python39
    

https://help.aliyun.com/document_detail/607229.html?spm=a2c4g.2260347.0.0.21575c10YznzDl#section-bhj-kjy-c1t

  • Node.js
    • export PATH=/usr/local/versions/node/v12.22.12/bin:$PATH
    • export PATH=/usr/local/versions/node/v16.15.0/bin:$PATH
    • export PATH=/usr/local/versions/node/v14.19.2/bin:$PATH
    • export PATH=/usr/local/versions/node/v18.14.2/bin:$PATH
  • Python
    • export PATH=/usr/local/envs/py27/bin:$PATH
    • export PATH=/usr/local/envs/py36/bin:$PATH
    • export PATH=/usr/local/envs/py37/bin:$PATH
    • export PATH=/usr/local/envs/py39/bin:$PATH
    • export PATH=/usr/local/envs/py310/bin:$PATH

export后要求环境变量影响到后面所有step

缓存cache相关

文档需求

缓存 cache原理

  • 本地key和oss bukect相关映射关系
  • 缓存如何失效, ttl: 设置失效时间: 需要给相关的OSS设置过期时间

权限和资源相关

注意事项

dingtalk在yaml模式下md格式样式异常

steps:
  - name: 钉钉通知
    plugin: "@serverless-cd/ding-talk"
    inputs:
      webhook: https://oapi.dingtalk.com/robot/send?access_token=${{secrets.DING_TALK_TOKEN}}
      msgtype: markdown
      secret: ${{secrets.DING_TALK_SECRET}}
      payload:
        title: "Serverless CD"
        text: '### 杭州天气 @150XXXXXXXX \n > 9度,西北风1级,空气良89,相对温度73%\n > ![screenshot](https://img.alicdn.com/tfs/TB1NwmBEL9TBuNjy1zbXXXpepXa-2400-1218.png)\n > ###### 10点20分发布 [天气](https://www.dingtalk.com) \n'

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.