forked from bitrise-steplib/steps-slack-message
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitrise.yml
181 lines (167 loc) · 5.65 KB
/
bitrise.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app:
envs:
- STEP_VERSION: 2.6.3
- SLACK_WEBHOOK_URL: $SLACK_WEBHOOK_URL
- SLACK_CHANNEL: $SLACK_CHANNEL
workflows:
do-vendor-update:
steps:
- script:
title: go deps update
inputs:
- content: |
#!/bin/bash
set -ex
go get -u -v github.com/tools/godep
rm -rf ./Godeps
rm -rf ./vendor
go get -t -d ./...
go get github.com/davecgh/go-spew/spew
go get github.com/pmezard/go-difflib/difflib
godep save ./...
fail-message-test:
steps:
- script:
title: Fail
inputs:
- content: exit 1
- path::./:
title: On Error
is_skippable: false
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: $SLACK_CHANNEL
- from_username_on_error: step-dev-test-ON-ERROR
- message: On Error TEST
invalid-channel-test:
steps:
- path::./:
is_skippable: false
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: no-channel-like-this
missing-webhook-url-test:
steps:
- path::./:
is_skippable: false
share-this-step:
description: |-
If this is the first time you try to share a Step you should
first call: $ bitrise share
This will print you a guide, and information about how Step sharing
works. Please read it at least once!
As noted in the Step sharing guide you'll have to fork the
StepLib you want to share this step into. Once you're done with forking
the repository you should set your own fork's git clone URL
in the `.bitrise.secrets.yml` file, or here in the `envs` section,
as the value of the `MY_STEPLIB_REPO_FORK_GIT_URL` environment.
You're now ready to share this Step, just make sure that
the `STEP_ID_IN_STEPLIB` and `STEP_GIT_VERION_TAG_TO_SHARE`
environments are set to the desired values!
To share this Step into a StepLib you can just run: $ bitrise run share-this-step
Once it finishes the only thing left is to actually create a Pull Request,
the way described in the guide printed at the end of the process.
envs:
- MY_STEPLIB_REPO_FORK_GIT_URL: $MY_STEPLIB_REPO_FORK_GIT_URL
- STEP_ID_IN_STEPLIB: slack
- STEP_GIT_VERION_TAG_TO_SHARE: $STEP_VERSION
- STEP_GIT_CLONE_URL: https://github.com/bitrise-io/steps-slack-message.git
steps:
- script:
inputs:
- content: |-
#!/bin/bash
set -e
set -x
bitrise share start -c ${MY_STEPLIB_REPO_FORK_GIT_URL}
bitrise share create --stepid ${STEP_ID_IN_STEPLIB} --tag ${STEP_GIT_VERION_TAG_TO_SHARE} --git ${STEP_GIT_CLONE_URL}
bitrise share finish
# ----------------------------------------------------------------
# --- workflows to create Release
create-release:
steps:
- script:
title:
inputs:
- content: |
#!/bin/bash
set -ex
go get -u github.com/bitrise-tools/releaseman
export CI=true
releaseman create --version $STEP_VERSION
test:
steps:
- script:
title: go test
inputs:
- content: |
#!/bin/bash
set -ex
go test ./...
- path::./:
title: On Success
is_skippable: false
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: $SLACK_CHANNEL
- from_username: step-dev-test
- link_names: "yes"
- message: |
First, On Success test
Multiline, with a link: https://www.bitrise.io ,
_some_ *highlight*,
and linkify @slackbot #random
- color: good
- path::./:
title: On Success - without channel
is_skippable: false
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: ""
- from_username: step-dev-test
- message: On Success test - without channel param
- color: warning
- path::./:
title: On Success
description: Overwrite the emoji parameter with an Icon URL input.
is_skippable: false
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: $SLACK_CHANNEL
- from_username: step-dev-test-2
- message: The Icon URL should be used instead of the Emoji input!
- emoji: ':white_check_mark:'
- icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png
- is_debug_mode: "yes"
- color: '#00ff00'
- path::./:
title: On Success - with an image / gif
is_skippable: false
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: $SLACK_CHANNEL
- from_username: step-dev-test
- message: |
On Success test - with an image
Multiline, with a link: https://www.bitrise.io ,
and _some_ *highlight*
- color: good
- image_url: https://media.giphy.com/media/6brH8dM3zeMyA/giphy.gif
- script@1.1.3:
title: Generate SLACK_MESSAGE_FROM_SCRIPT
inputs:
- content: |-
#!/bin/bash
set -ex
multi_line_msg="Multi\nline\n\ntext"
envman add --key SLACK_MESSAGE_FROM_SCRIPT --value "$multi_line_msg"
- path::./:
title: Should escape backslash+n as newline char
is_skippable: false
inputs:
- webhook_url: $SLACK_WEBHOOK_URL
- channel: $SLACK_CHANNEL
- from_username: step-dev-test
- message: $SLACK_MESSAGE_FROM_SCRIPT