Skip to content

Commit 44302b7

Browse files
committed
fix: fix release script
1 parent 22e6e6e commit 44302b7

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

.woodpecker/buildSlackNotify.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ set -x
44

55
COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | cut -c1-8)
66

7+
STATUS=${1}
78

8-
if [ "$CI_STEP_STATUS" = "success" ]; then
9+
10+
if [ "$STATUS" = "success" ]; then
911
MESSAGE="Did a build without issues on \`$CI_REPO_NAME/$CI_COMMIT_BRANCH\`. Commit: _${CI_COMMIT_MESSAGE}_ (<$CI_COMMIT_URL|$COMMIT_SHORT_SHA>)"
1012

1113
curl -s -X POST -H "Content-Type: application/json" -d '{

.woodpecker/release.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,42 @@ steps:
1616
commands:
1717
- infisical export --domain https://vault.devforth.io/api --format=dotenv-export --env="prod" > /woodpecker/deploy.vault.env
1818

19-
release:
19+
build:
2020
image: node:20
2121
when:
2222
- event: push
23-
volumes:
24-
- /var/run/docker.sock:/var/run/docker.sock
2523
commands:
2624
- apt update && apt install -y rsync
27-
- export $(cat /woodpecker/deploy.vault.env | xargs)
25+
- . /woodpecker/deploy.vault.env
2826
- npm clean-install
2927
- /bin/bash ./.woodpecker/buildRelease.sh
3028
- npm audit signatures
29+
30+
release:
31+
image: node:20
32+
when:
33+
- event:
34+
- push
35+
branch:
36+
- main
37+
commands:
38+
- . /woodpecker/deploy.vault.env
3139
- npx semantic-release
3240

3341
slack-on-failure:
42+
image: curlimages/curl
3443
when:
3544
- event: push
36-
status: [failure, success]
37-
- event: push
45+
status: [failure]
46+
commands:
47+
- . /woodpecker/deploy.vault.env
48+
- /bin/sh ./.woodpecker/buildSlackNotify.sh failure
49+
50+
slack-on-success:
3851
image: curlimages/curl
52+
when:
53+
- event: push
54+
status: [success]
3955
commands:
40-
- export $(cat /woodpecker/deploy.vault.env | xargs)
41-
- /bin/sh ./.woodpecker/buildSlackNotify.sh
42-
56+
- . /woodpecker/deploy.vault.env
57+
- /bin/sh ./.woodpecker/buildSlackNotify.sh success

0 commit comments

Comments
 (0)