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

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

思有云 - 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 配置

 •