-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
108 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,38 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
cd $(dirname $0)/../ | ||
|
||
if [[ ! -e "config.yaml" ]]; then | ||
cp config.yaml.example config.yaml | ||
fi | ||
|
||
go build . | ||
GITCOMMIT=$(git rev-parse HEAD || true) | ||
VERSION=$(git describe --tags 2>/dev/null || true) | ||
BUILD_FLAG="" | ||
if [[ "${GITCOMMIT}" != "UNKNOW" ]]; then | ||
BUILD_FLAG="${BUILD_FLAG} -X 'github.com/STARRY-S/telebot/pkg/utils.gitCommit=${GITCOMMIT}'" | ||
fi | ||
BUILD_FLAG="${BUILD_FLAG} -X 'github.com/STARRY-S/telebot/pkg/utils.version=${VERSION}'" | ||
|
||
CGO_ENABLED=0 go build -ldflags "${BUILD_FLAG}" . | ||
|
||
echo "--------------------------" | ||
ls -alh telebot | ||
echo "--------------------------" | ||
|
||
TAG="" | ||
if [[ ! -z "$VERSION" ]]; then | ||
TAG=":${VERSION}" | ||
fi | ||
|
||
docker build -t telebot . | ||
docker build \ | ||
--build-arg http_proxy=${http_proxy:-} \ | ||
--build-arg https_proxy=${https_proxy:-} \ | ||
--build-arg HTTP_PROXY=${HTTP_PROXY:-} \ | ||
--build-arg HTTPS_PROXY=${HTTPS_PROXY:-} \ | ||
--build-arg no_proxy=${no_proxy:-} \ | ||
--build-arg NO_PROXY=${NO_PROXY:-} \ | ||
--network=host \ | ||
-t hxstarrys/telebot${TAG} . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
docker kill telebot && docker rm telebot | ||
set -euo pipefail | ||
|
||
docker kill telebot || true | ||
docker rm telebot || true | ||
|
||
VERSION=$(git describe --tags 2>/dev/null || true) | ||
TAG="" | ||
if [[ ! -z "$VERSION" ]]; then | ||
TAG=":${VERSION}" | ||
fi | ||
|
||
docker image rm hxstarrys/telebot${TAG} | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
cd $(dirname $0)/../ | ||
|
||
docker run -d \ | ||
-e TELEGRAM_APITOKEN=$TELEGRAM_APITOKEN \ | ||
-e HTTPS_PROXY=$HTTPS_PROXY \ | ||
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ | ||
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \ | ||
-e TELEGRAM_APITOKEN=${TELEGRAM_APITOKEN:-} \ | ||
-e HTTP_PROXY=${HTTP_PROXY:-} \ | ||
-e http_proxy=${http_proxy:-} \ | ||
-e HTTPS_PROXY=${HTTPS_PROXY:-} \ | ||
-e https_proxy=${https_proxy:-} \ | ||
-e NO_PROXY=${NO_PROXY:-} \ | ||
-e no_proxy=${no_proxy:-} \ | ||
-v $(pwd)/config.yaml:/telebot/config.yaml \ | ||
--restart=unless-stopped \ | ||
--network=host \ | ||
--restart=always \ | ||
--name=telebot \ | ||
telebot | ||
hxstarrys/telebot |