2021-12-23 14:26:58 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: "Test Pipeline"
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- tag
|
|
|
|
|
|
|
|
steps:
|
2021-12-23 14:34:14 +01:00
|
|
|
- name: submodules
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
|
2021-12-23 14:26:58 +01:00
|
|
|
- name: "Hugo test build"
|
2022-01-04 09:27:51 +01:00
|
|
|
image: node:lts-buster-slim
|
2021-12-23 14:26:58 +01:00
|
|
|
commands:
|
2022-01-04 09:27:51 +01:00
|
|
|
- npm install
|
|
|
|
- npm run test
|
|
|
|
- npm run build
|
2021-12-23 14:26:58 +01:00
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: "Next Build Pipeline"
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- pull_request
|
|
|
|
branch:
|
|
|
|
exclude:
|
|
|
|
- master
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- "Test Pipeline"
|
|
|
|
|
|
|
|
steps:
|
2021-12-23 14:34:14 +01:00
|
|
|
- name: submodules
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
|
2021-12-23 14:26:58 +01:00
|
|
|
- name: "Build (${DRONE_BRANCH} as next)"
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
username:
|
|
|
|
from_secret: hub_user
|
|
|
|
password:
|
|
|
|
from_secret: hub_passwd
|
|
|
|
repo: ocram85/blog
|
|
|
|
tags: "next"
|
|
|
|
dockerfile: Dockerfile
|
2022-03-17 11:43:17 +01:00
|
|
|
build_args:
|
|
|
|
- NODE_BASE=lts-buster-slim
|
|
|
|
- NGINX_BASE=1.21.6-alpine
|
2021-12-23 14:26:58 +01:00
|
|
|
|
|
|
|
- name: "Trivy (next)"
|
2022-03-17 11:49:04 +01:00
|
|
|
image: aquasec/trivy:0.24.3
|
2022-03-17 11:43:17 +01:00
|
|
|
failure: ignore
|
2021-12-23 14:26:58 +01:00
|
|
|
commands:
|
2022-03-17 11:43:17 +01:00
|
|
|
- |
|
|
|
|
trivy image \
|
|
|
|
--severity UNKNOWN,LOW,MEDIUM \
|
|
|
|
--no-progress \
|
|
|
|
ocram85/blog:next
|
|
|
|
- |
|
|
|
|
trivy image \
|
|
|
|
--exit-code 1 \
|
|
|
|
--severity HIGH,CRITICAL \
|
|
|
|
--no-progress \
|
|
|
|
ocram85/blog:next
|
2021-12-23 14:26:58 +01:00
|
|
|
|
2022-01-04 11:42:42 +01:00
|
|
|
- name: "Trigger Service Update"
|
|
|
|
image: ocram85/portainer-serviceupdate
|
|
|
|
settings:
|
|
|
|
VERBOSE: true
|
|
|
|
URI: "https://portainer.ocram85.com"
|
|
|
|
TOKEN:
|
|
|
|
from_secret: NEXT_TOKEN
|
|
|
|
|
2021-12-23 14:26:58 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: "Master Build Pipeline"
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- pull_request
|
|
|
|
- tag
|
|
|
|
branch:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- "Test Pipeline"
|
|
|
|
|
|
|
|
steps:
|
2021-12-23 14:34:14 +01:00
|
|
|
- name: submodules
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
|
2021-12-23 14:26:58 +01:00
|
|
|
- name: "Build (master)"
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
username:
|
|
|
|
from_secret: hub_user
|
|
|
|
password:
|
|
|
|
from_secret: hub_passwd
|
|
|
|
repo: ocram85/blog
|
|
|
|
auto_tag: true
|
|
|
|
dockerfile: Dockerfile
|
2022-03-17 11:43:17 +01:00
|
|
|
build_args:
|
|
|
|
- NODE_BASE=lts-buster-slim
|
|
|
|
- NGINX_BASE=1.21.6-alpine
|
2021-12-23 14:26:58 +01:00
|
|
|
|
|
|
|
- name: "Trivy (latest)"
|
2022-03-17 11:49:04 +01:00
|
|
|
image: aquasec/trivy:0.24.3
|
|
|
|
failure: ignore
|
2021-12-23 14:26:58 +01:00
|
|
|
commands:
|
2022-03-17 11:43:17 +01:00
|
|
|
- |
|
|
|
|
trivy image \
|
|
|
|
--severity UNKNOWN,LOW,MEDIUM \
|
|
|
|
--no-progress \
|
|
|
|
ocram85/blog:latest
|
|
|
|
- |
|
|
|
|
trivy image \
|
|
|
|
--exit-code 1 \
|
|
|
|
--severity HIGH,CRITICAL \
|
|
|
|
--no-progress \
|
|
|
|
ocram85/blog:latest
|
2021-12-23 14:26:58 +01:00
|
|
|
|
2022-01-04 11:42:42 +01:00
|
|
|
- name: "Trigger Service Update"
|
|
|
|
image: ocram85/portainer-serviceupdate
|
|
|
|
settings:
|
|
|
|
VERBOSE: true
|
|
|
|
URI: "https://portainer.ocram85.com"
|
|
|
|
TOKEN:
|
|
|
|
from_secret: TOKEN
|
2021-12-23 14:26:58 +01:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: "Tags Pipeline"
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
include:
|
|
|
|
- tag
|
|
|
|
steps:
|
2021-12-23 14:34:14 +01:00
|
|
|
- name: submodules
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
|
2021-12-23 14:26:58 +01:00
|
|
|
- name: "Build tag image"
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
username:
|
|
|
|
from_secret: hub_user
|
|
|
|
password:
|
|
|
|
from_secret: hub_passwd
|
|
|
|
repo: ocram85/blog
|
|
|
|
auto_tag: true
|