diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cc81f3..8f79a66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,4 +71,5 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@v2 with: - path: dist + path: dist/*.tar.gz + retention-days: 10 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 04ae90a..0930046 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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: diff --git a/.gitignore b/.gitignore index 3bdcf88..63c0268 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ # Dot Files -.env +*.env* +!schema.env + +# Cache .cache # Binaries diff --git a/.goreleaser.yml b/.goreleaser.yml index eafba71..a5b68e8 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 diff --git a/README.md b/README.md index 43478c3..2fe3a1c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/go.sum b/go.sum index 3e0be03..04fca4a 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/nodemon.sh b/nodemon.sh index c64ce2b..480841d 100755 --- a/nodemon.sh +++ b/nodemon.sh @@ -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 diff --git a/.env.schema b/schema.env similarity index 100% rename from .env.schema rename to schema.env diff --git a/start.sh b/start.sh old mode 100644 new mode 100755 index c300951..f11a026 --- a/start.sh +++ b/start.sh @@ -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