File tree Expand file tree Collapse file tree 7 files changed +48
-24
lines changed
Expand file tree Collapse file tree 7 files changed +48
-24
lines changed Original file line number Diff line number Diff line change 55set -e -u +x
66
77HUBOT_ADAPTER=' slack'
8- HUBOT_SLACK_TOKEN=${HUBOT_SLACK_TOKEN:- ' ' }
8+ HUBOT_SLACK_BOT_TOKEN=${HUBOT_SLACK_BOT_TOKEN:- ' ' }
9+ HUBOT_SLACK_APP_TOKEN=${HUBOT_SLACK_APP_TOKEN:- ' ' }
910VERSION=' '
1011RELEASE=' stable'
1112REPO_TYPE=' '
@@ -770,11 +771,14 @@ st2chatops_configure()
770771 sudo sed -i -r " s/^(export ST2_AUTH_USERNAME.).*/# &/" /opt/stackstorm/chatops/st2chatops.env
771772 sudo sed -i -r " s/^(export ST2_AUTH_PASSWORD.).*/# &/" /opt/stackstorm/chatops/st2chatops.env
772773
773- if [[ " $HUBOT_ADAPTER " = " slack" ]] && [[ ! -z " $HUBOT_SLACK_TOKEN " ]]; then
774+ if [[ " $HUBOT_ADAPTER " = " slack" ]] && [[ ! -z " $HUBOT_SLACK_BOT_TOKEN " ]] && [[ ! -z " $HUBOT_SLACK_APP_TOKEN " ]];
775+ then
774776 sudo sed -i -r " s/^# (export HUBOT_ADAPTER=slack)/\1/" /opt/stackstorm/chatops/st2chatops.env
775- sudo sed -i -r " s/^# (export HUBOT_SLACK_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
777+ sudo sed -i -r " s/^# (export HUBOT_SLACK_BOT_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
778+ sudo sed -i -r " s/^# (export HUBOT_SLACK_APP_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
776779 sudo sed -i -r " s/^(export HUBOT_ADAPTER.).*/\1$HUBOT_ADAPTER /" /opt/stackstorm/chatops/st2chatops.env
777- sudo sed -i -r " s/^(export HUBOT_SLACK_TOKEN.).*/\1$HUBOT_SLACK_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
780+ sudo sed -i -r " s/^(export HUBOT_SLACK_BOT_TOKEN.).*/\1$HUBOT_SLACK_BOT_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
781+ sudo sed -i -r " s/^(export HUBOT_SLACK_APP_TOKEN.).*/\1$HUBOT_SLACK_APP_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
778782
779783 sudo service st2chatops restart
780784 else
Original file line number Diff line number Diff line change 55set -e -u +x
66
77HUBOT_ADAPTER=' slack'
8- HUBOT_SLACK_TOKEN=${HUBOT_SLACK_TOKEN:- ' ' }
8+ HUBOT_SLACK_BOT_TOKEN=${HUBOT_SLACK_BOT_TOKEN:- ' ' }
9+ HUBOT_SLACK_APP_TOKEN=${HUBOT_SLACK_APP_TOKEN:- ' ' }
910VERSION=' '
1011RELEASE=' stable'
1112REPO_TYPE=' '
@@ -762,11 +763,14 @@ st2chatops_configure()
762763 sudo sed -i -r " s/^(export ST2_AUTH_USERNAME.).*/# &/" /opt/stackstorm/chatops/st2chatops.env
763764 sudo sed -i -r " s/^(export ST2_AUTH_PASSWORD.).*/# &/" /opt/stackstorm/chatops/st2chatops.env
764765
765- if [[ " $HUBOT_ADAPTER " = " slack" ]] && [[ ! -z " $HUBOT_SLACK_TOKEN " ]]; then
766+ if [[ " $HUBOT_ADAPTER " = " slack" ]] && [[ ! -z " $HUBOT_SLACK_BOT_TOKEN " ]] && [[ ! -z " $HUBOT_SLACK_APP_TOKEN " ]];
767+ then
766768 sudo sed -i -r " s/^# (export HUBOT_ADAPTER=slack)/\1/" /opt/stackstorm/chatops/st2chatops.env
767- sudo sed -i -r " s/^# (export HUBOT_SLACK_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
769+ sudo sed -i -r " s/^# (export HUBOT_SLACK_BOT_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
770+ sudo sed -i -r " s/^# (export HUBOT_SLACK_APP_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
768771 sudo sed -i -r " s/^(export HUBOT_ADAPTER.).*/\1$HUBOT_ADAPTER /" /opt/stackstorm/chatops/st2chatops.env
769- sudo sed -i -r " s/^(export HUBOT_SLACK_TOKEN.).*/\1$HUBOT_SLACK_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
772+ sudo sed -i -r " s/^(export HUBOT_SLACK_BOT_TOKEN.).*/\1$HUBOT_SLACK_BOT_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
773+ sudo sed -i -r " s/^(export HUBOT_SLACK_APP_TOKEN.).*/\1$HUBOT_SLACK_APP_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
770774
771775 sudo service st2chatops restart
772776 else
Original file line number Diff line number Diff line change 55set -e -u +x
66
77HUBOT_ADAPTER=' slack'
8- HUBOT_SLACK_TOKEN=${HUBOT_SLACK_TOKEN:- ' ' }
8+ HUBOT_SLACK_BOT_TOKEN=${HUBOT_SLACK_BOT_TOKEN:- ' ' }
9+ HUBOT_SLACK_APP_TOKEN=${HUBOT_SLACK_APP_TOKEN:- ' ' }
910VERSION=' '
1011RELEASE=' stable'
1112REPO_TYPE=' '
@@ -762,11 +763,14 @@ st2chatops_configure()
762763 sudo sed -i -r " s/^(export ST2_AUTH_USERNAME.).*/# &/" /opt/stackstorm/chatops/st2chatops.env
763764 sudo sed -i -r " s/^(export ST2_AUTH_PASSWORD.).*/# &/" /opt/stackstorm/chatops/st2chatops.env
764765
765- if [[ " $HUBOT_ADAPTER " = " slack" ]] && [[ ! -z " $HUBOT_SLACK_TOKEN " ]]; then
766+ if [[ " $HUBOT_ADAPTER " = " slack" ]] && [[ ! -z " $HUBOT_SLACK_BOT_TOKEN " ]] && [[ ! -z " $HUBOT_SLACK_APP_TOKEN " ]];
767+ then
766768 sudo sed -i -r " s/^# (export HUBOT_ADAPTER=slack)/\1/" /opt/stackstorm/chatops/st2chatops.env
767- sudo sed -i -r " s/^# (export HUBOT_SLACK_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
769+ sudo sed -i -r " s/^# (export HUBOT_SLACK_BOT_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
770+ sudo sed -i -r " s/^# (export HUBOT_SLACK_APP_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
768771 sudo sed -i -r " s/^(export HUBOT_ADAPTER.).*/\1$HUBOT_ADAPTER /" /opt/stackstorm/chatops/st2chatops.env
769- sudo sed -i -r " s/^(export HUBOT_SLACK_TOKEN.).*/\1$HUBOT_SLACK_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
772+ sudo sed -i -r " s/^(export HUBOT_SLACK_BOT_TOKEN.).*/\1$HUBOT_SLACK_BOT_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
773+ sudo sed -i -r " s/^(export HUBOT_SLACK_APP_TOKEN.).*/\1$HUBOT_SLACK_APP_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
770774
771775 sudo service st2chatops restart
772776 else
Original file line number Diff line number Diff line change 55set -e -u +x
66
77HUBOT_ADAPTER=' slack'
8- HUBOT_SLACK_TOKEN=${HUBOT_SLACK_TOKEN:- ' ' }
8+ HUBOT_SLACK_BOT_TOKEN=${HUBOT_SLACK_BOT_TOKEN:- ' ' }
9+ HUBOT_SLACK_APP_TOKEN=${HUBOT_SLACK_APP_TOKEN:- ' ' }
910VERSION=' '
1011RELEASE=' stable'
1112REPO_TYPE=' '
@@ -770,11 +771,14 @@ st2chatops_configure()
770771 sudo sed -i -r " s/^(export ST2_AUTH_USERNAME.).*/# &/" /opt/stackstorm/chatops/st2chatops.env
771772 sudo sed -i -r " s/^(export ST2_AUTH_PASSWORD.).*/# &/" /opt/stackstorm/chatops/st2chatops.env
772773
773- if [[ " $HUBOT_ADAPTER " = " slack" ]] && [[ ! -z " $HUBOT_SLACK_TOKEN " ]]; then
774+ if [[ " $HUBOT_ADAPTER " = " slack" ]] && [[ ! -z " $HUBOT_SLACK_BOT_TOKEN " ]] && [[ ! -z " $HUBOT_SLACK_APP_TOKEN " ]];
775+ then
774776 sudo sed -i -r " s/^# (export HUBOT_ADAPTER=slack)/\1/" /opt/stackstorm/chatops/st2chatops.env
775- sudo sed -i -r " s/^# (export HUBOT_SLACK_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
777+ sudo sed -i -r " s/^# (export HUBOT_SLACK_BOT_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
778+ sudo sed -i -r " s/^# (export HUBOT_SLACK_APP_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
776779 sudo sed -i -r " s/^(export HUBOT_ADAPTER.).*/\1$HUBOT_ADAPTER /" /opt/stackstorm/chatops/st2chatops.env
777- sudo sed -i -r " s/^(export HUBOT_SLACK_TOKEN.).*/\1$HUBOT_SLACK_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
780+ sudo sed -i -r " s/^(export HUBOT_SLACK_BOT_TOKEN.).*/\1$HUBOT_SLACK_BOT_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
781+ sudo sed -i -r " s/^(export HUBOT_SLACK_APP_TOKEN.).*/\1$HUBOT_SLACK_APP_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
778782
779783 sudo service st2chatops restart
780784 else
Original file line number Diff line number Diff line change 55set -e -u +x
66
77HUBOT_ADAPTER=' slack'
8- HUBOT_SLACK_TOKEN=${HUBOT_SLACK_TOKEN:- ' ' }
8+ HUBOT_SLACK_BOT_TOKEN=${HUBOT_SLACK_BOT_TOKEN:- ' ' }
9+ HUBOT_SLACK_APP_TOKEN=${HUBOT_SLACK_APP_TOKEN:- ' ' }
910VERSION=' '
1011RELEASE=' stable'
1112REPO_TYPE=' '
@@ -770,11 +771,14 @@ st2chatops_configure()
770771 sudo sed -i -r " s/^(export ST2_AUTH_USERNAME.).*/# &/" /opt/stackstorm/chatops/st2chatops.env
771772 sudo sed -i -r " s/^(export ST2_AUTH_PASSWORD.).*/# &/" /opt/stackstorm/chatops/st2chatops.env
772773
773- if [[ " $HUBOT_ADAPTER " = " slack" ]] && [[ ! -z " $HUBOT_SLACK_TOKEN " ]]; then
774+ if [[ " $HUBOT_ADAPTER " = " slack" ]] && [[ ! -z " $HUBOT_SLACK_BOT_TOKEN " ]] && [[ ! -z " $HUBOT_SLACK_APP_TOKEN " ]];
775+ then
774776 sudo sed -i -r " s/^# (export HUBOT_ADAPTER=slack)/\1/" /opt/stackstorm/chatops/st2chatops.env
775- sudo sed -i -r " s/^# (export HUBOT_SLACK_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
777+ sudo sed -i -r " s/^# (export HUBOT_SLACK_BOT_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
778+ sudo sed -i -r " s/^# (export HUBOT_SLACK_APP_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
776779 sudo sed -i -r " s/^(export HUBOT_ADAPTER.).*/\1$HUBOT_ADAPTER /" /opt/stackstorm/chatops/st2chatops.env
777- sudo sed -i -r " s/^(export HUBOT_SLACK_TOKEN.).*/\1$HUBOT_SLACK_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
780+ sudo sed -i -r " s/^(export HUBOT_SLACK_BOT_TOKEN.).*/\1$HUBOT_SLACK_BOT_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
781+ sudo sed -i -r " s/^(export HUBOT_SLACK_APP_TOKEN.).*/\1$HUBOT_SLACK_APP_TOKEN /" /opt/stackstorm/chatops/st2chatops.env
778782
779783 sudo service st2chatops restart
780784 else
Original file line number Diff line number Diff line change @@ -37,11 +37,14 @@ st2chatops_configure()
3737 sudo sed -i -r "s/^(export ST2_AUTH_PASSWORD.).*/# & /" /opt/stackstorm/chatops/st2chatops.env
3838
3939 # Setup adapter
40- if [[ "$HUBOT_ADAPTER"="slack" ]] && [[ ! -z "$HUBOT_SLACK_TOKEN" ]]; then
40+ if [[ "$HUBOT_ADAPTER"="slack" ]] && [[ ! -z "$HUBOT_SLACK_BOT_TOKEN" ]] && [[ ! -z "$HUBOT_SLACK_APP_TOKEN" ]];
41+ then
4142 sudo sed -i -r "s/^# (export HUBOT_ADAPTER=slack)/\1/" /opt/stackstorm/chatops/st2chatops.env
42- sudo sed -i -r "s/^# (export HUBOT_SLACK_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
43+ sudo sed -i -r "s/^# (export HUBOT_SLACK_BOT_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
44+ sudo sed -i -r "s/^# (export HUBOT_SLACK_APP_TOKEN.).*/\1/" /opt/stackstorm/chatops/st2chatops.env
4345 sudo sed -i -r "s/^(export HUBOT_ADAPTER.).*/\1$HUBOT_ADAPTER/" /opt/stackstorm/chatops/st2chatops.env
44- sudo sed -i -r "s/^(export HUBOT_SLACK_TOKEN.).*/\1$HUBOT_SLACK_TOKEN/" /opt/stackstorm/chatops/st2chatops.env
46+ sudo sed -i -r "s/^(export HUBOT_SLACK_BOT_TOKEN.).*/\1$HUBOT_SLACK_BOT_TOKEN/" /opt/stackstorm/chatops/st2chatops.env
47+ sudo sed -i -r "s/^(export HUBOT_SLACK_APP_TOKEN.).*/\1$HUBOT_SLACK_APP_TOKEN/" /opt/stackstorm/chatops/st2chatops.env
4548
4649 sudo service st2chatops restart
4750 else
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ set -e -u +x
88
99# ============================ Global variables ============================
1010HUBOT_ADAPTER=' slack'
11- HUBOT_SLACK_TOKEN=${HUBOT_SLACK_TOKEN:- ' ' }
11+ HUBOT_SLACK_BOT_TOKEN=${HUBOT_SLACK_BOT_TOKEN:- ' ' }
12+ HUBOT_SLACK_APP_TOKEN=${HUBOT_SLACK_APP_TOKEN:- ' ' }
1213VERSION=' '
1314RELEASE=' stable'
1415REPO_TYPE=' '
You can’t perform that action at this time.
0 commit comments