惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

思有云 - IOIOX - 运维部署

甲骨文云 Oracle Cloud 服务器防回收保活 docker 命令 - 思有云 甲骨文云 Oracle Cloud 引导卷扩展和块存储卷挂载 - 思有云 甲骨文云 Oracle Cloud 解决 ARM 服务器安装军哥 LNMP 环境的几个问题 - 思有云 PostgreSql 14 主从负载均衡部署记录 - 思有云 drone ci 工作流语法变量高级使用教程 - 思有云 部署 MinIO 通用 S3 协议对象存储服务当网盘和图床使用 - 思有云 Bark 推送服务的部署和使用小技巧 - 思有云 - IOIOX Docker 安装 Gitea + Drone 开源代码仓库及 CI/CD 教程 - 思有云 Docker Compose 部署监控系统 Prometheus + Grafana + Node Exporter + Cadvisor - 思有云
分享三种常用的 drone 工作流 CI 配置 - 思有云
博主: Stille · 2022-01-26 · via 思有云 - IOIOX - 运维部署
  • 发布时间:
  • 10873 次浏览
  • 1 条评论
  • 1602字数
  • 分类: 运维部署
  1. 首页
  2. 正文  

前言

Gitea 和 Drone 的安装部署请阅读以下文章,本文简单分享三种常用的 drone 工作流 CI 配置.

本文为 Stille 原创文章.经实践,测试,整理发布.如需转载请联系作者获得授权,并注明转载地址.


docker 镜像的构建和上传

默认是在仓库根目录进行构建,并将你的 docker hub 账号密码配置在 drone - Settings 里.

kind: pipeline
name: docker build

steps:
- name: docker  
  image: plugins/docker
  settings:
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    repo: stilleshan/frpc
    tags:
    - latest

如果需要构建的项目文件及Dockerfile在子目录,则需要配置contextdockerfile参数,例如以下构建frpc的镜像则是在子目录里.

kind: pipeline
name: docker build

steps:
- name: docker  
  image: plugins/docker
  settings:
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    repo: ioiox/frpc
    context: frpc
    dockerfile: frpc/Dockerfile
    tags:
    - latest

使用特定的功能镜像

可以使用一些工具型镜像来完成一些后续操作,例如stilleshan/coscmd是用于上传文件到腾讯云 COS 对象存储,可以预先在仓库里配置.cos.conf相关 API key 等信息,不过注意建议在私有仓库来这么做,以免泄露 COS 相关信息.

kind: pipeline
name: cos

steps:
- name: cos
  image: stilleshan/coscmd
  commands:
  - mv .cos.conf /root/.cos.conf
  - coscmd upload -rfs frpc /frpc

常规 shell 操作

如果不想安装官方 EXEC 的 runner 来执行 shell, 也可是可以直接使用容器来执行,可以预先搭建好容器环境,也可以使用官方镜像直接在工作流里安装环境,在执行后续操作.

kind: pipeline
name: test shell

steps:
- name: testing
  image: alpine
  commands:
  - echo hello world
  - pwd
  - ls
  - ls -la
  - date
  - apk add ...

晚高峰稳定 4K 的 IPLC 机场 解锁各流媒体 支持 ChatGPT. 晚高峰稳定 4K 的 IPLC 机场 解锁各流媒体 支持 ChatGPT. RedteaGO - 最划算的大陆漫游 eSim 流量卡,原生境外 IP,注册就送 3 刀。
RedteaGO - 最划算的大陆漫游 eSim 流量卡,原生境外 IP,注册就送 3 刀。

赞赏作者

如果喜欢我的文章,觉得对你有帮助,请随意赞赏!

分享三种常用的 drone 工作流 CI 配置

 •