Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into telegram-parse-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Delacour committed Nov 12, 2021
2 parents c3eaaab + 82900fe commit 7f4bc48
Show file tree
Hide file tree
Showing 1,112 changed files with 314,674 additions and 17,906 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ _testmain.go
gin-bin
bin
config.yaml
.idea
15 changes: 11 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
language: go

go:
- "1.10"
- 1.9
- tip
- "1.15"
- "1.16"
- tip

script: go test ./...
script:
- go test ./...

deploy:
- provider: script
script: bash build_push_image.sh
on:
tags: true
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
FROM golang:alpine
FROM golang:1.17 AS builder

RUN apk add --no-cache --virtual git openssl ca-certificates && \
go get github.com/messagebird/sachet/cmd/... && \
rm -rf src pkg && \
apk del git
WORKDIR /build

COPY examples/config.yaml /etc/sachet/config.yaml
COPY . .

RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -mod vendor -o sachet github.com/messagebird/sachet/cmd/sachet

FROM alpine

COPY --from=builder /build/sachet /usr/local/bin
COPY --chown=nobody examples/config.yaml /etc/sachet/config.yaml
RUN apk update && \
apk add --no-cache ca-certificates

USER nobody
EXPOSE 9876
ENTRYPOINT ["sachet"]
CMD ["-config", "/etc/sachet/config.yaml"]
133 changes: 0 additions & 133 deletions Gopkg.lock

This file was deleted.

17 changes: 17 additions & 0 deletions build_push_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e

if [[ ${TRAVIS_EVENT_TYPE} == "cron" ]]; then
exit 0
fi

IMAGE_NAME="messagebird/sachet"

docker build --build-arg TAG="${TRAVIS_TAG}" -t ${IMAGE_NAME}:latest .

docker tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:"${TRAVIS_TAG}"

echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin

docker push ${IMAGE_NAME}:"${TRAVIS_TAG}"
docker push ${IMAGE_NAME}:latest
51 changes: 38 additions & 13 deletions cmd/sachet/config.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
package main

import (
"github.com/messagebird/sachet/provider/esendex"
"io/ioutil"

"github.com/messagebird/sachet/provider/aliyun"
"github.com/messagebird/sachet/provider/aspsms"
"github.com/messagebird/sachet/provider/cm"
"github.com/messagebird/sachet/provider/exotel"
"github.com/messagebird/sachet/provider/freemobile"
"github.com/messagebird/sachet/provider/infobip"
"github.com/messagebird/sachet/provider/kannel"
"github.com/messagebird/sachet/provider/kavenegar"
"github.com/messagebird/sachet/provider/mailruim"
"github.com/messagebird/sachet/provider/mediaburst"
"github.com/messagebird/sachet/provider/messagebird"
"github.com/messagebird/sachet/provider/nexmo"
"github.com/messagebird/sachet/provider/nowsms"
"github.com/messagebird/sachet/provider/otc"
"github.com/messagebird/sachet/provider/ovh"
"github.com/messagebird/sachet/provider/pushbullet"
"github.com/messagebird/sachet/provider/sap"
"github.com/messagebird/sachet/provider/sipgate"
"github.com/messagebird/sachet/provider/sms77"
"github.com/messagebird/sachet/provider/smsc"
"github.com/messagebird/sachet/provider/telegram"
"github.com/messagebird/sachet/provider/tencentcloud"
"github.com/messagebird/sachet/provider/turbosms"
"github.com/messagebird/sachet/provider/twilio"

Expand All @@ -27,23 +39,36 @@ type ReceiverConf struct {
To []string
From string
Text string
Type string
}

var config struct {
Providers struct {
MessageBird messagebird.MessageBirdConfig
Nexmo nexmo.NexmoConfig
Twilio twilio.TwilioConfig
Infobip infobip.InfobipConfig
Exotel exotel.ExotelConfig
CM cm.CMConfig
Telegram telegram.TelegramConfig
Turbosms turbosms.TurbosmsConfig
OTC otc.OTCConfig
MediaBurst mediaburst.MediaBurstConfig
FreeMobile freemobile.Config
AspSms aspsms.Config
Sipgate sipgate.Config
MessageBird messagebird.MessageBirdConfig
Nexmo nexmo.NexmoConfig
Twilio twilio.TwilioConfig
Infobip infobip.InfobipConfig
Kannel kannel.KannelConfig
KaveNegar kavenegar.Config
Exotel exotel.ExotelConfig
CM cm.CMConfig
MailruIM mailruim.MailruIMConfig
Telegram telegram.TelegramConfig
Turbosms turbosms.TurbosmsConfig
Smsc smsc.SmscConfig
OTC otc.OTCConfig
MediaBurst mediaburst.MediaBurstConfig
FreeMobile freemobile.Config
AspSms aspsms.Config
Sipgate sipgate.Config
Pushbullet pushbullet.Config
NowSms nowsms.Config
Aliyun aliyun.Config
OVH ovh.Config
TencentCloud tencentcloud.Config
Sap sap.Config
Esendex esendex.Config
Sms77 sms77.Sms77Config
}

Receivers []ReceiverConf
Expand Down
Loading

0 comments on commit 7f4bc48

Please sign in to comment.