feat: updated the deploy pipeline
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
0f9d634442
commit
a9c1c635e7
154
.drone.yml
154
.drone.yml
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: build
|
name: 'build and deploy'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: hugo-extended
|
- name: hugo-extended
|
||||||
@ -13,43 +13,25 @@ steps:
|
|||||||
- hugo version
|
- hugo version
|
||||||
- hugo --gc=true --minify
|
- hugo --gc=true --minify
|
||||||
|
|
||||||
|
- name: deploy
|
||||||
---
|
pull: always
|
||||||
kind: pipeline
|
image: immawanderer/alpine-rsync:latest
|
||||||
type: docker
|
|
||||||
name: deploy
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: ssh-deploy
|
|
||||||
pull: if-not-exists
|
|
||||||
image: appleboy/drone-ssh:latest
|
|
||||||
settings:
|
|
||||||
host:
|
|
||||||
from_secret: hugo_host
|
|
||||||
username:
|
|
||||||
from_secret: hugo_user
|
|
||||||
password:
|
|
||||||
from_secret: hugo_passwd
|
|
||||||
script_stop: true
|
|
||||||
script:
|
|
||||||
- cd ~/dtya
|
|
||||||
- eval $(ssh-agent)
|
|
||||||
- ssh-add ~/.ssh/overlord
|
|
||||||
- git pull -4
|
|
||||||
- ./deploy "0.73.0"
|
|
||||||
when:
|
when:
|
||||||
status:
|
status:
|
||||||
- success
|
- success
|
||||||
|
depends_on:
|
||||||
depends_on:
|
- hugo-extended
|
||||||
- build
|
environment:
|
||||||
|
OL:
|
||||||
|
from_secret: hugo_user
|
||||||
|
OL_P:
|
||||||
|
from_secret: hugo_passwd
|
||||||
|
OL_D:
|
||||||
|
from_secret: hugo_dir
|
||||||
|
commands:
|
||||||
|
- export DAT_DIR=$OL_D
|
||||||
|
- export RSYNC_PASSWORD=$OL_P
|
||||||
|
- rsync -av --delete chown $OL public/ $OL@dotya.ml:$DAT_DIR
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -75,99 +57,7 @@ trigger:
|
|||||||
- failure
|
- failure
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- 'build and deploy'
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: discord
|
|
||||||
pull: if-not-exists
|
|
||||||
image: appleboy/drone-discord:latest
|
|
||||||
settings:
|
|
||||||
message: >
|
|
||||||
{{#success build.status}}
|
|
||||||
✅ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded.
|
|
||||||
event: **`{{build.event}}`**
|
|
||||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
|
||||||
```{{commit.message}}```
|
|
||||||
{{else}}
|
|
||||||
❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed.
|
|
||||||
event: **`${DRONE_BUILD_EVENT}`**
|
|
||||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
|
||||||
```{{commit.message}}```
|
|
||||||
{{/success}}
|
|
||||||
webhook_id:
|
|
||||||
from_secret: discord_webhook_id
|
|
||||||
webhook_token:
|
|
||||||
from_secret: discord_webhook_token
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: notifications-cronbuild
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- cron
|
|
||||||
cron:
|
|
||||||
- hourly
|
|
||||||
- hourly-build
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
- failure
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: discord
|
|
||||||
pull: always
|
|
||||||
image: appleboy/drone-discord:latest
|
|
||||||
settings:
|
|
||||||
message: >
|
|
||||||
{{#success build.status}}
|
|
||||||
✅ [Hourly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` succeeded.
|
|
||||||
event: **`{{build.event}}`**
|
|
||||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
|
||||||
{{else}}
|
|
||||||
❌ [Hourly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed.
|
|
||||||
event: **`${DRONE_BUILD_EVENT}`**
|
|
||||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
|
||||||
```{{commit.message}}```
|
|
||||||
{{/success}}
|
|
||||||
webhook_id:
|
|
||||||
from_secret: discord_webhook_hourly_id
|
|
||||||
webhook_token:
|
|
||||||
from_secret: discord_webhook_hourly_token
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: notifications-deploy
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
clone:
|
|
||||||
disable: true
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
- "dev*"
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
- failure
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: discord
|
- name: discord
|
||||||
@ -182,7 +72,9 @@ steps:
|
|||||||
{{else}}
|
{{else}}
|
||||||
❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed to deploy.
|
❌ [Build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed to deploy.
|
||||||
event: **`${DRONE_BUILD_EVENT}`**
|
event: **`${DRONE_BUILD_EVENT}`**
|
||||||
|
failed stage(s): **`${DRONE_FAILED_STAGES}`**
|
||||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
||||||
|
```{{commit.message}}```
|
||||||
{{/success}}
|
{{/success}}
|
||||||
webhook_id:
|
webhook_id:
|
||||||
from_secret: discord_webhook_id
|
from_secret: discord_webhook_id
|
||||||
@ -191,7 +83,7 @@ steps:
|
|||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: notifications-cron-deploy
|
name: notifications-cron
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
@ -211,7 +103,7 @@ trigger:
|
|||||||
- failure
|
- failure
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- deploy
|
- 'build and deploy'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: discord
|
- name: discord
|
||||||
@ -226,7 +118,9 @@ steps:
|
|||||||
{{else}}
|
{{else}}
|
||||||
❌ [Hourly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed to deploy.
|
❌ [Hourly build #{{build.number}}]({{build.link}}) of `{{repo.name}}` failed to deploy.
|
||||||
event: **`${DRONE_BUILD_EVENT}`**
|
event: **`${DRONE_BUILD_EVENT}`**
|
||||||
|
failed stage(s): **`${DRONE_FAILED_STAGES}`**
|
||||||
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
commit [`${DRONE_COMMIT_SHA:0:7}`](https://git.dotya.ml/${DRONE_REPO}/commit/${DRONE_COMMIT_SHA}) by {{commit.author}} on `{{commit.branch}}`
|
||||||
|
```{{commit.message}}```
|
||||||
{{/success}}
|
{{/success}}
|
||||||
webhook_id:
|
webhook_id:
|
||||||
from_secret: discord_webhook_hourly_id
|
from_secret: discord_webhook_hourly_id
|
||||||
|
24
deploy
24
deploy
@ -1,24 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
USR=dotyaoverlord
|
|
||||||
HOST=dotya.ml
|
|
||||||
DIR=public/
|
|
||||||
export HUGO_VERSION=$1
|
|
||||||
PATH=~/.local/bin:~/bin:$PATH
|
|
||||||
|
|
||||||
gethugo $HUGO_VERSION
|
|
||||||
|
|
||||||
git submodule init
|
|
||||||
git submodule update --remote --merge
|
|
||||||
|
|
||||||
which hugo
|
|
||||||
hugo version
|
|
||||||
hugo --gc=true --minify
|
|
||||||
|
|
||||||
if [ $USER = $USR ]; then
|
|
||||||
rsync -av --delete public/ ~/${DIR}
|
|
||||||
else
|
|
||||||
rsync -avz --delete public/ ${USR}@${HOST}:~/${DIR}
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
Loading…
Reference in New Issue
Block a user