- updated bash scripts
- renamed env schema
- updated binary archive from tar.gz to tar.xz
- update workflows
This commit is contained in:
Medzik 2021-09-01 12:49:56 +00:00
parent 324863f072
commit 021fc6ea62
9 changed files with 36 additions and 24 deletions

View File

@ -71,4 +71,5 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
path: dist
path: dist/*.tar.gz
retention-days: 10

View File

@ -11,11 +11,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: GolangCi Lint
uses: golangci/golangci-lint-action@v2
with:

5
.gitignore vendored
View File

@ -1,5 +1,8 @@
# Dot Files
.env
*.env*
!schema.env
# Cache
.cache
# Binaries

View File

@ -18,10 +18,10 @@ builds:
- -X gitlab.com/gaming0skar123/go/pingbot/config.Build={{.Date}}
archives:
- format: tar.gz
- format: tar.xz
files:
- .env.schema
- schema.env
- config.schema.toml
- README.md
- LICENSE

View File

@ -9,7 +9,7 @@ This application "pings" websites every few minutes (to be set in config). It ca
* 💻 Linux amd64
* [Download](https://github.com/MedzikUser/go-pingbot/releases) latest version
* Unpack file `tar xzf pingbot_*_linux_amd64.tar.gz`
* Unpack file `tar xf pingbot_*_linux_amd64.tar.xz`
* Done your binary is `pingbot.out`
## 👨‍💻 Compile from Source Code
@ -29,7 +29,7 @@ This application "pings" websites every few minutes (to be set in config). It ca
## ⚙️ Configurate
* Complete .env according to .env.schema
* Complete .env according to schema.env
* And fill in config.toml according to config.schema.toml
## 🔧 Run

3
go.sum
View File

@ -167,11 +167,9 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
@ -236,7 +234,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.2.2-0.20190308074557-af07aa5181b3 h1:GqpA1/5oN1NgsxoSA4RH0YWTaqvUlQNeOpHXD/JRbOQ=
github.com/posener/complete v1.2.2-0.20190308074557-af07aa5181b3/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E=
github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo=
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=

View File

@ -1,17 +1,19 @@
#!/usr/bin/env bash
# Colors
RED="\e[0;91m"
NC="\e[0m" # No Color
green="\e[0;92m"
red="\e[0;91m"
nc="\e[0m" # No Color
printf "${nc}[${green}Start${nc}]\n"
if ! go build -o pingbot.out; then
echo -e "${reset}[${RED}COMPILE ERROR${NC}]"
printf "${nc}[${red}COMPILE ERROR${nc}]\n"
exit 1
else
if ! ./pingbot.out; then
echo -e "${reset}[${RED}PROGRAM PANIC${NC}]"
exit 1
else
echo -e "${reset}[${RED}PROGRAM END${NC}]"
fi
if ! ./pingbot.out; then
printf "${nc}[${red}PROGRAM PANIC${nc}]\n"
exit 1
else
printf "${nc}[${red}PROGRAM END${nc}]\n"
fi
fi

16
start.sh Normal file → Executable file
View File

@ -1,8 +1,22 @@
#!/usr/bin/env bash
clear
# Colors
green="\e[0;92m"
red="\e[0;91m"
nc="\e[0m" # No Color
printf "${nc}[${green}Start${nc}]\n"
# Add permission and start
chmod +x pingbot.out
./pingbot.out
# Loop start e.g. on update restart
printf "${nc}[${red}END${nc}]\n"
# Wait 5 seconds
sleep 5
# Loop start e.g. on update => restart
bash start.sh