1
0
forked from Kieran/snort
snort4/.drone.yml

168 lines
3.6 KiB
YAML
Raw Normal View History

2023-05-14 21:15:34 +00:00
---
kind: pipeline
type: kubernetes
2023-05-14 21:17:45 +00:00
name: docker
2023-05-15 10:57:18 +00:00
concurrency:
limit: 1
2023-05-15 10:58:32 +00:00
trigger:
2023-07-03 11:59:18 +00:00
branch:
2023-07-22 18:37:46 +00:00
- main
2023-10-09 09:09:39 +00:00
event:
- push
2023-05-14 21:15:34 +00:00
metadata:
namespace: git
steps:
2023-11-07 14:21:29 +00:00
- name: Fetch tags
image: alpine/git
commands:
- git fetch --tags
2023-05-17 10:19:51 +00:00
- name: Build site
2024-01-26 15:23:27 +00:00
image: node:current
2023-05-17 10:19:51 +00:00
volumes:
- name: cache
path: /cache
2023-07-03 10:56:13 +00:00
environment:
2023-05-17 10:19:51 +00:00
YARN_CACHE_FOLDER: /cache/.yarn-docker
2024-01-26 15:04:54 +00:00
NODE_CONFIG_ENV: default
2023-05-17 10:19:51 +00:00
commands:
2024-01-26 16:55:30 +00:00
- apt update && apt install -y git
2023-05-17 10:19:51 +00:00
- yarn install
- yarn build
2023-05-14 21:15:34 +00:00
- name: build docker image
2024-01-26 15:04:54 +00:00
image: docker
2023-05-14 21:15:34 +00:00
privileged: true
2023-05-14 21:26:57 +00:00
volumes:
- name: cache
2023-05-15 10:20:35 +00:00
path: /cache
2023-07-03 10:56:13 +00:00
environment:
2023-05-14 21:15:34 +00:00
TOKEN:
2023-07-03 10:20:24 +00:00
from_secret: docker_hub
2023-05-14 21:15:34 +00:00
commands:
2024-01-26 15:04:54 +00:00
- dockerd &
- docker login -u voidic -p $TOKEN
2024-01-26 15:37:51 +00:00
- docker buildx create --name mybuilder --bootstrap --use
2024-01-26 15:42:00 +00:00
- docker buildx build -t voidic/snort:latest --platform linux/amd64,linux/arm64 --push -f Dockerfile.prebuilt .
2024-01-26 15:04:54 +00:00
- kill $(cat /var/run/docker.pid)
2023-05-14 21:26:57 +00:00
volumes:
2023-07-22 18:37:46 +00:00
- name: cache
claim:
name: docker-cache
2023-05-14 21:52:37 +00:00
---
kind: pipeline
type: kubernetes
2023-07-03 12:17:36 +00:00
name: test-lint
2023-06-16 08:55:38 +00:00
concurrency:
limit: 1
metadata:
namespace: git
steps:
2023-07-03 12:17:36 +00:00
- name: Test/Lint
2024-01-26 15:23:27 +00:00
image: node:current
2023-06-16 08:55:38 +00:00
volumes:
- name: cache
path: /cache
2023-07-03 10:56:13 +00:00
environment:
2023-07-03 12:17:36 +00:00
YARN_CACHE_FOLDER: /cache/.yarn-test
2024-01-26 15:04:54 +00:00
NODE_CONFIG_ENV: default
2023-06-16 08:55:38 +00:00
commands:
- yarn install
- yarn build
2023-07-03 12:17:36 +00:00
- yarn test
- yarn workspace @snort/app eslint
2023-09-05 14:21:39 +00:00
- yarn prettier --check .
2023-06-16 08:55:38 +00:00
volumes:
2023-07-22 18:37:46 +00:00
- name: cache
claim:
name: docker-cache
2023-06-16 08:55:38 +00:00
---
kind: pipeline
type: kubernetes
2023-07-03 12:17:36 +00:00
name: crowdin
2023-05-15 10:57:18 +00:00
concurrency:
limit: 1
2023-07-03 12:17:36 +00:00
trigger:
branch:
2023-07-22 18:37:46 +00:00
- main
2023-10-09 09:09:39 +00:00
event:
- push
2023-05-14 21:52:37 +00:00
metadata:
namespace: git
steps:
2023-07-03 12:17:36 +00:00
- name: Push/Pull translations
2024-01-26 15:23:27 +00:00
image: node:current
2023-05-15 10:16:47 +00:00
volumes:
- name: cache
2023-05-15 10:20:35 +00:00
path: /cache
2023-07-03 10:56:13 +00:00
environment:
2023-07-03 12:17:36 +00:00
YARN_CACHE_FOLDER: /cache/.yarn-translations
2024-01-26 15:04:54 +00:00
NODE_CONFIG_ENV: default
2023-07-03 12:17:36 +00:00
TOKEN:
from_secret: gitea
CTOKEN:
from_secret: crowdin
2023-05-14 21:52:37 +00:00
commands:
2023-07-03 12:17:36 +00:00
- git config --global user.email drone@v0l.io
- git config --global user.name "Drone CI"
- git remote set-url origin https://drone:$TOKEN@git.v0l.io/Kieran/snort.git
2023-05-14 21:52:37 +00:00
- yarn install
2023-07-03 12:17:36 +00:00
- npx @crowdin/cli upload sources -b main -T $CTOKEN
- npx @crowdin/cli pull -b main -T $CTOKEN
2023-09-12 14:57:28 +00:00
- yarn prettier --write .
2023-07-03 12:17:36 +00:00
- git add .
2023-10-06 12:31:10 +00:00
- >
if output=$(git status --porcelain) && [ -n "$output" ]; then
git commit -a -m "chore: Update translations"
git push -u origin main
fi
2023-05-15 10:16:47 +00:00
volumes:
2023-07-22 18:37:46 +00:00
- name: cache
claim:
name: docker-cache
2023-07-03 12:23:45 +00:00
---
kind: pipeline
type: kubernetes
name: docker-release
concurrency:
limit: 1
trigger:
event:
2023-07-22 18:37:46 +00:00
- tag
2023-07-03 12:23:45 +00:00
metadata:
namespace: git
steps:
2023-11-07 14:21:29 +00:00
- name: Fetch tags
image: alpine/git
commands:
- git fetch --tags
2023-07-03 12:23:45 +00:00
- name: Build site
2024-01-26 15:23:27 +00:00
image: node:current
2023-07-03 12:23:45 +00:00
volumes:
- name: cache
path: /cache
environment:
2024-01-26 15:04:54 +00:00
YARN_CACHE_FOLDER: /cache/.yarn-docker-
NODE_CONFIG_ENV: default
2023-07-03 12:23:45 +00:00
commands:
2024-01-26 16:55:30 +00:00
- apt update && apt install -y git
2023-07-03 12:23:45 +00:00
- yarn install
- yarn build
- name: build docker image
2024-01-26 15:04:54 +00:00
image: docker
2023-07-03 12:23:45 +00:00
privileged: true
volumes:
- name: cache
path: /cache
environment:
TOKEN:
from_secret: docker_hub
commands:
2024-01-26 15:04:54 +00:00
- dockerd &
- docker login -u voidic -p $TOKEN
2024-01-26 15:37:51 +00:00
- docker buildx create --name mybuilder --bootstrap --use
2024-01-26 15:42:00 +00:00
- docker buildx build -t voidic/snort:$DRONE_TAG --platform linux/amd64,linux/arm64 --push -f Dockerfile.prebuilt .
2024-01-26 15:04:54 +00:00
- kill $(cat /var/run/docker.pid)
2023-07-03 12:23:45 +00:00
volumes:
2023-07-22 18:37:46 +00:00
- name: cache
claim:
name: docker-cache