209 lines
4.4 KiB
YAML
209 lines
4.4 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: Test Pipeline
|
|
|
|
workspace:
|
|
path: /drone/grow
|
|
|
|
steps:
|
|
- name: yarn install
|
|
image: node:latest
|
|
commands:
|
|
- yarn install
|
|
|
|
- name: Code Style Checks
|
|
image: node:latest
|
|
commands:
|
|
- yarn prettier
|
|
|
|
- name: Lint
|
|
image: node:latest
|
|
commands:
|
|
- yarn lint
|
|
|
|
- name: Unit Tests
|
|
image: node:latest
|
|
commands:
|
|
- yarn test
|
|
|
|
- name: Send Status Notification
|
|
image: plugins/webhook
|
|
settings:
|
|
urls: https://lab.mifi.dev/hooks/9p65zpagctgkmndo8nwwm4199r
|
|
content_type: application/json
|
|
template: |
|
|
{
|
|
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
|
"text": "[{{ repo.name }} - Build # {{ build.number }}] Code Quality Checks {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
|
"username":"DroneBot"
|
|
}
|
|
when:
|
|
status:
|
|
- success
|
|
- failure
|
|
|
|
trigger:
|
|
event:
|
|
- push
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: Build Pipeline
|
|
|
|
workspace:
|
|
path: /drone/grow
|
|
|
|
steps:
|
|
- name: yarn install
|
|
image: node:latest
|
|
commands:
|
|
- yarn install
|
|
|
|
- name: Build
|
|
image: node:latest
|
|
commands:
|
|
- yarn build
|
|
|
|
- name: Send Status Notifications
|
|
image: plugins/webhook
|
|
settings:
|
|
urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
|
|
content_type: application/json
|
|
template: |
|
|
{
|
|
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
|
"text": "[{{ repo.name }} - Build # {{ build.number }}] Build package {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
|
"username":"DroneBot"
|
|
}
|
|
when:
|
|
status:
|
|
- success
|
|
- failure
|
|
|
|
depends_on:
|
|
- Test Pipeline
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: Publish Pipeline
|
|
|
|
workspace:
|
|
path: /drone/grow
|
|
|
|
steps:
|
|
- name: Build Service
|
|
image: node:latest
|
|
commands:
|
|
- cp /drone/grow/package.json ./
|
|
- cp /drone/grow/yarn.lock ./
|
|
- yarn install --frozen-lockfile
|
|
- cp -r /drone/grow/* .
|
|
- yarn build
|
|
- name: Publish NPM
|
|
image: plugins/npm
|
|
settings:
|
|
username: mifi
|
|
registry: git.mifi.dev
|
|
token:
|
|
- from_secret: gitea_token
|
|
- name: Publish Image
|
|
image: plugins/docker
|
|
settings:
|
|
auto_tag: true
|
|
squash: true
|
|
repo: git.mifi.dev/mifi/auth
|
|
registry: git.mifi.dev
|
|
ssh-agent-key:
|
|
from_secret: gitea_token
|
|
- name: Send Status Notifications
|
|
image: plugins/webhook
|
|
settings:
|
|
urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
|
|
content_type: application/json
|
|
template: |
|
|
{
|
|
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
|
"text": "[{{ repo.name }} - New tagged docker image release {{tag}} from # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
|
"username":"DroneBot"
|
|
}
|
|
when:
|
|
status:
|
|
- success
|
|
- failure
|
|
|
|
depends_on:
|
|
- Build Pipeline
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
- tag
|
|
|
|
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: Deploy Pipeline
|
|
|
|
workspace:
|
|
path: /drone/grow
|
|
|
|
# image_pull_secrets:
|
|
# - from_secret: gitea_token
|
|
|
|
steps:
|
|
- name: Deploy Container
|
|
image: docker
|
|
commands:
|
|
- compose build .
|
|
- compose up -d
|
|
# volumes:
|
|
# - name: env
|
|
# path: ./.env
|
|
# - name: dockersock
|
|
# Path: /var/run/docker.sock
|
|
- name: Send Status Notifications
|
|
image: plugins/webhook
|
|
settings:
|
|
urls: https://lab.mifi.dev/hooks/ccw34hdf7tgbjmzp96nptn938r
|
|
content_type: application/json
|
|
template: |
|
|
{
|
|
"icon_url":"https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/198/freezing-face_1f976.png",
|
|
"text": "[{{ repo.name }} - Build # {{ build.number }}] Deploy {{ build.status }} {{#success build.status}}:tada:{{else}}:poop:{{/success}}",
|
|
"username":"DroneBot"
|
|
}
|
|
when:
|
|
status:
|
|
- success
|
|
- failure
|
|
|
|
volumes:
|
|
- /volume1/docker/labs/grow-auth/.env:.env
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /volume1/docker/labs/grow-auth/dockerconfig.json:.docker/config.json
|
|
|
|
# - name: env
|
|
# host:
|
|
# path: /volume1/docker/labs/grow-auth/.env
|
|
# - name: dockersock
|
|
# host:
|
|
# path: /var/run/docker.sock
|
|
|
|
depends_on:
|
|
- Build Pipeline
|
|
|
|
trigger:
|
|
branch:
|
|
- main
|
|
event:
|
|
- tag
|