From 9ea8cecb23eae9195245b916db75a9fbae2f04b7 Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sat, 21 Aug 2021 23:33:17 +0200 Subject: [PATCH 01/90] merge dockerfiles and remove :base tag --- Dockerfile | 53 +++++++++++++++++++++++++++++++++++++++++++++---- Dockerfile.base | 45 ----------------------------------------- Makefile | 29 ++++----------------------- 3 files changed, 53 insertions(+), 74 deletions(-) delete mode 100644 Dockerfile.base diff --git a/Dockerfile b/Dockerfile index 05c090ed..fd54c686 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,57 @@ -FROM adamboutcher/statping-ng:base AS base +FROM node:12.18.2-alpine AS frontend +LABEL maintainer="Statping-ng (https://github.com/statping-ng)" +ARG BUILDPLATFORM +WORKDIR /statping +COPY ./frontend/package.json . +COPY ./frontend/yarn.lock . +RUN yarn install --pure-lockfile --network-timeout 1000000 +COPY ./frontend . +RUN yarn build && yarn cache clean + +# Statping Golang BACKEND building from source +# Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying +FROM golang:1.14-alpine AS backend +LABEL maintainer="Statping-NG (https://github.com/statping-ng)" +ARG VERSION +ARG COMMIT +ARG BUILDPLATFORM +ARG TARGETARCH +RUN apk add --update --no-cache libstdc++ gcc g++ make git autoconf \ + libtool ca-certificates linux-headers wget curl jq && \ + update-ca-certificates + +WORKDIR /root +RUN git clone https://github.com/sass/sassc.git +RUN . sassc/script/bootstrap && make -C sassc -j4 +# sassc binary: /root/sassc/bin/sassc + +WORKDIR /go/src/github.com/statping-ng/statping-ng +ADD go.mod go.sum ./ +RUN go mod download +ENV GO111MODULE on +ENV CGO_ENABLED 1 +RUN go get github.com/stretchr/testify/assert && \ + go get github.com/stretchr/testify/require && \ + go get github.com/GeertJohan/go.rice/rice && \ + go get github.com/cortesi/modd/cmd/modd && \ + go get github.com/crazy-max/xgo +COPY . . +COPY --from=frontend /statping/dist/ ./source/dist/ +RUN make clean generate embed +RUN go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd +RUN chmod a+x statping && mv statping /go/bin/statping +# /go/bin/statping - statping binary +# /root/sassc/bin/sassc - sass binary +# /statping - Vue frontend (from frontend) + ARG BUILDPLATFORM # Statping main Docker image that contains all required libraries FROM alpine:latest RUN apk --no-cache add libgcc libstdc++ ca-certificates curl jq && update-ca-certificates -COPY --from=base /go/bin/statping /usr/local/bin/ -COPY --from=base /root/sassc/bin/sassc /usr/local/bin/ -COPY --from=base /usr/local/share/ca-certificates /usr/local/share/ +COPY --from=backend /go/bin/statping /usr/local/bin/ +COPY --from=backend /root/sassc/bin/sassc /usr/local/bin/ +COPY --from=backend /usr/local/share/ca-certificates /usr/local/share/ WORKDIR /app VOLUME /app diff --git a/Dockerfile.base b/Dockerfile.base deleted file mode 100644 index e451d2f1..00000000 --- a/Dockerfile.base +++ /dev/null @@ -1,45 +0,0 @@ -FROM node:12.18.2-alpine AS frontend -LABEL maintainer="Statping-ng (https://github.com/statping-ng)" -ARG BUILDPLATFORM -WORKDIR /statping -COPY ./frontend/package.json . -COPY ./frontend/yarn.lock . -RUN yarn install --pure-lockfile --network-timeout 1000000 -COPY ./frontend . -RUN yarn build && yarn cache clean - -# Statping Golang BACKEND building from source -# Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying -FROM golang:1.14-alpine AS backend -LABEL maintainer="Statping-NG (https://github.com/statping-ng)" -ARG VERSION -ARG COMMIT -ARG BUILDPLATFORM -ARG TARGETARCH -RUN apk add --update --no-cache libstdc++ gcc g++ make git autoconf \ - libtool ca-certificates linux-headers wget curl jq && \ - update-ca-certificates - -WORKDIR /root -RUN git clone https://github.com/sass/sassc.git -RUN . sassc/script/bootstrap && make -C sassc -j4 -# sassc binary: /root/sassc/bin/sassc - -WORKDIR /go/src/github.com/statping-ng/statping-ng -ADD go.mod go.sum ./ -RUN go mod download -ENV GO111MODULE on -ENV CGO_ENABLED 1 -RUN go get github.com/stretchr/testify/assert && \ - go get github.com/stretchr/testify/require && \ - go get github.com/GeertJohan/go.rice/rice && \ - go get github.com/cortesi/modd/cmd/modd && \ - go get github.com/crazy-max/xgo -COPY . . -COPY --from=frontend /statping/dist/ ./source/dist/ -RUN make clean generate embed -RUN go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd -RUN chmod a+x statping && mv statping /go/bin/statping -# /go/bin/statping - statping binary -# /root/sassc/bin/sassc - sass binary -# /statping - Vue frontend (from frontend) diff --git a/Makefile b/Makefile index c701900f..036c1c9a 100644 --- a/Makefile +++ b/Makefile @@ -111,28 +111,15 @@ db-down: console: docker exec -t -i statping /bin/sh -compose-build-full: docker-base +compose-build-full: docker-compose -f docker-compose.yml -f dev/docker-compose.full.yml build --parallel --build-arg VERSION=${VERSION} -docker-base: - docker build -t statping-ng/statping-ng:base -f Dockerfile.base --build-arg VERSION=${VERSION} . - -docker-latest: docker-base +docker-latest: docker build -t statping-ng/statping-ng:latest --build-arg VERSION=${VERSION} . -docker-vue: - docker build -t statping-ng/statping-ng:vue --build-arg VERSION=${VERSION} . - docker-test: docker-compose -f docker-compose.test.yml up --remove-orphans -push-base: clean compile docker-base - docker push statping-ng/statping-ng:base - -push-vue: clean compile docker-base docker-vue - docker push statping-ng/statping-ng:base - docker push statping-ng/statping-ng:vue - modd: modd -f ./dev/modd.conf @@ -287,14 +274,12 @@ download-key: # push the :dev docker tag using curl dockerhub-dev: - docker build --build-arg VERSION=${VERSION} -t statping-ng/statping-ng:dev --no-cache -f Dockerfile.base . + docker build --build-arg VERSION=${VERSION} -t statping-ng/statping-ng:dev --no-cache -f Dockerfile . docker push statping-ng/statping-ng:dev dockerhub: - docker build --build-arg VERSION=${VERSION} -t statping-ng/statping-ng:base --no-cache -f Dockerfile.base . docker build --build-arg VERSION=${VERSION} -t statping-ng/statping-ng:latest --no-cache -f Dockerfile . docker tag statping-ng/statping-ng statping-ng/statping-ng:v${VERSION} - docker push statping-ng/statping-ng:base docker push statping-ng/statping-ng:v${VERSION} docker push statping-ng/statping-ng @@ -392,12 +377,6 @@ buildx-dev: multiarch docker buildx build --builder statping-dev --cache-from "type=local,src=/tmp/.buildx-cache" --cache-to "type=local,dest=/tmp/.buildx-cache,mode=max" --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -f Dockerfile -t adamboutcher/statping-ng:dev --build-arg=VERSION=${VERSION} --build-arg=COMMIT=${COMMIT} . docker buildx rm statping-dev -buildx-base: multiarch - docker buildx create --name statping-base --driver-opt image=moby/buildkit:master - docker buildx inspect --builder statping-base --bootstrap - docker buildx build --builder statping-base --cache-from "type=local,src=/tmp/.buildx-cache" --cache-to "type=local,dest=/tmp/.buildx-cache,mode=max" --push --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -f Dockerfile.base -t adamboutcher/statping-ng:base --build-arg=VERSION=${VERSION} --build-arg=COMMIT=${COMMIT} . - docker buildx rm statping-base - multiarch: mkdir /tmp/.buildx-cache || true docker run --rm --privileged multiarch/qemu-user-static --reset -p yes @@ -426,5 +405,5 @@ gen_help: marked -o html/$file.html $file --gfm done -.PHONY: all check build certs multiarch install-darwin go-build build-all buildx-base buildx-dev buildx-latest build-alpine test-all test test-api docker frontend up down print_details lite sentry-release snapcraft build-linux build-mac build-win build-all postman +.PHONY: all check build certs multiarch install-darwin go-build build-all buildx-dev buildx-latest build-alpine test-all test test-api docker frontend up down print_details lite sentry-release snapcraft build-linux build-mac build-win build-all postman .SILENT: travis_s3_creds From d3d1b7cb6af97e259bf4c09e22ecb714b9d2ec88 Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sun, 22 Aug 2021 00:14:10 +0200 Subject: [PATCH 02/90] first attempt of merging build workflows they are really similar and there's no need to maintain 3.5 versions of the same file --- .github/workflows/build.yml | 577 ++++++++++++++++++++++++++++++++++++ 1 file changed, 577 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..004d1b08 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,577 @@ +name: Statping build +on: + push: + paths-ignore: + - "**.md" + pull_request: + paths-ignore: + - "**.md" + +jobs: + frontend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.15.x + - uses: actions/setup-node@v1 + with: + node-version: 12.18.2 + + - name: Set Version + run: | + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV + shell: bash + + - name: Install Global Dependencies + run: npm install -g yarn sass cross-env mjml + + - name: Download Frontend Dependencies + working-directory: ./frontend + run: yarn + + - name: Download Go mods + run: | + go mod download + go mod verify + make test-deps + + - name: Build Frontend Statping + env: + VERSION: ${{ env.VERSION }} + COMMIT: ${{ github.sha }} + MJML_APP: ${{ secrets.MJML_APP }} + MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: make clean generate compile + + - name: Upload Compiled Frontend (rice-box.go) + uses: actions/upload-artifact@v1 + with: + name: static-rice-box + path: ./source + + - name: Configure AWS credentials for Asset uploads + # temporarily disabled + if: "false" + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + + - name: Upload Static Assets to S3 + # temporarily disabled + if: "false" + run: | + tar -czvf source.tar.gz source/ + aws s3 cp source.tar.gz s3://assets.statping.com/commit/${{ github.sha }}/ + rm -rf source.tar.gz + + build: + needs: [frontend, test-postman-sqlite, test-postman-mysql, test-postman-postgres] + runs-on: ubuntu-latest + strategy: + matrix: + platform: [linux] + arch: [386, amd64, arm-7, arm-6, arm64] + include: + - platform: darwin + arch: amd64 + - platform: windows + arch: amd64 + + steps: + - uses: actions/checkout@v2 + + - name: Download Compiled Frontend (rice-box.go) + uses: actions/download-artifact@v1 + with: + name: static-rice-box + path: ./source + + - name: Configure AWS credentials for Asset uploads + # temporarily disabled + if: "false" + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + + - name: Add GOBIN to PATH + run: | + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV + shell: bash + + - name: Set Linux Build Flags + if: matrix.platform == 'linux' + run: | + echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV + echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV + shell: bash + + - name: Set Darwin Build Flags + if: matrix.platform == 'darwin' + run: | + echo "XGO_TAGS=netgo osusergo darwin sqlite_omit_load_extension" >> $GITHUB_ENV + shell: bash + + - name: Set Windows Build Flags + if: matrix.platform == 'windows' && + run: | + echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV + echo "XGO_TAGS=netgo osusergo sqlite_omit_load_extension" >> $GITHUB_ENV + shell: bash + + - name: Build ${{ matrix.platform }}/${{ matrix.arch }} + uses: crazy-max/ghaction-xgo@v1 + env: + VERSION: ${{ env.VERSION }} + COMMIT: ${{ github.sha }} + with: + xgo_version: latest + go_version: 1.15.x + dest: build + prefix: statping + targets: ${{ matrix.platform }}/${{ matrix.arch }} + # TODO v and x were true for dev workflow but false for stable/unstable. what do they do? + v: false + x: false + pkg: cmd + buildmode: pie + tags: ${{ env.XGO_TAGS }} + ldflags: -s -w -X main.VERSION=${{ env.VERSION }} -X main.COMMIT=${{ env.COMMIT }} ${{ env.BUILD_FLAGS }} + + - name: Compress Linux Builds + if: matrix.platform == 'linux' + run: | + cd build + mv statping-linux-${{ matrix.arch }} statping + chmod +x statping + tar -czvf statping-linux-${{ matrix.arch }}.tar.gz statping + rm -rf statping + echo "compressed=statping-linux-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV + + - name: Compress Windows Builds + if: matrix.platform == 'windows' && + run: | + cd build + mv statping-windows-4.0-${{ matrix.arch }}.exe statping.exe + chmod +x statping.exe + zip statping-windows-${{ matrix.arch }}.zip statping.exe + rm -rf statping.exe + echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV + + - name: Compress Darwin Builds + if: matrix.platform == 'darwin' + run: | + cd build + mv statping-darwin-10.6-${{ matrix.arch }} statping + chmod +x statping + tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping + rm -rf statping + echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV + + - name: Upload Compiled Statping Binary + uses: actions/upload-artifact@v1 + with: + name: statping-${{ matrix.platform }}-${{ matrix.arch }} + path: ./build + + - name: Upload Releases + id: upload-assets + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ env.VERSION }} + with: + # TODO add "dev-" prefix for unstable + # TODO only do this for stable/unstable pushes + tag_name: v${{ env.VERSION }} + draft: true + prerelease: true + files: build/${{ env.compressed }} + + - name: Upload Compiled Binaries to S3 + # temporarily disabled + if: "false" + run: | + aws s3 cp build/${{ env.compressed }} s3://assets.statping.com/commit/${{ github.sha }}/ + + test: + needs: frontend + runs-on: ubuntu-latest + services: + postgres: + image: postgres:10.8 + env: + POSTGRES_USER: root + POSTGRES_PASSWORD: password123 + POSTGRES_DB: statping + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: password123 + MYSQL_DATABASE: statping + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.15.x + - uses: actions/setup-node@v1 + with: + node-version: 12.18.2 + + - name: Install Global Dependencies + run: npm install -g yarn sass newman cross-env wait-on @sentry/cli + + - name: Setting ENV's + run: | + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV + shell: bash + + - name: Download Compiled Frontend (rice-box.go) + uses: actions/download-artifact@v1 + with: + name: static-rice-box + path: ./source + + - name: Install Statping + env: + VERSION: ${{ env.VERSION }} + COMMIT: ${{ github.sha }} + run: | + make build certs + chmod +x statping + mv statping $(go env GOPATH)/bin/ + + - name: Go Tests + run: | + go get gotest.tools/gotestsum + gotestsum --no-summary=skipped --format testname -- -covermode=count -coverprofile=coverage.out -p=1 ./... + env: + VERSION: ${{ env.VERSION }} + COMMIT: ${{ github.sha }} + DB_CONN: sqlite3 + STATPING_DIR: ${{ github.workspace }} + API_SECRET: demopassword123 + DISABLE_LOGS: false + ALLOW_REPORTS: true + SAMPLE_DATA: true + COVERALLS: ${{ secrets.COVERALLS }} + DISCORD_URL: ${{ secrets.DISCORD_URL }} + EMAIL_HOST: ${{ secrets.EMAIL_HOST }} + EMAIL_USER: ${{ secrets.EMAIL_USER }} + EMAIL_PASS: ${{ secrets.EMAIL_PASS }} + EMAIL_OUTGOING: ${{ secrets.EMAIL_OUTGOING }} + EMAIL_SEND_TO: ${{ secrets.EMAIL_SEND_TO }} + EMAIL_PORT: ${{ secrets.EMAIL_PORT }} + MOBILE_ID: ${{ secrets.MOBILE_ID }} + MOBILE_NUMBER: ${{ secrets.MOBILE_NUMBER }} + PUSHOVER_TOKEN: ${{ secrets.PUSHOVER_TOKEN }} + PUSHOVER_API: ${{ secrets.PUSHOVER_API }} + SLACK_URL: ${{ secrets.SLACK_URL }} + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + TELEGRAM_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL }} + TWILIO_SID: ${{ secrets.TWILIO_SID }} + TWILIO_SECRET: ${{ secrets.TWILIO_SECRET }} + TWILIO_FROM: ${{ secrets.TWILIO_FROM }} + TWILIO_TO: ${{ secrets.TWILIO_TO }} + TEST_EMAIL: ${{ secrets.TEST_EMAIL }} + GOTIFY_URL: ${{ secrets.GOTIFY_URL }} + GOTIFY_TOKEN: ${{ secrets.GOTIFY_TOKEN }} + SNS_TOKEN: ${{ secrets.SNS_TOKEN }} + SNS_SECRET: ${{ secrets.SNS_SECRET }} + SNS_REGION: ${{ secrets.SNS_REGION }} + SNS_TOPIC: ${{ secrets.SNS_TOPIC }} + + - name: Coveralls Testing Coverage + run: | + go get github.com/mattn/goveralls + goveralls -coverprofile=coverage.out -repotoken $COVERALLS + env: + COVERALLS: ${{ secrets.COVERALLS }} + + test-postman-sqlite: + needs: frontend + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.15.x + + - name: Setting ENV's + run: | + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV + shell: bash + + - name: Download Compiled Frontend (rice-box.go) + uses: actions/download-artifact@v1 + with: + name: static-rice-box + path: ./source + + - name: Install Statping + env: + VERSION: ${{ env.VERSION }} + COMMIT: ${{ github.sha }} + run: | + make build + chmod +x statping + mv statping $(go env GOPATH)/bin/ + - name: Run Statping + run: | + API_SECRET=demosecret123 statping --port=8585 > /dev/null & + sleep 5 + - name: Postman SQLite Tests + uses: matt-ball/newman-action@master + with: + apiKey: ${{ secrets.POSTMAN_API }} + collection: ./dev/postman.json + environment: ./dev/postman_env_sqlite.json + timeoutRequest: 30000 + delayRequest: 600 + + test-postman-mysql: + needs: frontend + runs-on: ubuntu-latest + + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: password123 + MYSQL_DATABASE: statping + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.15.x + + - name: Setting ENV's + run: | + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV + shell: bash + + - name: Download Compiled Frontend (rice-box.go) + uses: actions/download-artifact@v1 + with: + name: static-rice-box + path: ./source + + - name: Install Statping + env: + VERSION: ${{ env.VERSION }} + COMMIT: ${{ github.sha }} + MJML_APP: ${{ secrets.MJML_APP }} + MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} + run: | + make build + chmod +x statping + mv statping $(go env GOPATH)/bin/ + - name: Run Statping + run: | + API_SECRET=demosecret123 statping --port=8585 > /dev/null & + sleep 5 + - name: Postman MySQL Tests + uses: matt-ball/newman-action@master + with: + apiKey: ${{ secrets.POSTMAN_API }} + collection: ./dev/postman.json + environment: ./dev/postman_env_mysql.json + timeoutRequest: 30000 + delayRequest: 600 + + test-postman-postgres: + needs: frontend + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:10.8 + env: + POSTGRES_USER: root + POSTGRES_PASSWORD: password123 + POSTGRES_DB: statping + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.15.x + + - name: Setting ENV's + run: | + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV + shell: bash + + - name: Download Compiled Frontend (rice-box.go) + uses: actions/download-artifact@v1 + with: + name: static-rice-box + path: ./source + + - name: Install Statping + env: + VERSION: ${{ env.VERSION }} + COMMIT: ${{ github.sha }} + run: | + make build + chmod +x statping + mv statping $(go env GOPATH)/bin/ + - name: Run Statping + run: | + API_SECRET=demosecret123 statping --port=8585 > /dev/null & + sleep 5 + - name: Postman Postgres Tests + uses: matt-ball/newman-action@master + with: + apiKey: ${{ secrets.POSTMAN_API }} + collection: ./dev/postman.json + environment: ./dev/postman_env_postgres.json + timeoutRequest: 30000 + delayRequest: 600 + +# TODO everything from here on is stable/unstable release only + +# TODO i got lazy here + + docker-release: + needs: [build, test-postman-sqlite, test-postman-mysql, test-postman-postgres] + runs-on: [self-hosted, linux, aboutcher-hosted, rocky8] + + steps: + - name: Checkout Statping Repo + uses: actions/checkout@v2 + + - name: Setting ENV's + run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV + shell: bash + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + id: buildx + with: + install: true + + # TODO the cache keys for stable/unstable were different here, but that doesn't really matter + # TODO use docker metadata action instead of this (don't refer to makefile for docker commands at all) + # TODO consider creating builds for dev (not really needed?), if so: not multiarch + - name: Cache Docker layers + uses: actions/cache@v2 + id: buildx-docker-master + with: + path: /tmp/.buildx-cache + key: buildx-docker-master + restore-keys: | + buildx-docker-master + + - name: Docker Login + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin + + - name: Docker Build :base + run: make buildx-base + + - name: Docker Login + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin + + # TODO this should be :latest in stable + # TODO do we even want a "static" :dev tag? + - name: Docker Build :dev + run: make buildx-dev + +# sentry-release: +# needs: docker-release +# runs-on: ubuntu-latest +# steps: +# - name: Checkout Statping Repo +# uses: actions/checkout@v2 +# +# - name: Setup Sentry CLI +# uses: mathrix-education/setup-sentry-cli@master +# with: +# version: latest +# url: ${{ secrets.SENTRY_URL }} +# token: ${{ secrets.SENTRY_AUTH_TOKEN }} +# organization: statping +# +# - name: Setting ENV's +# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV +# shell: bash +# +# - name: Sentry Release +# run: make sentry-release + +# everything from here is stable only + +# homebrew-release: +# needs: docker-release +# runs-on: ubuntu-latest +# steps: +# - name: Checkout Statping Repo +# uses: actions/checkout@v2 +# +# - name: Setting ENV's +# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV +# shell: bash +# +# - name: Update Homebrew Package +# env: +# VERSION: ${{ env.VERSION }} +# TRAVIS_API: ${{ secrets.TRAVIS_API }} +# run: make publish-homebrew +# +# slack-update: +# needs: docker-release +# runs-on: ubuntu-latest +# steps: +# - name: Checkout Statping Repo +# uses: actions/checkout@v2 +# +# - name: Setting ENV's +# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV +# shell: bash +# +# - name: Slack Notification +# uses: rtCamp/action-slack-notify@master +# env: +# SLACK_WEBHOOK: ${{ secrets.SLACK_URL }} +# SLACK_CHANNEL: dev +# SLACK_USERNAME: StatpingDev From eab22bec0d95e35b941c39be7ef1b2a9fd0dd8ff Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sun, 22 Aug 2021 00:25:56 +0200 Subject: [PATCH 03/90] add environment variables for controlling jobs --- .github/workflows/build.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 004d1b08..bb37773f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,19 @@ on: paths-ignore: - "**.md" +env: + is-stable: | + github.event_name == 'push' + && github.ref == 'refs/heads/stable' + is-unstable: | + github.event_name == 'push' + && github.ref == 'refs/heads/unstable' + # this is an alias for is-stable || is-unstable + is-release: | + github.event_name == 'push' + && (github.ref == 'refs/heads/stable' + || github.ref == 'refs/heads/unstable') + jobs: frontend: runs-on: ubuntu-latest @@ -466,7 +479,7 @@ jobs: docker-release: needs: [build, test-postman-sqlite, test-postman-mysql, test-postman-postgres] - runs-on: [self-hosted, linux, aboutcher-hosted, rocky8] + runs-on: ubuntu-latest steps: - name: Checkout Statping Repo From 0086580f7a27c93bbbfc1590065245e9964bed25 Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sun, 22 Aug 2021 00:28:40 +0200 Subject: [PATCH 04/90] add environment variables for controlling jobs --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb37773f..5a1bd6c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -478,6 +478,7 @@ jobs: # TODO i got lazy here docker-release: + if: ${{ env.is-release }} needs: [build, test-postman-sqlite, test-postman-mysql, test-postman-postgres] runs-on: ubuntu-latest From 8ab7896596da36aef7c9dc13098f2c22a0a330a9 Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sun, 22 Aug 2021 00:33:40 +0200 Subject: [PATCH 05/90] replace - with _ in actions env variable names not sure if this was what's breaking the workflow --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a1bd6c4..0c7cc5f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,14 +8,14 @@ on: - "**.md" env: - is-stable: | + is_stable: | github.event_name == 'push' && github.ref == 'refs/heads/stable' - is-unstable: | + is_unstable: | github.event_name == 'push' && github.ref == 'refs/heads/unstable' # this is an alias for is-stable || is-unstable - is-release: | + is_release: | github.event_name == 'push' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/unstable') @@ -478,7 +478,7 @@ jobs: # TODO i got lazy here docker-release: - if: ${{ env.is-release }} + if: ${{ env.is_release }} needs: [build, test-postman-sqlite, test-postman-mysql, test-postman-postgres] runs-on: ubuntu-latest From 51365a4407a4433da9188fb9784e608f22c38f28 Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sun, 22 Aug 2021 00:46:58 +0200 Subject: [PATCH 06/90] fix env variable problem turns out the workflow-wide `env` context doesn't work in job-level if conditions (it does however in step-level if conditions, which seems odd) --- .github/workflows/build.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c7cc5f6..efa2910c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -475,11 +475,23 @@ jobs: # TODO everything from here on is stable/unstable release only -# TODO i got lazy here + # all other release jobs should be based on this + release-precondition-check: + if: | + github.event_name == 'push' + && (github.ref == 'refs/heads/stable' + || github.ref == 'refs/heads/unstable') + needs: [build, test-postman-sqlite, test-postman-mysql, test-postman-postgres] + runs-on: ubuntu-latest + steps: + - name: dummy operation + - run: | + : + + # TODO i got lazy here docker-release: - if: ${{ env.is_release }} - needs: [build, test-postman-sqlite, test-postman-mysql, test-postman-postgres] + needs: release-precondition-check runs-on: ubuntu-latest steps: From 48578d092d4b1e6bf8da629f0cff1afa0276e886 Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sun, 22 Aug 2021 00:48:59 +0200 Subject: [PATCH 07/90] fix yaml typo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efa2910c..15cc1b29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -485,7 +485,7 @@ jobs: runs-on: ubuntu-latest steps: - name: dummy operation - - run: | + run: | : # TODO i got lazy here From c79694862f86d7e39fc6a5a2df31523f83bfe2ad Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sun, 22 Aug 2021 00:49:49 +0200 Subject: [PATCH 08/90] more typos --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 15cc1b29..24404747 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -134,7 +134,7 @@ jobs: shell: bash - name: Set Windows Build Flags - if: matrix.platform == 'windows' && + if: matrix.platform == 'windows' run: | echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV echo "XGO_TAGS=netgo osusergo sqlite_omit_load_extension" >> $GITHUB_ENV @@ -170,7 +170,7 @@ jobs: echo "compressed=statping-linux-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - name: Compress Windows Builds - if: matrix.platform == 'windows' && + if: matrix.platform == 'windows' run: | cd build mv statping-windows-4.0-${{ matrix.arch }}.exe statping.exe From 19f03b6b07b79a5f4fb6f1cd9de5f03f234407ef Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sun, 22 Aug 2021 01:03:41 +0200 Subject: [PATCH 09/90] disable test job and add some comments --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 24404747..5b6aca16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -195,6 +195,7 @@ jobs: name: statping-${{ matrix.platform }}-${{ matrix.arch }} path: ./build + # TODO this should be its own job - DONT CREATE A RELEASE ON DEV - name: Upload Releases id: upload-assets uses: softprops/action-gh-release@v1 @@ -217,6 +218,8 @@ jobs: test: needs: frontend + # temporarily disabled + if: "false" runs-on: ubuntu-latest services: postgres: @@ -514,6 +517,8 @@ jobs: # TODO the cache keys for stable/unstable were different here, but that doesn't really matter # TODO use docker metadata action instead of this (don't refer to makefile for docker commands at all) # TODO consider creating builds for dev (not really needed?), if so: not multiarch + # TODO build docker image before releasing (in parallel to build), use same cache here and there. + # --> don't push from build step so everything can be released (somewhat) simultaneously - name: Cache Docker layers uses: actions/cache@v2 id: buildx-docker-master From 1c207ed5e07114d0fa346b68adcbda6fe3bb2a6e Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sun, 22 Aug 2021 01:05:29 +0200 Subject: [PATCH 10/90] temporarily disable windows build (@jemand771 remember to revert this) --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b6aca16..a9ee245c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,8 +94,8 @@ jobs: include: - platform: darwin arch: amd64 - - platform: windows - arch: amd64 +# - platform: windows +# arch: amd64 steps: - uses: actions/checkout@v2 From e896d8afbca7031853c12a16a045199a0b3c35ce Mon Sep 17 00:00:00 2001 From: jemand771 Date: Sun, 22 Aug 2021 01:24:15 +0200 Subject: [PATCH 11/90] also temporarily disable darwin build (@jemand771 remember to revert this) --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9ee245c..7baa0236 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,9 +91,9 @@ jobs: matrix: platform: [linux] arch: [386, amd64, arm-7, arm-6, arm64] - include: - - platform: darwin - arch: amd64 +# include: +# - platform: darwin +# arch: amd64 # - platform: windows # arch: amd64 From 3f948126a30805cd89f29a537907e5a036e1bc3b Mon Sep 17 00:00:00 2001 From: Willy Date: Sat, 2 Oct 2021 16:13:42 +0200 Subject: [PATCH 12/90] catch up with workflow changes * I was gone for a while and will try to catch up with upstream changes in the next couple of commits * since git can't know I'm "combining" multiple files, an automatic merge wouldn't work here * added todo comments on places that will need special attention * dockerfiles still need merging -> this commit is broken! (only using it to keep track of external changes) --- .github/workflows/build.yml | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7baa0236..aaa1dc72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,11 +91,13 @@ jobs: matrix: platform: [linux] arch: [386, amd64, arm-7, arm-6, arm64] -# include: -# - platform: darwin -# arch: amd64 -# - platform: windows -# arch: amd64 + include: + - platform: darwin + arch: 386 + - platform: darwin + arch: amd64 + - platform: windows + arch: [amd64, 386] steps: - uses: actions/checkout@v2 @@ -136,7 +138,7 @@ jobs: - name: Set Windows Build Flags if: matrix.platform == 'windows' run: | - echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV + echo "BUILD_FLAGS=-extldflags -static -buildmode=exe" >> $GITHUB_ENV echo "XGO_TAGS=netgo osusergo sqlite_omit_load_extension" >> $GITHUB_ENV shell: bash @@ -179,16 +181,30 @@ jobs: rm -rf statping.exe echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV - - name: Compress Darwin Builds - if: matrix.platform == 'darwin' + # TODO combine these steps? + - name: Compress Darwin 32bit Builds + if: matrix.platform == 'darwin' && matrix.arch == '386' run: | cd build - mv statping-darwin-10.6-${{ matrix.arch }} statping + ls >> $GITHUB_ENV + # mv statping-darwin-10.6-${{ matrix.arch }} statping + # chmod +x statping + # tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz * + # rm -rf statping + # echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV + + - name: Compress Darwin 64bit Builds + if: matrix.platform == 'darwin' && matrix.arch == 'amd64' + run: | + cd build + mv statping-darwin-10.12-${{ matrix.arch }} statping chmod +x statping tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping rm -rf statping echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV + # TODO darwin arm64? + - name: Upload Compiled Statping Binary uses: actions/upload-artifact@v1 with: @@ -528,12 +544,14 @@ jobs: restore-keys: | buildx-docker-master + # TODO duplicate login why? - name: Docker Login env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin + # TODO get rid of the base image - name: Docker Build :base run: make buildx-base From a8147eb790157227f3ace71de879f55e805cb829 Mon Sep 17 00:00:00 2001 From: Willy Date: Sat, 2 Oct 2021 16:59:23 +0200 Subject: [PATCH 13/90] fix workflow file: accidental indentation --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aaa1dc72..500fab3d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,11 +93,11 @@ jobs: arch: [386, amd64, arm-7, arm-6, arm64] include: - platform: darwin - arch: 386 - - platform: darwin - arch: amd64 - - platform: windows - arch: [amd64, 386] + arch: 386 + - platform: darwin + arch: amd64 + - platform: windows + arch: [amd64, 386] steps: - uses: actions/checkout@v2 From b5a9f17d6d80dff2ba5d413b1986feae619790d9 Mon Sep 17 00:00:00 2001 From: Willy Date: Sat, 2 Oct 2021 17:26:26 +0200 Subject: [PATCH 14/90] temporarily disable PR CI trigger * I don't want my commits to spam the upstream repo with lots of failed action jobs for my incomplete PR * prevent accidentally creating a release (shouldn't happen with the modified workflow in the head branch (github uses base branch workflows) but you never know) --- .github/workflows/build.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 500fab3d..9e920e1c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,9 +3,10 @@ on: push: paths-ignore: - "**.md" - pull_request: - paths-ignore: - - "**.md" +# TODO turn PR trigger back on +# pull_request: +# paths-ignore: +# - "**.md" env: is_stable: | @@ -85,19 +86,19 @@ jobs: rm -rf source.tar.gz build: - needs: [frontend, test-postman-sqlite, test-postman-mysql, test-postman-postgres] + needs: [ frontend, test-postman-sqlite, test-postman-mysql, test-postman-postgres ] runs-on: ubuntu-latest strategy: matrix: - platform: [linux] - arch: [386, amd64, arm-7, arm-6, arm64] + platform: [ linux ] + arch: [ 386, amd64, arm-7, arm-6, arm64 ] include: - platform: darwin arch: 386 - platform: darwin arch: amd64 - platform: windows - arch: [amd64, 386] + arch: [ amd64, 386 ] steps: - uses: actions/checkout@v2 @@ -492,7 +493,7 @@ jobs: timeoutRequest: 30000 delayRequest: 600 -# TODO everything from here on is stable/unstable release only + # TODO everything from here on is stable/unstable release only # all other release jobs should be based on this release-precondition-check: @@ -500,7 +501,7 @@ jobs: github.event_name == 'push' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/unstable') - needs: [build, test-postman-sqlite, test-postman-mysql, test-postman-postgres] + needs: [ build, test-postman-sqlite, test-postman-mysql, test-postman-postgres ] runs-on: ubuntu-latest steps: - name: dummy operation From c938bcd9e60819f3d05bb9cd09a8d8590c9baa4f Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 8 Oct 2021 15:48:24 +0200 Subject: [PATCH 15/90] fix matrix argument: arrays not allowed in includes --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e920e1c..ea96130e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,7 +98,9 @@ jobs: - platform: darwin arch: amd64 - platform: windows - arch: [ amd64, 386 ] + arch: amd64 + - platform: windows + arch: 386 steps: - uses: actions/checkout@v2 From cc01dce8c323e224a972d379c7fe3242141b528d Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 8 Oct 2021 16:18:04 +0200 Subject: [PATCH 16/90] (maybe temporarily) remove "Statping Emailer" postman test * disclaimer: I don't fully understand what I'm doing here * it looks like this test references https://statping.com, which - in the long term - we don't want anyway * --> either remove dependency or replace with own version --- dev/postman.json | 50 ------------------------------------------------ 1 file changed, 50 deletions(-) diff --git a/dev/postman.json b/dev/postman.json index 3e2f60ff..7e11d3fb 100644 --- a/dev/postman.json +++ b/dev/postman.json @@ -4598,56 +4598,6 @@ "body": "{\n \"success\": true,\n \"response\": \"There's been a glitch… | Slack

There’s been a glitch…

We’re not quite sure what went wrong. You can go back, or try looking on our Help Center if you need a hand.

\\n\\n\\n\\n\"\n}" } ] - }, - { - "name": "Statping Emailer", - "event": [ - { - "listen": "test", - "script": { - "id": "00f5c79e-e927-4305-b276-265b4d51b1e1", - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"email\": \"info@socialeck.com\",\n \"core\": {\n \"allow_reports\": true,\n \"created_at\": \"2020-06-21T05:00:12.735144154Z\",\n \"description\": \"This status page has sample data included\",\n \"domain\": \"http://localhost:8080\",\n \"footer\": null,\n \"language\": \"en\",\n \"migration_id\": 1592715612,\n \"name\": \"Statping Sample Data\",\n \"setup\": true,\n \"started_on\": \"2020-06-21T05:01:01.406134998Z\",\n \"updated_at\": \"2020-06-21T05:00:59.652965634Z\",\n \"using_cdn\": false,\n \"version\": \"0.90.54\"\n },\n \"service\": {\n \"name\": \"Statping Website\",\n \"domain\": \"https://statping.com\",\n \"last_error\": \"2020-06-21T01:01:01.406134998Z\",\n \"last_success\": \"2020-06-21T05:01:01.406134998Z\",\n \"expected\": \"\",\n \"online\": true,\n \"expected_status\": 200,\n \"check_interval\": 30,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 30,\n \"order_id\": 0\n },\n \"failure\": {\n \"created_at\": \"2020-06-21T05:01:00.67942464Z\",\n \"error_code\": 406,\n \"id\": 1613,\n \"issue\": \"HTTP Status Code 406 did not match 200\",\n \"method_id\": 0,\n \"ping\": 10889\n }\n}", - "options": { - "raw": {} - } - }, - "url": { - "raw": "https://news.statping.com/notifier", - "protocol": "https", - "host": [ - "news", - "statping", - "com" - ], - "path": [ - "notifier" - ] - }, - "description": "This endpoint will send emails from our servers rather than you using your own SMTP email settings. Once you save the Statping Emailer Notifier, we will send you a verification email. Once you've confirmed your email address you will recieve emails whenever your service status changes." - }, - "response": [] } ], "description": "Statping contains multiple notifiers that will send you a notification whenever a service become offline, or online. You can create your own 3rd party notifier by reading more on the [Notifiers Wiki](https://github.com/statping-ng/statping-ng/wiki/Notifiers) on the Github repo.", From 09862f5ad318fbfcd6009a013e20dd3d29d304da Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 25 Jan 2022 10:57:00 +0100 Subject: [PATCH 17/90] enable optional debug output for xgo this was previously enabled for the dev workflow and disabled for stable/unstable. having more output could be useful at some point --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea96130e..ea512a57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -156,9 +156,9 @@ jobs: dest: build prefix: statping targets: ${{ matrix.platform }}/${{ matrix.arch }} - # TODO v and x were true for dev workflow but false for stable/unstable. what do they do? - v: false - x: false + # v and x enable additional debug output + v: true + x: true pkg: cmd buildmode: pie tags: ${{ env.XGO_TAGS }} From 1eae5266654ba3439ce5dbaf37649a4c94496731 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 25 Jan 2022 10:58:02 +0100 Subject: [PATCH 18/90] disabled darwin/386 for now the build step doesn't output a file. this can be fixed later --- .github/workflows/build.yml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ea512a57..eed322f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,8 +93,9 @@ jobs: platform: [ linux ] arch: [ 386, amd64, arm-7, arm-6, arm64 ] include: - - platform: darwin - arch: 386 + # TODO darwin/386 is broken, ignore for now + # - platform: darwin + # arch: 386 - platform: darwin arch: amd64 - platform: windows @@ -184,20 +185,8 @@ jobs: rm -rf statping.exe echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV - # TODO combine these steps? - - name: Compress Darwin 32bit Builds - if: matrix.platform == 'darwin' && matrix.arch == '386' - run: | - cd build - ls >> $GITHUB_ENV - # mv statping-darwin-10.6-${{ matrix.arch }} statping - # chmod +x statping - # tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz * - # rm -rf statping - # echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - - - name: Compress Darwin 64bit Builds - if: matrix.platform == 'darwin' && matrix.arch == 'amd64' + - name: Compress Darwin Builds + if: matrix.platform == 'darwin' run: | cd build mv statping-darwin-10.12-${{ matrix.arch }} statping @@ -206,8 +195,6 @@ jobs: rm -rf statping echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - # TODO darwin arm64? - - name: Upload Compiled Statping Binary uses: actions/upload-artifact@v1 with: From 24b521031d6f0a62236c3992d57bb64b39c4e195 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 25 Jan 2022 10:59:07 +0100 Subject: [PATCH 19/90] allow build while tests are running this produces build artifacts faster at the cost of potentially "wasted" processing time --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eed322f7..6286a123 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,7 +86,7 @@ jobs: rm -rf source.tar.gz build: - needs: [ frontend, test-postman-sqlite, test-postman-mysql, test-postman-postgres ] + needs: frontend runs-on: ubuntu-latest strategy: matrix: From 76c9ff0dd4f807bfc88d54aabae82575b223762d Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 25 Jan 2022 11:01:51 +0100 Subject: [PATCH 20/90] create a github release from workflow artifacts on stable/unstable runs this is based on the artifact's file names, currently `statping-*`. --- .github/workflows/build.yml | 49 +++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6286a123..93eb782d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -201,21 +201,6 @@ jobs: name: statping-${{ matrix.platform }}-${{ matrix.arch }} path: ./build - # TODO this should be its own job - DONT CREATE A RELEASE ON DEV - - name: Upload Releases - id: upload-assets - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: ${{ env.VERSION }} - with: - # TODO add "dev-" prefix for unstable - # TODO only do this for stable/unstable pushes - tag_name: v${{ env.VERSION }} - draft: true - prerelease: true - files: build/${{ env.compressed }} - - name: Upload Compiled Binaries to S3 # temporarily disabled if: "false" @@ -486,10 +471,14 @@ jobs: # all other release jobs should be based on this release-precondition-check: + # only run release jobs on push to stable/unstable + # sadly, you can't use ${{ env.is_release }} here if: | + success() && ( github.event_name == 'push' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/unstable') + ) needs: [ build, test-postman-sqlite, test-postman-mysql, test-postman-postgres ] runs-on: ubuntu-latest steps: @@ -497,7 +486,35 @@ jobs: run: | : - # TODO i got lazy here + github-release: + runs-on: ubuntu-latest + needs: release-precondition-check + steps: + # TODO read version somewhere *once* and use output globally + - name: Checkout Statping Repo + uses: actions/checkout@v2 + - name: Setting ENV's + run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV + - name: Download job artifacts + uses: actions/download-artifact@v2 + with: + path: downloads + - name: Accumulate files + run: | + mkdir files + find downloads -type f -exec cp {} files \; + - name: Upload Releases + id: upload-assets + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ env.VERSION }} + with: + # add "dev-" prefix for unstable releases + tag_name: ${{ env.is_unstable && 'dev-' || '' }}v${{ env.VERSION }} + draft: true + prerelease: true + files: files/statping-* docker-release: needs: release-precondition-check From a2ebef4da609c3514a4491762eb034fae0268c9e Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 25 Jan 2022 11:02:46 +0100 Subject: [PATCH 21/90] remove jobs that we won't be using anyway this includes sentry and homebrew releases and slack notifications --- .github/workflows/build.yml | 59 ------------------------------------- 1 file changed, 59 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93eb782d..2d53be73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -572,62 +572,3 @@ jobs: # TODO do we even want a "static" :dev tag? - name: Docker Build :dev run: make buildx-dev - -# sentry-release: -# needs: docker-release -# runs-on: ubuntu-latest -# steps: -# - name: Checkout Statping Repo -# uses: actions/checkout@v2 -# -# - name: Setup Sentry CLI -# uses: mathrix-education/setup-sentry-cli@master -# with: -# version: latest -# url: ${{ secrets.SENTRY_URL }} -# token: ${{ secrets.SENTRY_AUTH_TOKEN }} -# organization: statping -# -# - name: Setting ENV's -# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV -# shell: bash -# -# - name: Sentry Release -# run: make sentry-release - -# everything from here is stable only - -# homebrew-release: -# needs: docker-release -# runs-on: ubuntu-latest -# steps: -# - name: Checkout Statping Repo -# uses: actions/checkout@v2 -# -# - name: Setting ENV's -# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV -# shell: bash -# -# - name: Update Homebrew Package -# env: -# VERSION: ${{ env.VERSION }} -# TRAVIS_API: ${{ secrets.TRAVIS_API }} -# run: make publish-homebrew -# -# slack-update: -# needs: docker-release -# runs-on: ubuntu-latest -# steps: -# - name: Checkout Statping Repo -# uses: actions/checkout@v2 -# -# - name: Setting ENV's -# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV -# shell: bash -# -# - name: Slack Notification -# uses: rtCamp/action-slack-notify@master -# env: -# SLACK_WEBHOOK: ${{ secrets.SLACK_URL }} -# SLACK_CHANNEL: dev -# SLACK_USERNAME: StatpingDev From 565559286442941cf7b1159c9e64cda913d2ac65 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 25 Jan 2022 11:10:09 +0100 Subject: [PATCH 22/90] add a data job to fetch the version in one central place the only downside to this is that every job now has a dependency on data, but I think that's acceptable --- .github/workflows/build.yml | 69 +++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d53be73..10e72d8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,8 +22,21 @@ env: || github.ref == 'refs/heads/unstable') jobs: + data: + # this job collects general variables and inputs for later use. + # not all of them might be needed but having them in a central place is more helpful than 100% efficiency. + # also, the name is intentionally short to make later references shorter. + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - uses: actions/checkout@v2 + - name: get version + id: version + run: echo "::set-output name=version::$(cat version.txt)" frontend: runs-on: ubuntu-latest + needs: data steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 @@ -33,10 +46,9 @@ jobs: with: node-version: 12.18.2 - - name: Set Version + - name: Add go/bin to path run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Install Global Dependencies @@ -54,7 +66,7 @@ jobs: - name: Build Frontend Statping env: - VERSION: ${{ env.VERSION }} + VERSION: ${{ needs.data.outputs.version }} COMMIT: ${{ github.sha }} MJML_APP: ${{ secrets.MJML_APP }} MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} @@ -86,7 +98,7 @@ jobs: rm -rf source.tar.gz build: - needs: frontend + needs: [ data, frontend ] runs-on: ubuntu-latest strategy: matrix: @@ -121,11 +133,6 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-west-2 - - name: Add GOBIN to PATH - run: | - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - name: Set Linux Build Flags if: matrix.platform == 'linux' run: | @@ -149,7 +156,7 @@ jobs: - name: Build ${{ matrix.platform }}/${{ matrix.arch }} uses: crazy-max/ghaction-xgo@v1 env: - VERSION: ${{ env.VERSION }} + VERSION: ${{ needs.data.outputs.version }} COMMIT: ${{ github.sha }} with: xgo_version: latest @@ -163,7 +170,7 @@ jobs: pkg: cmd buildmode: pie tags: ${{ env.XGO_TAGS }} - ldflags: -s -w -X main.VERSION=${{ env.VERSION }} -X main.COMMIT=${{ env.COMMIT }} ${{ env.BUILD_FLAGS }} + ldflags: -s -w -X main.VERSION=${{ needs.data.outputs.version }} -X main.COMMIT=${{ env.COMMIT }} ${{ env.BUILD_FLAGS }} - name: Compress Linux Builds if: matrix.platform == 'linux' @@ -208,7 +215,7 @@ jobs: aws s3 cp build/${{ env.compressed }} s3://assets.statping.com/commit/${{ github.sha }}/ test: - needs: frontend + needs: [ data, frontend ] # temporarily disabled if: "false" runs-on: ubuntu-latest @@ -248,7 +255,6 @@ jobs: run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -259,7 +265,7 @@ jobs: - name: Install Statping env: - VERSION: ${{ env.VERSION }} + VERSION: ${{ needs.data.outputs.version }} COMMIT: ${{ github.sha }} run: | make build certs @@ -271,7 +277,7 @@ jobs: go get gotest.tools/gotestsum gotestsum --no-summary=skipped --format testname -- -covermode=count -coverprofile=coverage.out -p=1 ./... env: - VERSION: ${{ env.VERSION }} + VERSION: ${{ needs.data.outputs.version }} COMMIT: ${{ github.sha }} DB_CONN: sqlite3 STATPING_DIR: ${{ github.workspace }} @@ -314,7 +320,7 @@ jobs: COVERALLS: ${{ secrets.COVERALLS }} test-postman-sqlite: - needs: frontend + needs: [ data, frontend ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -326,7 +332,6 @@ jobs: run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -337,7 +342,7 @@ jobs: - name: Install Statping env: - VERSION: ${{ env.VERSION }} + VERSION: ${{ needs.data.outputs.version }} COMMIT: ${{ github.sha }} run: | make build @@ -357,7 +362,7 @@ jobs: delayRequest: 600 test-postman-mysql: - needs: frontend + needs: [ data, frontend ] runs-on: ubuntu-latest services: @@ -380,7 +385,6 @@ jobs: run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -391,7 +395,7 @@ jobs: - name: Install Statping env: - VERSION: ${{ env.VERSION }} + VERSION: ${{ needs.data.outputs.version }} COMMIT: ${{ github.sha }} MJML_APP: ${{ secrets.MJML_APP }} MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} @@ -413,7 +417,7 @@ jobs: delayRequest: 600 test-postman-postgres: - needs: frontend + needs: [ data, frontend ] runs-on: ubuntu-latest services: @@ -437,7 +441,6 @@ jobs: run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -448,7 +451,7 @@ jobs: - name: Install Statping env: - VERSION: ${{ env.VERSION }} + VERSION: ${{ needs.data.outputs.version }} COMMIT: ${{ github.sha }} run: | make build @@ -479,7 +482,7 @@ jobs: && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/unstable') ) - needs: [ build, test-postman-sqlite, test-postman-mysql, test-postman-postgres ] + needs: [ data, build, test-postman-sqlite, test-postman-mysql, test-postman-postgres ] runs-on: ubuntu-latest steps: - name: dummy operation @@ -488,13 +491,9 @@ jobs: github-release: runs-on: ubuntu-latest - needs: release-precondition-check + needs: [ data, release-precondition-check ] steps: # TODO read version somewhere *once* and use output globally - - name: Checkout Statping Repo - uses: actions/checkout@v2 - - name: Setting ENV's - run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - name: Download job artifacts uses: actions/download-artifact@v2 with: @@ -508,26 +507,22 @@ jobs: uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: ${{ env.VERSION }} + VERSION: ${{ needs.data.outputs.version }} with: # add "dev-" prefix for unstable releases - tag_name: ${{ env.is_unstable && 'dev-' || '' }}v${{ env.VERSION }} + tag_name: ${{ env.is_unstable && 'dev-' || '' }}v${{ needs.data.outputs.version }} draft: true prerelease: true files: files/statping-* docker-release: - needs: release-precondition-check + needs: [ data, release-precondition-check ] runs-on: ubuntu-latest steps: - name: Checkout Statping Repo uses: actions/checkout@v2 - - name: Setting ENV's - run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - name: Set up QEMU uses: docker/setup-qemu-action@v1 From dd3508de9d6e69acbfe7b22438c725566ce55086 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 25 Jan 2022 12:05:59 +0100 Subject: [PATCH 23/90] move is_release, is_stable and is_unstable to data job once again, having this in one place is nice --- .github/workflows/build.yml | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10e72d8f..8a411a0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,19 +8,6 @@ on: # paths-ignore: # - "**.md" -env: - is_stable: | - github.event_name == 'push' - && github.ref == 'refs/heads/stable' - is_unstable: | - github.event_name == 'push' - && github.ref == 'refs/heads/unstable' - # this is an alias for is-stable || is-unstable - is_release: | - github.event_name == 'push' - && (github.ref == 'refs/heads/stable' - || github.ref == 'refs/heads/unstable') - jobs: data: # this job collects general variables and inputs for later use. @@ -29,11 +16,20 @@ jobs: runs-on: ubuntu-latest outputs: version: ${{ steps.version.outputs.version }} + is_release: ${{ steps.states.outputs.is_release }} + is_stable: ${{ steps.states.outputs.is_stable }} + is_unstable: ${{ steps.states.outputs.is_unstable }} steps: - uses: actions/checkout@v2 - name: get version id: version run: echo "::set-output name=version::$(cat version.txt)" + - name: get stable/unstable states + id: states + run: | + echo "::set-output name=is_release::${{ github.event_name == 'push' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/unstable') }}" + echo "::set-output name=is_stable::${{ github.event_name == 'push' && github.ref == 'refs/heads/stable' }}" + echo "::set-output name=is_unstable::${{ github.event_name == 'push' && github.ref == 'refs/heads/unstable' }}" frontend: runs-on: ubuntu-latest needs: data @@ -474,14 +470,9 @@ jobs: # all other release jobs should be based on this release-precondition-check: - # only run release jobs on push to stable/unstable - # sadly, you can't use ${{ env.is_release }} here - if: | - success() && ( - github.event_name == 'push' - && (github.ref == 'refs/heads/stable' - || github.ref == 'refs/heads/unstable') - ) + # only run release jobs on push to stable/unstable. + # yes, we need to explicitly compare to 'true' here since it's a string + if: ${{ success() && needs.data.outputs.is_release == 'true' }} needs: [ data, build, test-postman-sqlite, test-postman-mysql, test-postman-postgres ] runs-on: ubuntu-latest steps: @@ -510,7 +501,7 @@ jobs: VERSION: ${{ needs.data.outputs.version }} with: # add "dev-" prefix for unstable releases - tag_name: ${{ env.is_unstable && 'dev-' || '' }}v${{ needs.data.outputs.version }} + tag_name: ${{ needs.data.outputs.is_unstable && 'dev-' || '' }}v${{ needs.data.outputs.version }} draft: true prerelease: true files: files/statping-* From 6d753ccc86cb909a94349ba5caaf8c2239703c8f Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 21:06:29 +0100 Subject: [PATCH 25/90] add docker build via custom action, remove release step for now --- .github/workflows/build.yml | 94 ++++++------------------------------- 1 file changed, 15 insertions(+), 79 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a411a0d..b56239e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -466,6 +466,18 @@ jobs: timeoutRequest: 30000 delayRequest: 600 + docker-build: + needs: [ data ] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: jemand771/docker-build-action@main + with: + GITHUB_TOKEN: ${{ github.token }} + push_strategy: artifact + platforms: linux/amd64 + # TODO everything from here on is stable/unstable release only # all other release jobs should be based on this @@ -473,88 +485,12 @@ jobs: # only run release jobs on push to stable/unstable. # yes, we need to explicitly compare to 'true' here since it's a string if: ${{ success() && needs.data.outputs.is_release == 'true' }} - needs: [ data, build, test-postman-sqlite, test-postman-mysql, test-postman-postgres ] + needs: [ data, build, test-postman-sqlite, test-postman-mysql, test-postman-postgres, docker-build ] runs-on: ubuntu-latest steps: - name: dummy operation run: | : - github-release: - runs-on: ubuntu-latest - needs: [ data, release-precondition-check ] - steps: - # TODO read version somewhere *once* and use output globally - - name: Download job artifacts - uses: actions/download-artifact@v2 - with: - path: downloads - - name: Accumulate files - run: | - mkdir files - find downloads -type f -exec cp {} files \; - - name: Upload Releases - id: upload-assets - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: ${{ needs.data.outputs.version }} - with: - # add "dev-" prefix for unstable releases - tag_name: ${{ needs.data.outputs.is_unstable && 'dev-' || '' }}v${{ needs.data.outputs.version }} - draft: true - prerelease: true - files: files/statping-* - - docker-release: - needs: [ data, release-precondition-check ] - runs-on: ubuntu-latest - - steps: - - name: Checkout Statping Repo - uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - id: buildx - with: - install: true - - # TODO the cache keys for stable/unstable were different here, but that doesn't really matter - # TODO use docker metadata action instead of this (don't refer to makefile for docker commands at all) - # TODO consider creating builds for dev (not really needed?), if so: not multiarch - # TODO build docker image before releasing (in parallel to build), use same cache here and there. - # --> don't push from build step so everything can be released (somewhat) simultaneously - - name: Cache Docker layers - uses: actions/cache@v2 - id: buildx-docker-master - with: - path: /tmp/.buildx-cache - key: buildx-docker-master - restore-keys: | - buildx-docker-master - - # TODO duplicate login why? - - name: Docker Login - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin - - # TODO get rid of the base image - - name: Docker Build :base - run: make buildx-base - - - name: Docker Login - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin - - # TODO this should be :latest in stable - # TODO do we even want a "static" :dev tag? - - name: Docker Build :dev - run: make buildx-dev + # TODO push docker image(s) and release artifacts + # TODO bring back dockerhub image From 871cb37f09776b8eae9c9dce04d10b5d7bb5e15a Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 21:19:25 +0100 Subject: [PATCH 26/90] move no and go versions to data step, bump go to 1.18 --- .github/workflows/build.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b56239e7..b2b822d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,8 @@ jobs: is_release: ${{ steps.states.outputs.is_release }} is_stable: ${{ steps.states.outputs.is_stable }} is_unstable: ${{ steps.states.outputs.is_unstable }} + go_version: 1.18.x + node_version: 12.18.2 steps: - uses: actions/checkout@v2 - name: get version @@ -37,10 +39,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: ${{ needs.data.outputs.go_version }} - uses: actions/setup-node@v1 with: - node-version: 12.18.2 + node-version: ${{ needs.data.outputs.node_version }} - name: Add go/bin to path run: | @@ -156,7 +158,7 @@ jobs: COMMIT: ${{ github.sha }} with: xgo_version: latest - go_version: 1.15.x + go_version: ${{ needs.data.outputs.go_version }} dest: build prefix: statping targets: ${{ matrix.platform }}/${{ matrix.arch }} @@ -210,6 +212,8 @@ jobs: run: | aws s3 cp build/${{ env.compressed }} s3://assets.statping.com/commit/${{ github.sha }}/ + # TODO refactor (and fix) tests + test: needs: [ data, frontend ] # temporarily disabled @@ -239,10 +243,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: ${{ needs.data.outputs.go_version }} - uses: actions/setup-node@v1 with: - node-version: 12.18.2 + node-version: ${{ needs.data.outputs.node_version }} - name: Install Global Dependencies run: npm install -g yarn sass newman cross-env wait-on @sentry/cli @@ -250,7 +254,7 @@ jobs: - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/${{ needs.data.outputs.node_version }}/x64/bin" >> $GITHUB_PATH shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -322,12 +326,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: ${{ needs.data.outputs.go_version }} - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/${{ needs.data.outputs.node_version }}/x64/bin" >> $GITHUB_PATH shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -375,12 +379,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: ${{ needs.data.outputs.go_version }} - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/${{ needs.data.outputs.node_version }}/x64/bin" >> $GITHUB_PATH shell: bash - name: Download Compiled Frontend (rice-box.go) @@ -431,12 +435,12 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: 1.15.x + go-version: ${{ needs.data.outputs.go_version }} - name: Setting ENV's run: | echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/12.18.2/x64/bin" >> $GITHUB_PATH + echo "/opt/hostedtoolcache/node/${{ needs.data.outputs.node_version }}/x64/bin" >> $GITHUB_PATH shell: bash - name: Download Compiled Frontend (rice-box.go) From 63acc67e53047b1469ea35cdfc812de55f70cb00 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 21:29:05 +0100 Subject: [PATCH 27/90] bump node in actions workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2b822d7..d1dffff8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: is_stable: ${{ steps.states.outputs.is_stable }} is_unstable: ${{ steps.states.outputs.is_unstable }} go_version: 1.18.x - node_version: 12.18.2 + node_version: 16.14.0 steps: - uses: actions/checkout@v2 - name: get version From a261a5373d69e31cbfadda899e8aeaa454609b4b Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 21:40:06 +0100 Subject: [PATCH 28/90] add wiki as git module --- .gitmodules | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..1b0d0530 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "source/statping-ng.wiki"] + # TODO should this be a relative path? (would require wiki fork for statping forks) + url = https://github.com/statping-ng/statping-ng.wiki.git From 996e9be0b09139ed211e10af91016fd7d22900c2 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 21:40:22 +0100 Subject: [PATCH 29/90] fix go dependencies --- go.sum | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.sum b/go.sum index dec75f9e..6c65ec64 100755 --- a/go.sum +++ b/go.sum @@ -247,6 +247,7 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gomarkdown/markdown v0.0.0-20200820230800-3724143f5294 h1:rSb2ZQZ3B1rlWBWamxobyn0jTuGZHbPO5Rmjw48uWRM= github.com/gomarkdown/markdown v0.0.0-20200820230800-3724143f5294/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -554,6 +555,7 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1 h1:HGVkRrwDCbmSP6h1CoBDj6l/mhnvsP5JbYaQ4ss0R6o= github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1/go.mod h1:I3xbaE9ud9/TEXzehwkHx86SyJwqeSNsX2X5oV61jIg= +github.com/tdewolff/minify/v2 v2.8.0 h1:t3tOPWkTpKhsgxm3IM9Sy8hE2eIt30Oaa+2havJGGIE= github.com/tdewolff/minify/v2 v2.8.0/go.mod h1:6zN8VLhMfFxNrwHROcboYNo2+huPNu4SV8DPh3PUQ8E= github.com/tdewolff/parse/v2 v2.4.4/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho= github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= From 98b3622499373ed490bf44c1aee6eb2383783c0f Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 21:49:15 +0100 Subject: [PATCH 30/90] go mod tidy --- go.mod | 92 ---------------------------------------------------------- go.sum | 2 -- 2 files changed, 94 deletions(-) diff --git a/go.mod b/go.mod index 4e2a4e4d..8f8ecf18 100644 --- a/go.mod +++ b/go.mod @@ -33,100 +33,8 @@ require ( ) require ( - cloud.google.com/go v0.56.0 // indirect - github.com/Azure/azure-sdk-for-go v41.3.0+incompatible // indirect - github.com/Azure/go-autorest/autorest v0.10.0 // indirect - github.com/Azure/go-autorest/autorest/adal v0.8.3 // indirect - github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 // indirect - github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 // indirect - github.com/Azure/go-autorest/autorest/date v0.2.0 // indirect - github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect - github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect - github.com/Azure/go-autorest/logger v0.1.0 // indirect - github.com/Azure/go-autorest/tracing v0.5.0 // indirect - github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87 // indirect - github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.11 // indirect - github.com/aliyun/alibaba-cloud-sdk-go v1.61.131 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.0.2 // indirect - github.com/cloudflare/cloudflare-go v0.11.6 // indirect - github.com/cpu/goacmedns v0.0.2 // indirect - github.com/daaku/go.zipexe v1.0.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dimchansky/utfbom v1.1.0 // indirect - github.com/dnsimple/dnsimple-go v0.60.0 // indirect - github.com/exoscale/egoscale v0.18.1 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/go-acme/lego/v3 v3.7.0 // indirect - github.com/go-errors/errors v1.0.2 // indirect - github.com/go-resty/resty/v2 v2.2.0 // indirect - github.com/go-sql-driver/mysql v1.5.0 // indirect - github.com/gofrs/uuid v3.2.0+incompatible // indirect - github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect - github.com/golang/protobuf v1.4.2 // indirect - github.com/google/go-querystring v1.0.0 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/gax-go/v2 v2.0.5 // indirect - github.com/gophercloud/gophercloud v0.10.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.1 // indirect - github.com/hashicorp/go-retryablehttp v0.6.6 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/jinzhu/inflection v1.0.0 // indirect - github.com/jmespath/go-jmespath v0.3.0 // indirect - github.com/json-iterator/go v1.1.9 // indirect - github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b // indirect - github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect - github.com/labbsr0x/bindman-dns-webhook v1.0.2 // indirect - github.com/labbsr0x/goh v1.0.1 // indirect - github.com/lextoumbourou/goodhosts v2.1.0+incompatible // indirect - github.com/lib/pq v1.3.0 // indirect - github.com/linode/linodego v0.14.0 // indirect - github.com/liquidweb/liquidweb-go v1.6.1 // indirect - github.com/magiconair/properties v1.8.1 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/miekg/dns v1.1.29 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.2.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 // indirect - github.com/nrdcg/auroradns v1.0.1 // indirect - github.com/nrdcg/dnspod-go v0.4.0 // indirect - github.com/nrdcg/goinwx v0.6.1 // indirect - github.com/nrdcg/namesilo v0.2.1 // indirect - github.com/oracle/oci-go-sdk v17.4.0+incompatible // indirect - github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014 // indirect - github.com/patrickmn/go-cache v2.1.0+incompatible // indirect - github.com/pelletier/go-toml v1.7.0 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect - github.com/prometheus/common v0.6.0 // indirect - github.com/prometheus/procfs v0.0.3 // indirect - github.com/sacloud/libsacloud v1.36.1 // indirect - github.com/spf13/afero v1.2.2 // indirect - github.com/spf13/cast v1.3.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.2.0 // indirect - github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7 // indirect - github.com/transip/gotransip/v6 v6.0.2 // indirect - github.com/vultr/govultr v0.3.3 // indirect - go.opencensus.io v0.22.3 // indirect - go.uber.org/ratelimit v0.1.0 // indirect golang.org/x/net v0.2.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect - golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect - google.golang.org/api v0.21.0 // indirect - google.golang.org/appengine v1.6.6 // indirect - google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect - google.golang.org/protobuf v1.25.0 // indirect - gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect - gopkg.in/ini.v1 v1.55.0 // indirect - gopkg.in/ns1/ns1-go.v2 v2.3.0 // indirect - gopkg.in/square/go-jose.v2 v2.5.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) diff --git a/go.sum b/go.sum index 6c65ec64..dec75f9e 100755 --- a/go.sum +++ b/go.sum @@ -247,7 +247,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomarkdown/markdown v0.0.0-20200820230800-3724143f5294 h1:rSb2ZQZ3B1rlWBWamxobyn0jTuGZHbPO5Rmjw48uWRM= github.com/gomarkdown/markdown v0.0.0-20200820230800-3724143f5294/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -555,7 +554,6 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1 h1:HGVkRrwDCbmSP6h1CoBDj6l/mhnvsP5JbYaQ4ss0R6o= github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1/go.mod h1:I3xbaE9ud9/TEXzehwkHx86SyJwqeSNsX2X5oV61jIg= -github.com/tdewolff/minify/v2 v2.8.0 h1:t3tOPWkTpKhsgxm3IM9Sy8hE2eIt30Oaa+2havJGGIE= github.com/tdewolff/minify/v2 v2.8.0/go.mod h1:6zN8VLhMfFxNrwHROcboYNo2+huPNu4SV8DPh3PUQ8E= github.com/tdewolff/parse/v2 v2.4.4/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho= github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= From 97e62f981631aba6776a0ddfca701b8b65694632 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 22:19:16 +0100 Subject: [PATCH 31/90] manually revert changes to go.mod and go.sum --- go.mod | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- go.sum | 2 +- 2 files changed, 94 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 8f8ecf18..1520b584 100644 --- a/go.mod +++ b/go.mod @@ -33,8 +33,100 @@ require ( ) require ( + cloud.google.com/go v0.56.0 // indirect + github.com/Azure/azure-sdk-for-go v41.3.0+incompatible // indirect + github.com/Azure/go-autorest/autorest v0.10.0 // indirect + github.com/Azure/go-autorest/autorest/adal v0.8.3 // indirect + github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 // indirect + github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 // indirect + github.com/Azure/go-autorest/autorest/date v0.2.0 // indirect + github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect + github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect + github.com/Azure/go-autorest/logger v0.1.0 // indirect + github.com/Azure/go-autorest/tracing v0.5.0 // indirect + github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87 // indirect + github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.11 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.61.131 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.0.2 // indirect + github.com/cloudflare/cloudflare-go v0.11.6 // indirect + github.com/cpu/goacmedns v0.0.2 // indirect + github.com/daaku/go.zipexe v1.0.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dimchansky/utfbom v1.1.0 // indirect + github.com/dnsimple/dnsimple-go v0.60.0 // indirect + github.com/exoscale/egoscale v0.18.1 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect + github.com/go-acme/lego/v3 v3.7.0 // indirect + github.com/go-errors/errors v1.0.2 // indirect + github.com/go-resty/resty/v2 v2.2.0 // indirect + github.com/go-sql-driver/mysql v1.5.0 // indirect + github.com/gofrs/uuid v3.2.0+incompatible // indirect + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect + github.com/golang/protobuf v1.4.2 // indirect + github.com/google/go-querystring v1.0.0 // indirect github.com/google/uuid v1.3.0 // indirect + github.com/googleapis/gax-go/v2 v2.0.5 // indirect + github.com/gophercloud/gophercloud v0.10.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.1 // indirect + github.com/hashicorp/go-retryablehttp v0.6.6 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jmespath/go-jmespath v0.3.0 // indirect + github.com/json-iterator/go v1.1.9 // indirect + github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b // indirect + github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect + github.com/labbsr0x/bindman-dns-webhook v1.0.2 // indirect + github.com/labbsr0x/goh v1.0.1 // indirect + github.com/lextoumbourou/goodhosts v2.1.0+incompatible // indirect + github.com/lib/pq v1.3.0 // indirect + github.com/linode/linodego v0.14.0 // indirect + github.com/liquidweb/liquidweb-go v1.6.1 // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/miekg/dns v1.1.29 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.2.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 // indirect + github.com/nrdcg/auroradns v1.0.1 // indirect + github.com/nrdcg/dnspod-go v0.4.0 // indirect + github.com/nrdcg/goinwx v0.6.1 // indirect + github.com/nrdcg/namesilo v0.2.1 // indirect + github.com/oracle/oci-go-sdk v17.4.0+incompatible // indirect + github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/pelletier/go-toml v1.7.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect + github.com/prometheus/common v0.6.0 // indirect + github.com/prometheus/procfs v0.0.3 // indirect + github.com/sacloud/libsacloud v1.36.1 // indirect + github.com/spf13/afero v1.2.2 // indirect + github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7 // indirect + github.com/transip/gotransip/v6 v6.0.2 // indirect + github.com/vultr/govultr v0.3.3 // indirect + go.opencensus.io v0.22.3 // indirect + go.uber.org/ratelimit v0.1.0 // indirect golang.org/x/net v0.2.0 // indirect golang.org/x/sync v0.1.0 // indirect -) + golang.org/x/sys v0.2.0 // indirect + golang.org/x/text v0.4.0 // indirect + golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect + google.golang.org/api v0.21.0 // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect + google.golang.org/protobuf v1.25.0 // indirect + gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect + gopkg.in/ini.v1 v1.55.0 // indirect + gopkg.in/ns1/ns1-go.v2 v2.3.0 // indirect + gopkg.in/square/go-jose.v2 v2.5.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect +) \ No newline at end of file diff --git a/go.sum b/go.sum index dec75f9e..e8e0131f 100755 --- a/go.sum +++ b/go.sum @@ -947,4 +947,4 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= \ No newline at end of file From 4baa1f830da3a6c2096d0db4a05283f8aedc6e29 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 22:55:47 +0100 Subject: [PATCH 32/90] go mod tidy v2, update 2 packages --- go.mod | 94 +--------------------------------------------------------- go.sum | 2 +- 2 files changed, 2 insertions(+), 94 deletions(-) diff --git a/go.mod b/go.mod index 1520b584..8f8ecf18 100644 --- a/go.mod +++ b/go.mod @@ -33,100 +33,8 @@ require ( ) require ( - cloud.google.com/go v0.56.0 // indirect - github.com/Azure/azure-sdk-for-go v41.3.0+incompatible // indirect - github.com/Azure/go-autorest/autorest v0.10.0 // indirect - github.com/Azure/go-autorest/autorest/adal v0.8.3 // indirect - github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 // indirect - github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 // indirect - github.com/Azure/go-autorest/autorest/date v0.2.0 // indirect - github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect - github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect - github.com/Azure/go-autorest/logger v0.1.0 // indirect - github.com/Azure/go-autorest/tracing v0.5.0 // indirect - github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87 // indirect - github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.11 // indirect - github.com/aliyun/alibaba-cloud-sdk-go v1.61.131 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.0.2 // indirect - github.com/cloudflare/cloudflare-go v0.11.6 // indirect - github.com/cpu/goacmedns v0.0.2 // indirect - github.com/daaku/go.zipexe v1.0.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dimchansky/utfbom v1.1.0 // indirect - github.com/dnsimple/dnsimple-go v0.60.0 // indirect - github.com/exoscale/egoscale v0.18.1 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/go-acme/lego/v3 v3.7.0 // indirect - github.com/go-errors/errors v1.0.2 // indirect - github.com/go-resty/resty/v2 v2.2.0 // indirect - github.com/go-sql-driver/mysql v1.5.0 // indirect - github.com/gofrs/uuid v3.2.0+incompatible // indirect - github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect - github.com/golang/protobuf v1.4.2 // indirect - github.com/google/go-querystring v1.0.0 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/gax-go/v2 v2.0.5 // indirect - github.com/gophercloud/gophercloud v0.10.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.1 // indirect - github.com/hashicorp/go-retryablehttp v0.6.6 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/jinzhu/inflection v1.0.0 // indirect - github.com/jmespath/go-jmespath v0.3.0 // indirect - github.com/json-iterator/go v1.1.9 // indirect - github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b // indirect - github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect - github.com/labbsr0x/bindman-dns-webhook v1.0.2 // indirect - github.com/labbsr0x/goh v1.0.1 // indirect - github.com/lextoumbourou/goodhosts v2.1.0+incompatible // indirect - github.com/lib/pq v1.3.0 // indirect - github.com/linode/linodego v0.14.0 // indirect - github.com/liquidweb/liquidweb-go v1.6.1 // indirect - github.com/magiconair/properties v1.8.1 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/miekg/dns v1.1.29 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.2.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 // indirect - github.com/nrdcg/auroradns v1.0.1 // indirect - github.com/nrdcg/dnspod-go v0.4.0 // indirect - github.com/nrdcg/goinwx v0.6.1 // indirect - github.com/nrdcg/namesilo v0.2.1 // indirect - github.com/oracle/oci-go-sdk v17.4.0+incompatible // indirect - github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014 // indirect - github.com/patrickmn/go-cache v2.1.0+incompatible // indirect - github.com/pelletier/go-toml v1.7.0 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect - github.com/prometheus/common v0.6.0 // indirect - github.com/prometheus/procfs v0.0.3 // indirect - github.com/sacloud/libsacloud v1.36.1 // indirect - github.com/spf13/afero v1.2.2 // indirect - github.com/spf13/cast v1.3.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.2.0 // indirect - github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7 // indirect - github.com/transip/gotransip/v6 v6.0.2 // indirect - github.com/vultr/govultr v0.3.3 // indirect - go.opencensus.io v0.22.3 // indirect - go.uber.org/ratelimit v0.1.0 // indirect golang.org/x/net v0.2.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect - golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect - google.golang.org/api v0.21.0 // indirect - google.golang.org/appengine v1.6.6 // indirect - google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect - google.golang.org/protobuf v1.25.0 // indirect - gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect - gopkg.in/ini.v1 v1.55.0 // indirect - gopkg.in/ns1/ns1-go.v2 v2.3.0 // indirect - gopkg.in/square/go-jose.v2 v2.5.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect -) \ No newline at end of file +) diff --git a/go.sum b/go.sum index e8e0131f..dec75f9e 100755 --- a/go.sum +++ b/go.sum @@ -947,4 +947,4 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= \ No newline at end of file +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 2641a529864875fca20efe4229c8773cb57af46e Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 23:23:11 +0100 Subject: [PATCH 33/90] temp --- Dockerfile | 9 +---- go.mod | 108 +++++++++++++++++++++++++++++++++++++++++++++++++---- go.sum | 57 +++++++++++++++++----------- 3 files changed, 139 insertions(+), 35 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6997cc18..0beee14c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN yarn build && yarn cache clean # Statping Golang BACKEND building from source # Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying -FROM golang:1.17-alpine AS backend +FROM golang:1.19-alpine AS backend LABEL maintainer="Statping-NG (https://github.com/statping-ng)" ARG VERSION ARG COMMIT @@ -27,14 +27,9 @@ RUN . sassc/script/bootstrap && make -C sassc -j4 WORKDIR /go/src/github.com/statping-ng/statping-ng ADD go.mod go.sum ./ -RUN go mod download +# RUN go mod download ENV GO111MODULE on ENV CGO_ENABLED 1 -RUN go get github.com/stretchr/testify/assert && \ - go get github.com/stretchr/testify/require && \ - go get github.com/GeertJohan/go.rice/rice && \ - go get github.com/cortesi/modd/cmd/modd && \ - go get github.com/crazy-max/xgo COPY . . COPY --from=frontend /statping/dist/ ./source/dist/ RUN make clean generate embed diff --git a/go.mod b/go.mod index 8f8ecf18..cd814aad 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,9 @@ module github.com/statping-ng/statping-ng -// +heroku goVersion go1.17 -go 1.17 +go 1.19 require ( - github.com/GeertJohan/go.rice v1.0.2 + github.com/GeertJohan/go.rice v1.0.3 github.com/aws/aws-sdk-go v1.30.20 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/fatih/structs v1.1.0 @@ -23,9 +22,9 @@ require ( github.com/spf13/cobra v1.0.0 github.com/spf13/viper v1.6.3 github.com/statping-ng/emails v1.0.3 - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.8.1 github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1 - golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 + golang.org/x/crypto v0.4.0 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d google.golang.org/grpc v1.28.1 gopkg.in/natefinch/lumberjack.v2 v2.0.0 @@ -33,8 +32,103 @@ require ( ) require ( - github.com/fsnotify/fsnotify v1.5.1 // indirect + cloud.google.com/go v0.56.0 // indirect + github.com/Azure/azure-sdk-for-go v41.3.0+incompatible // indirect + github.com/Azure/go-autorest/autorest v0.10.0 // indirect + github.com/Azure/go-autorest/autorest/adal v0.8.3 // indirect + github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 // indirect + github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 // indirect + github.com/Azure/go-autorest/autorest/date v0.2.0 // indirect + github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect + github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect + github.com/Azure/go-autorest/logger v0.1.0 // indirect + github.com/Azure/go-autorest/tracing v0.5.0 // indirect + github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87 // indirect + github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.11 // indirect + github.com/aliyun/alibaba-cloud-sdk-go v1.61.131 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.0.2 // indirect + github.com/cloudflare/cloudflare-go v0.11.6 // indirect + github.com/cpu/goacmedns v0.0.2 // indirect + github.com/daaku/go.zipexe v1.0.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dimchansky/utfbom v1.1.0 // indirect + github.com/dnsimple/dnsimple-go v0.60.0 // indirect + github.com/exoscale/egoscale v0.18.1 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/go-acme/lego/v3 v3.7.0 // indirect + github.com/go-errors/errors v1.0.2 // indirect + github.com/go-resty/resty/v2 v2.2.0 // indirect + github.com/go-sql-driver/mysql v1.5.0 // indirect + github.com/gofrs/uuid v3.2.0+incompatible // indirect + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect + github.com/golang/protobuf v1.4.2 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-querystring v1.0.0 // indirect github.com/google/uuid v1.3.0 // indirect - golang.org/x/net v0.2.0 // indirect + github.com/googleapis/gax-go/v2 v2.0.5 // indirect + github.com/gophercloud/gophercloud v0.10.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.1 // indirect + github.com/hashicorp/go-retryablehttp v0.6.6 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jmespath/go-jmespath v0.3.0 // indirect + github.com/json-iterator/go v1.1.9 // indirect + github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b // indirect + github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/labbsr0x/bindman-dns-webhook v1.0.2 // indirect + github.com/labbsr0x/goh v1.0.1 // indirect + github.com/lextoumbourou/goodhosts v2.1.0+incompatible // indirect + github.com/lib/pq v1.3.0 // indirect + github.com/linode/linodego v0.14.0 // indirect + github.com/liquidweb/liquidweb-go v1.6.1 // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/miekg/dns v1.1.29 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.2.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 // indirect + github.com/nrdcg/auroradns v1.0.1 // indirect + github.com/nrdcg/dnspod-go v0.4.0 // indirect + github.com/nrdcg/goinwx v0.6.1 // indirect + github.com/nrdcg/namesilo v0.2.1 // indirect + github.com/oracle/oci-go-sdk v17.4.0+incompatible // indirect + github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/pelletier/go-toml v1.7.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect + github.com/prometheus/common v0.6.0 // indirect + github.com/prometheus/procfs v0.0.3 // indirect + github.com/sacloud/libsacloud v1.36.1 // indirect + github.com/spf13/afero v1.2.2 // indirect + github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7 // indirect + github.com/transip/gotransip/v6 v6.0.2 // indirect + github.com/vultr/govultr v0.3.3 // indirect + go.opencensus.io v0.22.3 // indirect + go.uber.org/ratelimit v0.1.0 // indirect + golang.org/x/net v0.4.0 // indirect golang.org/x/sync v0.1.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect + golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect + google.golang.org/api v0.21.0 // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect + google.golang.org/protobuf v1.25.0 // indirect + gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/ini.v1 v1.55.0 // indirect + gopkg.in/ns1/ns1-go.v2 v2.3.0 // indirect + gopkg.in/square/go-jose.v2 v2.5.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index dec75f9e..9a78ac34 100755 --- a/go.sum +++ b/go.sum @@ -75,8 +75,8 @@ github.com/DATA-DOG/go-sqlmock v1.4.1 h1:ThlnYciV1iM/V0OSF/dtkqWb6xo5qITT1TJBG1M github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= -github.com/GeertJohan/go.rice v1.0.2 h1:PtRw+Tg3oa3HYwiDBZyvOJ8LdIyf6lAovJJtr7YOAYk= -github.com/GeertJohan/go.rice v1.0.2/go.mod h1:af5vUNlDNkCjOZeSGFgIJxDje9qdjsO6hshx0gTmZt4= +github.com/GeertJohan/go.rice v1.0.3 h1:k5viR+xGtIhF61125vCE1cmJ5957RQGXG6dmbaWZSmI= +github.com/GeertJohan/go.rice v1.0.3/go.mod h1:XVdrU4pW00M4ikZed5q56tPf1v2KwnIKeIdc9CBYNt4= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -133,8 +133,9 @@ github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwc github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/daaku/go.zipexe v1.0.0 h1:VSOgZtH418pH9L16hC/JrgSNJbbAL26pj7lmD1+CGdY= github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E= +github.com/daaku/go.zipexe v1.0.2 h1:Zg55YLYTr7M9wjKn8SY/WcpuuEi+kR2u4E8RhvpyXmk= +github.com/daaku/go.zipexe v1.0.2/go.mod h1:5xWogtqlYnfBXkSB1o9xysukNP9GTvaNkqzUZbt3Bw8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -176,8 +177,8 @@ github.com/foomo/tlsconfig v0.0.0-20180418120404-b67861b076c9 h1:RPOsDNbnDUFaSt/ github.com/foomo/tlsconfig v0.0.0-20180418120404-b67861b076c9/go.mod h1:OdiGKKgTAfMv7x9Hh9qYFueue77tr09LUAxwy2+M8wY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/getsentry/sentry-go v0.5.1 h1:MIPe7ScHADsrK2vznqmhksIUFxq7m0JfTh+ZIMkI+VQ= github.com/getsentry/sentry-go v0.5.1/go.mod h1:B8H7x8TYDPkeWPRzGpIiFO97LZP6rL8A3hEt8lUItMw= @@ -256,8 +257,9 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -360,6 +362,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -426,7 +431,6 @@ github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nkovacs/streamquote v1.0.0/go.mod h1:BN+NaZ2CmdKqUuTUXUEm9j95B2TRbpOWpxbJYzzgUsc= @@ -460,6 +464,7 @@ github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAv github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -494,6 +499,8 @@ github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKc github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -542,14 +549,19 @@ github.com/statping/emails v1.0.0/go.mod h1:xFU85jXaiWQadqHqu/jDrGsAn6WPSk1WgKyT github.com/statping/statping v0.90.64/go.mod h1:lbyNPB73IjWtnommV4wSejYfgUT1yLhhqelMjl1ZBb8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1 h1:HGVkRrwDCbmSP6h1CoBDj6l/mhnvsP5JbYaQ4ss0R6o= @@ -628,8 +640,9 @@ golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200406173513-056763e48d71/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= +golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -699,8 +712,9 @@ golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -761,22 +775,22 @@ golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -827,7 +841,6 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -901,8 +914,9 @@ gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= @@ -936,8 +950,9 @@ gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 1751de0bbca368c3ae51a4851a4a94c2d37d1034 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 23:25:24 +0100 Subject: [PATCH 34/90] go get missing packages for go generate --- go.mod | 3 +++ go.sum | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/go.mod b/go.mod index cd814aad..1ce0e590 100644 --- a/go.mod +++ b/go.mod @@ -63,6 +63,7 @@ require ( github.com/gofrs/uuid v3.2.0+incompatible // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.4.2 // indirect + github.com/gomarkdown/markdown v0.0.0-20221013030248-663e2500819c // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.0.0 // indirect github.com/google/uuid v1.3.0 // indirect @@ -111,6 +112,8 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect + github.com/tdewolff/minify/v2 v2.12.4 // indirect + github.com/tdewolff/parse/v2 v2.6.4 // indirect github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7 // indirect github.com/transip/gotransip/v6 v6.0.2 // indirect github.com/vultr/govultr v0.3.3 // indirect diff --git a/go.sum b/go.sum index 9a78ac34..ec477814 100755 --- a/go.sum +++ b/go.sum @@ -149,6 +149,7 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= +github.com/djherbis/atime v1.1.0/go.mod h1:28OF6Y8s3NQWwacXc5eZTsEsiMzp7LF8MbXE+XJPdBE= github.com/dnaeon/go-vcr v0.0.0-20180814043457-aafff18a5cc2/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnsimple/dnsimple-go v0.60.0 h1:N+q+ML1CZGf+5r4udu9Opy7WJNtOaFT9aM86Af9gLhk= @@ -249,6 +250,8 @@ github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0 github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomarkdown/markdown v0.0.0-20200820230800-3724143f5294/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU= +github.com/gomarkdown/markdown v0.0.0-20221013030248-663e2500819c h1:iyaGYbCmcYK0Ja9a3OUa2Fo+EaN0cbLu0eKpBwPFzc8= +github.com/gomarkdown/markdown v0.0.0-20221013030248-663e2500819c/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -567,8 +570,13 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69 github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1 h1:HGVkRrwDCbmSP6h1CoBDj6l/mhnvsP5JbYaQ4ss0R6o= github.com/t-tiger/gorm-bulk-insert/v2 v2.0.1/go.mod h1:I3xbaE9ud9/TEXzehwkHx86SyJwqeSNsX2X5oV61jIg= github.com/tdewolff/minify/v2 v2.8.0/go.mod h1:6zN8VLhMfFxNrwHROcboYNo2+huPNu4SV8DPh3PUQ8E= +github.com/tdewolff/minify/v2 v2.12.4 h1:kejsHQMM17n6/gwdw53qsi6lg0TGddZADVyQOz1KMdE= +github.com/tdewolff/minify/v2 v2.12.4/go.mod h1:h+SRvSIX3kwgwTFOpSckvSxgax3uy8kZTSF1Ojrr3bk= github.com/tdewolff/parse/v2 v2.4.4/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho= +github.com/tdewolff/parse/v2 v2.6.4 h1:KCkDvNUMof10e3QExio9OPZJT8SbdKojLBumw8YZycQ= +github.com/tdewolff/parse/v2 v2.6.4/go.mod h1:woz0cgbLwFdtbjJu8PIKxhW05KplTFQkOdX78o+Jgrs= github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= +github.com/tdewolff/test v1.0.7/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7 h1:CpHxIaZzVy26GqJn8ptRyto8fuoYOd1v0fXm9bG3wQ8= github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= From 311c6c5946a86cc7a8f92d622a22cd68b7300006 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 22:48:41 +0000 Subject: [PATCH 35/90] fix unused vars --- utils/utils_custom.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/utils/utils_custom.go b/utils/utils_custom.go index 08fd9781..cc5062b3 100644 --- a/utils/utils_custom.go +++ b/utils/utils_custom.go @@ -6,10 +6,6 @@ package utils import ( "errors" "os" - "os/exec" - "regexp" - "strconv" - "strings" "syscall" ) From 9830ad77ab236deeaa6cd9bd85f93f6f3cb3d3d1 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 22:48:50 +0000 Subject: [PATCH 36/90] generate is just broken? --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0beee14c..e3e98910 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,8 @@ ENV GO111MODULE on ENV CGO_ENABLED 1 COPY . . COPY --from=frontend /statping/dist/ ./source/dist/ -RUN make clean generate embed +RUN go install github.com/GeertJohan/go.rice/rice@latest +RUN make clean embed RUN go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd RUN chmod a+x statping && mv statping /go/bin/statping # /go/bin/statping - statping binary From 88dca8c9c324b8b189093af78bb91ab21176e322 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 22:59:42 +0000 Subject: [PATCH 37/90] reenable go mod download step --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e3e98910..85f4510c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,7 @@ RUN . sassc/script/bootstrap && make -C sassc -j4 WORKDIR /go/src/github.com/statping-ng/statping-ng ADD go.mod go.sum ./ -# RUN go mod download +RUN go mod download ENV GO111MODULE on ENV CGO_ENABLED 1 COPY . . From fc43502394031f495562962914bad629a5d964b6 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 23:09:41 +0000 Subject: [PATCH 38/90] dockerfile-like rice-box build --- .github/workflows/build.yml | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1dffff8..95597a6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,38 +40,25 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ needs.data.outputs.go_version }} + - name: Install rice + run: go install github.com/GeertJohan/go.rice/rice@latest - uses: actions/setup-node@v1 with: node-version: ${{ needs.data.outputs.node_version }} - - - name: Add go/bin to path - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - shell: bash - - - name: Install Global Dependencies - run: npm install -g yarn sass cross-env mjml - - name: Download Frontend Dependencies working-directory: ./frontend run: yarn - - - name: Download Go mods - run: | - go mod download - go mod verify - make test-deps - - name: Build Frontend Statping - env: - VERSION: ${{ needs.data.outputs.version }} - COMMIT: ${{ github.sha }} - MJML_APP: ${{ secrets.MJML_APP }} - MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: make clean generate compile - + working-directory: ./frontend + run: yarn build + - name: Copy built frontend + run: | + cp -r frontend/dist source/ + cp -r frontend/src/assets/scss source/dist/ + cp frontend/public/robots.txt source/dist/ + - name: Build rice-box.go + run: rice embed-go + working-directory: source - name: Upload Compiled Frontend (rice-box.go) uses: actions/upload-artifact@v1 with: From c7b884bc7743c46a0ae92c6f5507824b46a4d4e1 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 23:13:36 +0000 Subject: [PATCH 39/90] bump crazy-max/ghaction-xgo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95597a6c..61391e82 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -139,7 +139,7 @@ jobs: shell: bash - name: Build ${{ matrix.platform }}/${{ matrix.arch }} - uses: crazy-max/ghaction-xgo@v1 + uses: crazy-max/ghaction-xgo@v2 env: VERSION: ${{ needs.data.outputs.version }} COMMIT: ${{ github.sha }} From cacb6204b97c59def89a969f5e899a367753cebc Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 23:20:42 +0000 Subject: [PATCH 40/90] remove push.statping.com postman test --- dev/postman.json | 99 ------------------------------------------------ 1 file changed, 99 deletions(-) diff --git a/dev/postman.json b/dev/postman.json index cd061232..03e868b2 100644 --- a/dev/postman.json +++ b/dev/postman.json @@ -766,105 +766,6 @@ "description": "You can create custom badges with dynamic information by using [Shields.io](https://shields.io/) and parsing JSON fields with [JSONPath](http://jsonpath.com/). \n\n## Examples\n\n#### Service Uptime Percent\n\n\n- URL: [https://demo.statping.com/api/services/2](https://demo.statping.com/api/services/2)\n- JSON Path: `$.online_24_hours`\n- Suffix: `%`\n\n```\nhttps://img.shields.io/badge/dynamic/json?color=blue&label=%20Statping%20Uptime&query=%24.online_24_hours&url=https%3A%2F%2Fdemo.statping.com%2Fapi%2Fservices%2F2&suffix=%\n```\n\n#### Count Services\n\n\n- URL: [https://demo.statping.com/health](https://demo.statping.com/health)\n- JSON Path: `$.services`\n- Suffix: ` services`\n\n```\nhttps://img.shields.io/badge/dynamic/json?color=purple&label=Demo%20Site&query=%24.services&url=https://demo.statping.com/health&suffix=%20services\n```" }, "response": [] - }, - { - "name": "Send Push Notification", - "event": [ - { - "listen": "test", - "script": { - "id": "11fe392f-3636-4d2d-84e9-1119b351d8ee", - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"notifications\": [\n {\n \"tokens\": [\"dBLB1WvTJkiWl3ZPjP0-BS:APA91bGXUbKy65CaN1XqExHXZ892jik2k9XORXSiqdUyXhcQ5RDiJ6LfXrckuH3StYJFcma4UCDr_N038YUtxYsRIHYx_8vWZ6D2uq3199LegWXGl5tz-9zk3M4WZGX8WGxIRUJ31QtW\"],\n \"platform\": 2,\n \"message\": \"This notification will go to iOS and Android platform via Firebase!\"\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "https://push.statping.com/api/push", - "protocol": "https", - "host": [ - "push", - "statping", - "com" - ], - "path": [ - "api", - "push" - ] - }, - "description": "Send a push notification to the Statping mobile app using your Firebase device identifier." - }, - "response": [ - { - "name": "Send Push Notification", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"notifications\": [\n {\n \"tokens\": [\"dBLB1WvTJkiWl3ZPjP0-BS:APA91bGXUbKy65CaN1XqExHXZ892jik2k9XORXSiqdUyXhcQ5RDiJ6LfXrckuH3StYJFcma4UCDr_N038YUtxYsRIHYx_8vWZ6D2uq3199LegWXGl5tz-9zk3M4WZGX8WGxIRUJ31QtW\"],\n \"platform\": 2,\n \"message\": \"This notification will go to iOS and Android Statping App\"\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "https://push.statping.com/api/push", - "protocol": "https", - "host": [ - "push", - "statping", - "com" - ], - "path": [ - "api", - "push" - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Length", - "value": "37" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Date", - "value": "Thu, 13 Aug 2020 02:24:17 GMT" - }, - { - "key": "X-Gorush-Version", - "value": "No Version Provided" - } - ], - "cookie": [], - "body": "{\n \"counts\": 1,\n \"logs\": [],\n \"success\": \"ok\"\n}" - } - ] } ], "description": "This is for Statping's miscellaneous API endpoints that aren't a part of another category.", From 6e452624e54ccd427b5672c77b3a6a019d838da3 Mon Sep 17 00:00:00 2001 From: Willy Date: Tue, 31 Jan 2023 23:22:56 +0000 Subject: [PATCH 41/90] temporary ls --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61391e82..277d420f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -157,6 +157,8 @@ jobs: tags: ${{ env.XGO_TAGS }} ldflags: -s -w -X main.VERSION=${{ needs.data.outputs.version }} -X main.COMMIT=${{ env.COMMIT }} ${{ env.BUILD_FLAGS }} + - run: ls -la + - name: Compress Linux Builds if: matrix.platform == 'linux' run: | From de1947beb7c36b2b0ced1360a5a53ddb67b21fe2 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 00:45:33 +0100 Subject: [PATCH 42/90] ls build folder --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 277d420f..7aa1d2fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -157,7 +157,7 @@ jobs: tags: ${{ env.XGO_TAGS }} ldflags: -s -w -X main.VERSION=${{ needs.data.outputs.version }} -X main.COMMIT=${{ env.COMMIT }} ${{ env.BUILD_FLAGS }} - - run: ls -la + - run: ls -la build - name: Compress Linux Builds if: matrix.platform == 'linux' From dc3627df0bb5612d60c9e0d96e372e77a399cdbd Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 20:59:38 +0100 Subject: [PATCH 43/90] remove bogus version numbers, the output files don't have them anymore --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7aa1d2fd..9458226d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -173,7 +173,7 @@ jobs: if: matrix.platform == 'windows' run: | cd build - mv statping-windows-4.0-${{ matrix.arch }}.exe statping.exe + mv statping-windows-${{ matrix.arch }}.exe statping.exe chmod +x statping.exe zip statping-windows-${{ matrix.arch }}.zip statping.exe rm -rf statping.exe @@ -183,7 +183,7 @@ jobs: if: matrix.platform == 'darwin' run: | cd build - mv statping-darwin-10.12-${{ matrix.arch }} statping + mv statping-darwin-${{ matrix.arch }} statping chmod +x statping tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping rm -rf statping From 87fa0475b17568b5b70ec23ea739a86e66b22252 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 21:07:27 +0100 Subject: [PATCH 44/90] add submodule path to gitmodules --- .gitmodules | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmodules b/.gitmodules index 1b0d0530..2abbb4b7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "source/statping-ng.wiki"] + path = source/statping-ng.wiki # TODO should this be a relative path? (would require wiki fork for statping forks) url = https://github.com/statping-ng/statping-ng.wiki.git From bd23210e31351b38039b12e5964c290235bf8c6f Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 21:40:06 +0100 Subject: [PATCH 45/90] delete version.txt and see what breaks I hate this. I hate this file with a burning passion. --- version.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 version.txt diff --git a/version.txt b/version.txt deleted file mode 100644 index 8f63f4f9..00000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -0.91.0 From dfd578140adbafd43d19b5619ce8eef3e0a824eb Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 21:41:07 +0100 Subject: [PATCH 46/90] no need to clean in intermediate docker layers. also, no need for make inside the dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 85f4510c..e9a491c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ ARG VERSION ARG COMMIT ARG BUILDPLATFORM ARG TARGETARCH -RUN apk add --update --no-cache libstdc++ gcc g++ make git autoconf \ +RUN apk add --update --no-cache libstdc++ gcc g++ git autoconf \ libtool ca-certificates linux-headers wget curl jq && \ update-ca-certificates @@ -33,7 +33,7 @@ ENV CGO_ENABLED 1 COPY . . COPY --from=frontend /statping/dist/ ./source/dist/ RUN go install github.com/GeertJohan/go.rice/rice@latest -RUN make clean embed +RUN cd source && rice embed-go RUN go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd RUN chmod a+x statping && mv statping /go/bin/statping # /go/bin/statping - statping binary From 9dc4d11e8724adaec7b1b5b8d2e7315acc45e126 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 21:49:18 +0100 Subject: [PATCH 47/90] rework version and commit logic for CI --- .github/workflows/build.yml | 46 ++++++++++++------------------------- cmd/main.go | 2 +- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9458226d..22e7366c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,23 +15,24 @@ jobs: # also, the name is intentionally short to make later references shorter. runs-on: ubuntu-latest outputs: - version: ${{ steps.version.outputs.version }} - is_release: ${{ steps.states.outputs.is_release }} - is_stable: ${{ steps.states.outputs.is_stable }} - is_unstable: ${{ steps.states.outputs.is_unstable }} + is_release: ${{ steps.versions.outputs.is_release }} + version: ${{ steps.versions.outputs.version }} go_version: 1.18.x node_version: 16.14.0 steps: - uses: actions/checkout@v2 - - name: get version - id: version - run: echo "::set-output name=version::$(cat version.txt)" - name: get stable/unstable states - id: states + id: versions run: | - echo "::set-output name=is_release::${{ github.event_name == 'push' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/unstable') }}" - echo "::set-output name=is_stable::${{ github.event_name == 'push' && github.ref == 'refs/heads/stable' }}" - echo "::set-output name=is_unstable::${{ github.event_name == 'push' && github.ref == 'refs/heads/unstable' }}" + TAG=$(git describe --tags) + if [ "${{ github.ref }}" = "refs/heads/$TAG"]; then + echo "is_release=true" >> $GITHUB_OUTPUT + else + echo "is_release=false" >> $GITHUB_OUTPUT + fi + # this will be v1.2.3 for on-tag builds and v1.2.3-numberofcommits-sha for off-tag builds + echo "version=$LAST_TAG" >> $GITHUB_OUTPUT + shell: bash frontend: runs-on: ubuntu-latest needs: data @@ -140,9 +141,6 @@ jobs: - name: Build ${{ matrix.platform }}/${{ matrix.arch }} uses: crazy-max/ghaction-xgo@v2 - env: - VERSION: ${{ needs.data.outputs.version }} - COMMIT: ${{ github.sha }} with: xgo_version: latest go_version: ${{ needs.data.outputs.go_version }} @@ -155,7 +153,7 @@ jobs: pkg: cmd buildmode: pie tags: ${{ env.XGO_TAGS }} - ldflags: -s -w -X main.VERSION=${{ needs.data.outputs.version }} -X main.COMMIT=${{ env.COMMIT }} ${{ env.BUILD_FLAGS }} + ldflags: -s -w -X main.VERSION=${{ needs.data.outputs.version }} -X main.COMMIT=${{ github.sha }} ${{ env.BUILD_FLAGS }} - run: ls -la build @@ -253,9 +251,6 @@ jobs: path: ./source - name: Install Statping - env: - VERSION: ${{ needs.data.outputs.version }} - COMMIT: ${{ github.sha }} run: | make build certs chmod +x statping @@ -330,9 +325,6 @@ jobs: path: ./source - name: Install Statping - env: - VERSION: ${{ needs.data.outputs.version }} - COMMIT: ${{ github.sha }} run: | make build chmod +x statping @@ -384,10 +376,6 @@ jobs: - name: Install Statping env: - VERSION: ${{ needs.data.outputs.version }} - COMMIT: ${{ github.sha }} - MJML_APP: ${{ secrets.MJML_APP }} - MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} run: | make build chmod +x statping @@ -439,9 +427,6 @@ jobs: path: ./source - name: Install Statping - env: - VERSION: ${{ needs.data.outputs.version }} - COMMIT: ${{ github.sha }} run: | make build chmod +x statping @@ -470,11 +455,10 @@ jobs: GITHUB_TOKEN: ${{ github.token }} push_strategy: artifact platforms: linux/amd64 - - # TODO everything from here on is stable/unstable release only + # TODO pass version and commit as docker build args # all other release jobs should be based on this - release-precondition-check: + release: # only run release jobs on push to stable/unstable. # yes, we need to explicitly compare to 'true' here since it's a string if: ${{ success() && needs.data.outputs.is_release == 'true' }} diff --git a/cmd/main.go b/cmd/main.go index e4453c01..efce0b88 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -19,7 +19,7 @@ import ( var ( // VERSION stores the current version of Statping - VERSION string + VERSION string = "dev" // COMMIT stores the git commit hash for this version of Statping COMMIT string log = utils.Log.WithField("type", "cmd") From 812147a80897a9dad4a87ddc25622c9db4229914 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 21:54:30 +0100 Subject: [PATCH 48/90] typo --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22e7366c..6091aa5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -375,7 +375,6 @@ jobs: path: ./source - name: Install Statping - env: run: | make build chmod +x statping From fc5c5385705fce3149ad52817b2744e53e3b852c Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 22:06:52 +0100 Subject: [PATCH 49/90] try to fix git describe on gha - seems like actions/checkout doesn't fetch tags by default --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6091aa5b..c3aedd39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,10 @@ jobs: node_version: 16.14.0 steps: - uses: actions/checkout@v2 - - name: get stable/unstable states + - name: fetch tags + # check on https://github.com/actions/checkout/pull/579 occasionally if actions/checkout can do this natively yet + run: git fetch --tags + - name: get version information id: versions run: | TAG=$(git describe --tags) From 7ada23048cb7c0181de2c479472c9925a26b6004 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 22:09:37 +0100 Subject: [PATCH 50/90] tag fix attempt 2 --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3aedd39..812f5a76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,10 +20,10 @@ jobs: go_version: 1.18.x node_version: 16.14.0 steps: - - uses: actions/checkout@v2 - - name: fetch tags - # check on https://github.com/actions/checkout/pull/579 occasionally if actions/checkout can do this natively yet - run: git fetch --tags + - uses: actions/checkout@v3 + with: + # check on https://github.com/actions/checkout/pull/579 occasionally if actions/checkout can do this natively yet + fetch-depth: 0 - name: get version information id: versions run: | From f8c4b1f0f2c7ed8d9af80a08ea411476fa17d92d Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 22:12:40 +0100 Subject: [PATCH 51/90] print tag result --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 812f5a76..e48f8022 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: id: versions run: | TAG=$(git describe --tags) - if [ "${{ github.ref }}" = "refs/heads/$TAG"]; then + if [ "${{ github.ref }}" = "refs/heads/$TAG" ]; then echo "is_release=true" >> $GITHUB_OUTPUT else echo "is_release=false" >> $GITHUB_OUTPUT @@ -36,6 +36,11 @@ jobs: # this will be v1.2.3 for on-tag builds and v1.2.3-numberofcommits-sha for off-tag builds echo "version=$LAST_TAG" >> $GITHUB_OUTPUT shell: bash + - name: show data results + run: | + echo == version summary == + echo is_release: ${{ steps.versions.outputs.is_release }} + echo version: ${{ steps.versions.outputs.version }} frontend: runs-on: ubuntu-latest needs: data From 796555cdeaeab21c9c6e0c2104ba827d0c77f227 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 22:13:49 +0100 Subject: [PATCH 52/90] turns out we did need make --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e9a491c5..d0eb8d02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ ARG VERSION ARG COMMIT ARG BUILDPLATFORM ARG TARGETARCH -RUN apk add --update --no-cache libstdc++ gcc g++ git autoconf \ +RUN apk add --update --no-cache libstdc++ gcc g++ make git autoconf \ libtool ca-certificates linux-headers wget curl jq && \ update-ca-certificates From 2857a10f54cab26eeb50bc7b00f089e7cbe7647a Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 22:18:00 +0100 Subject: [PATCH 53/90] pass version info to docker build --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e48f8022..96260cf0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -462,7 +462,9 @@ jobs: GITHUB_TOKEN: ${{ github.token }} push_strategy: artifact platforms: linux/amd64 - # TODO pass version and commit as docker build args + args: + COMMIT=${{ github.sha }} + VERSION=${{ needs.data.outputs.version }} # all other release jobs should be based on this release: From 9137e8f85d077149800959a850b432c26f020c80 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 22:26:33 +0100 Subject: [PATCH 54/90] more typos --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96260cf0..25d84cfc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: echo "is_release=false" >> $GITHUB_OUTPUT fi # this will be v1.2.3 for on-tag builds and v1.2.3-numberofcommits-sha for off-tag builds - echo "version=$LAST_TAG" >> $GITHUB_OUTPUT + echo "version=$TAG" >> $GITHUB_OUTPUT shell: bash - name: show data results run: | From 072b1dc8d37df9cc3b65b99cf3b54120935acb4b Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 22:33:16 +0100 Subject: [PATCH 55/90] escape version because it may have dashes --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d0eb8d02..2b611beb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ COPY . . COPY --from=frontend /statping/dist/ ./source/dist/ RUN go install github.com/GeertJohan/go.rice/rice@latest RUN cd source && rice embed-go -RUN go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd +RUN go build -a -ldflags "-s -w -extldflags -static -X main.VERSION="${VERSION}" -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd RUN chmod a+x statping && mv statping /go/bin/statping # /go/bin/statping - statping binary # /root/sassc/bin/sassc - sass binary From 6c209758202fa713a9a465bb9449441fa360d58d Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 22:45:11 +0100 Subject: [PATCH 56/90] put the quotes somewhere else idk --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2b611beb..bb82a5f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ COPY . . COPY --from=frontend /statping/dist/ ./source/dist/ RUN go install github.com/GeertJohan/go.rice/rice@latest RUN cd source && rice embed-go -RUN go build -a -ldflags "-s -w -extldflags -static -X main.VERSION="${VERSION}" -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd +RUN go build -a -ldflags "-s -w -extldflags -static -X "main.VERSION=${VERSION}" -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd RUN chmod a+x statping && mv statping /go/bin/statping # /go/bin/statping - statping binary # /root/sassc/bin/sassc - sass binary From 38913a9889c39b4fb80063f47b8b966f38933ba1 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 1 Feb 2023 23:03:03 +0100 Subject: [PATCH 57/90] quoting/escaping hell --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bb82a5f2..58f1d204 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ COPY . . COPY --from=frontend /statping/dist/ ./source/dist/ RUN go install github.com/GeertJohan/go.rice/rice@latest RUN cd source && rice embed-go -RUN go build -a -ldflags "-s -w -extldflags -static -X "main.VERSION=${VERSION}" -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd +RUN go build -a -ldflags "-s -w -extldflags -static -X \"main.VERSION=${VERSION}\" -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd RUN chmod a+x statping && mv statping /go/bin/statping # /go/bin/statping - statping binary # /root/sassc/bin/sassc - sass binary From 51051377ff77663cb1b03944aeca7821d43d13ac Mon Sep 17 00:00:00 2001 From: Willy Date: Thu, 2 Feb 2023 20:14:19 +0100 Subject: [PATCH 58/90] temporarily log version/commit --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 58f1d204..a490fb4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,7 @@ COPY . . COPY --from=frontend /statping/dist/ ./source/dist/ RUN go install github.com/GeertJohan/go.rice/rice@latest RUN cd source && rice embed-go +RUN echo $VERSION $COMMIT RUN go build -a -ldflags "-s -w -extldflags -static -X \"main.VERSION=${VERSION}\" -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd RUN chmod a+x statping && mv statping /go/bin/statping # /go/bin/statping - statping binary From 7bf295acf9ab17c5c81dd07781c3d09f311a0e8e Mon Sep 17 00:00:00 2001 From: Willy Date: Thu, 2 Feb 2023 20:19:20 +0100 Subject: [PATCH 59/90] I may be stupid --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25d84cfc..331d3924 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -462,7 +462,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} push_strategy: artifact platforms: linux/amd64 - args: + args: | COMMIT=${{ github.sha }} VERSION=${{ needs.data.outputs.version }} From fa7ec5f009bafe1cd4723646ef9b11571c3c4025 Mon Sep 17 00:00:00 2001 From: Willy Date: Thu, 2 Feb 2023 20:40:17 +0100 Subject: [PATCH 60/90] revert temporary changes --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a490fb4c..0506d67b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,8 +34,7 @@ COPY . . COPY --from=frontend /statping/dist/ ./source/dist/ RUN go install github.com/GeertJohan/go.rice/rice@latest RUN cd source && rice embed-go -RUN echo $VERSION $COMMIT -RUN go build -a -ldflags "-s -w -extldflags -static -X \"main.VERSION=${VERSION}\" -X main.COMMIT=${COMMIT}" -o statping --tags "netgo linux" ./cmd +RUN go build -a -ldflags "-s -w -extldflags -static -X main.VERSION=$VERSION -X main.COMMIT=$COMMIT" -o statping --tags "netgo linux" ./cmd RUN chmod a+x statping && mv statping /go/bin/statping # /go/bin/statping - statping binary # /root/sassc/bin/sassc - sass binary From 8c05bfae8e1158ecb12c1ba582c106852b4bb056 Mon Sep 17 00:00:00 2001 From: Willy Date: Thu, 2 Feb 2023 20:41:55 +0100 Subject: [PATCH 61/90] add a todo note --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0506d67b..46881acf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,9 @@ RUN yarn build && yarn cache clean # Statping Golang BACKEND building from source # Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying +# TODO something here breaks caching / forces a rebuild each time. fix +# * probably the COPY . . +# * also, the sass git clone isn't reproducible, we should version-pin that FROM golang:1.19-alpine AS backend LABEL maintainer="Statping-NG (https://github.com/statping-ng)" ARG VERSION From dcfbc23ffab14a519b39dcbeb2d9ad05370b694d Mon Sep 17 00:00:00 2001 From: Willy Date: Thu, 2 Feb 2023 22:32:43 +0100 Subject: [PATCH 62/90] remove v from core.version displays this probably means other things like the update checker are broken, I'll have to fix that later --- frontend/src/components/Index/Footer.vue | 2 +- frontend/src/pages/Settings.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Index/Footer.vue b/frontend/src/components/Index/Footer.vue index eff3e58d..c0a7aa3a 100644 --- a/frontend/src/components/Index/Footer.vue +++ b/frontend/src/components/Index/Footer.vue @@ -7,7 +7,7 @@ - Statping v{{core.version}} made with + Statping {{core.version}} made with diff --git a/frontend/src/pages/Settings.vue b/frontend/src/pages/Settings.vue index 77494623..8bf097e3 100644 --- a/frontend/src/pages/Settings.vue +++ b/frontend/src/pages/Settings.vue @@ -68,7 +68,7 @@ {{$t('repo')}} - Statping-ng v{{core.version}}
+ Statping-ng {{core.version}}
{{core.commit.slice(0,8)}}
From f2d025b9ed7db03a282b661c8fb62c7a561254f7 Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 3 Feb 2023 19:17:48 +0100 Subject: [PATCH 63/90] remove aws related steps we're not gonna be using any of them in the near future --- .github/workflows/build.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 331d3924..f52855be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -74,23 +74,6 @@ jobs: name: static-rice-box path: ./source - - name: Configure AWS credentials for Asset uploads - # temporarily disabled - if: "false" - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-2 - - - name: Upload Static Assets to S3 - # temporarily disabled - if: "false" - run: | - tar -czvf source.tar.gz source/ - aws s3 cp source.tar.gz s3://assets.statping.com/commit/${{ github.sha }}/ - rm -rf source.tar.gz - build: needs: [ data, frontend ] runs-on: ubuntu-latest @@ -118,15 +101,6 @@ jobs: name: static-rice-box path: ./source - - name: Configure AWS credentials for Asset uploads - # temporarily disabled - if: "false" - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-2 - - name: Set Linux Build Flags if: matrix.platform == 'linux' run: | @@ -201,12 +175,6 @@ jobs: name: statping-${{ matrix.platform }}-${{ matrix.arch }} path: ./build - - name: Upload Compiled Binaries to S3 - # temporarily disabled - if: "false" - run: | - aws s3 cp build/${{ env.compressed }} s3://assets.statping.com/commit/${{ github.sha }}/ - # TODO refactor (and fix) tests test: From 51ec1b16a2e84302cee8caf583e98ec5057fbcac Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 3 Feb 2023 19:25:27 +0100 Subject: [PATCH 64/90] set is_prerelease on release builds --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f52855be..14267001 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,11 @@ jobs: TAG=$(git describe --tags) if [ "${{ github.ref }}" = "refs/heads/$TAG" ]; then echo "is_release=true" >> $GITHUB_OUTPUT + if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]$ ]]; then + echo "is_prerelease=false" >> $GITHUB_OUTPUT + else + echo "is_prerelease=true" >> $GITHUB_OUTPUT + fi else echo "is_release=false" >> $GITHUB_OUTPUT fi From 8858a3efcdee96f2808d3ed9a53f62c5db5e35a7 Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 3 Feb 2023 19:35:29 +0100 Subject: [PATCH 65/90] create release on release (tm) --- .github/workflows/build.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14267001..20ac42b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -177,7 +177,7 @@ jobs: - name: Upload Compiled Statping Binary uses: actions/upload-artifact@v1 with: - name: statping-${{ matrix.platform }}-${{ matrix.arch }} + name: binaries path: ./build # TODO refactor (and fix) tests @@ -446,10 +446,23 @@ jobs: if: ${{ success() && needs.data.outputs.is_release == 'true' }} needs: [ data, build, test-postman-sqlite, test-postman-mysql, test-postman-postgres, docker-build ] runs-on: ubuntu-latest + permissions: + contents: write steps: - - name: dummy operation - run: | - : + - uses: actions/download-artifact@v3 + with: + name: binaries + path: binaries + - uses: actions/create-release@v1 + with: + allowUpdates: true + artifactErrorsFailBuild: true + artifacts: binaries/* + draft: true + generateReleaseNotes: true + omitBodyDuringUpdate: true + prerelease: ${{ needs.data.outputs.is_prerelease == 'true' && 'true' || ''}} + updateOnlyUnreleased: true - # TODO push docker image(s) and release artifacts + # TODO push docker image(s) # TODO bring back dockerhub image From e5b8c01e6d73cc5fc132225095db46c3fdb786e3 Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 3 Feb 2023 19:36:07 +0100 Subject: [PATCH 66/90] include is_prerelease in debug print --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20ac42b8..92edca68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,7 @@ jobs: fi else echo "is_release=false" >> $GITHUB_OUTPUT + echo "is_prerelease=true" >> $GITHUB_OUTPUT fi # this will be v1.2.3 for on-tag builds and v1.2.3-numberofcommits-sha for off-tag builds echo "version=$TAG" >> $GITHUB_OUTPUT @@ -45,6 +46,7 @@ jobs: run: | echo == version summary == echo is_release: ${{ steps.versions.outputs.is_release }} + echo is_prerelease: ${{ steps.versions.outputs.is_prerelease }} echo version: ${{ steps.versions.outputs.version }} frontend: runs-on: ubuntu-latest From a900a95b5aed1c8404a2e7e3fac3db294b61cb60 Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 3 Feb 2023 19:37:29 +0100 Subject: [PATCH 67/90] copy pasting is hard I guess --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92edca68..fd80e1f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: fi else echo "is_release=false" >> $GITHUB_OUTPUT - echo "is_prerelease=true" >> $GITHUB_OUTPUT + echo "is_prerelease=false" >> $GITHUB_OUTPUT fi # this will be v1.2.3 for on-tag builds and v1.2.3-numberofcommits-sha for off-tag builds echo "version=$TAG" >> $GITHUB_OUTPUT From c9a9d1f1196194014b3ecd33a341c0f98df922c4 Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 3 Feb 2023 20:00:38 +0100 Subject: [PATCH 68/90] fix release detection --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd80e1f3..0a2bcfba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: id: versions run: | TAG=$(git describe --tags) - if [ "${{ github.ref }}" = "refs/heads/$TAG" ]; then + if [ "${{ github.ref }}" = "refs/tags/$TAG" ]; then echo "is_release=true" >> $GITHUB_OUTPUT if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]$ ]]; then echo "is_prerelease=false" >> $GITHUB_OUTPUT From b46ce4a14be9c0a3877c249e5b5ece4098dd65c2 Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 3 Feb 2023 20:11:58 +0100 Subject: [PATCH 69/90] pass VERSION based on latest stable tag if we're not on a tag --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a2bcfba..f3b1f1d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,7 @@ jobs: else echo "is_release=false" >> $GITHUB_OUTPUT echo "is_prerelease=false" >> $GITHUB_OUTPUT + TAG=$(git describe --tags --exclude '*-*') fi # this will be v1.2.3 for on-tag builds and v1.2.3-numberofcommits-sha for off-tag builds echo "version=$TAG" >> $GITHUB_OUTPUT From 09ffab40558d758e2e55b564f6a861e45f8e0561 Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 3 Feb 2023 20:31:47 +0100 Subject: [PATCH 70/90] improve docker cachability --- .github/workflows/build.yml | 1 + Dockerfile | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3b1f1d1..354ebc19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -441,6 +441,7 @@ jobs: args: | COMMIT=${{ github.sha }} VERSION=${{ needs.data.outputs.version }} + BUILDKIT_INLINE_CACHE=true # all other release jobs should be based on this release: diff --git a/Dockerfile b/Dockerfile index 46881acf..9453abe1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,9 +10,6 @@ RUN yarn build && yarn cache clean # Statping Golang BACKEND building from source # Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying -# TODO something here breaks caching / forces a rebuild each time. fix -# * probably the COPY . . -# * also, the sass git clone isn't reproducible, we should version-pin that FROM golang:1.19-alpine AS backend LABEL maintainer="Statping-NG (https://github.com/statping-ng)" ARG VERSION @@ -24,7 +21,7 @@ RUN apk add --update --no-cache libstdc++ gcc g++ make git autoconf \ update-ca-certificates WORKDIR /root -RUN git clone https://github.com/sass/sassc.git +RUN git clone --depth 1 --branch 3.6.2 https://github.com/sass/sassc.git RUN . sassc/script/bootstrap && make -C sassc -j4 # sassc binary: /root/sassc/bin/sassc @@ -33,7 +30,12 @@ ADD go.mod go.sum ./ RUN go mod download ENV GO111MODULE on ENV CGO_ENABLED 1 -COPY . . +COPY cmd ./cmd +COPY database ./database +COPY handlers ./handlers +COPY source ./source +COPY types ./types +COPY utils ./utils COPY --from=frontend /statping/dist/ ./source/dist/ RUN go install github.com/GeertJohan/go.rice/rice@latest RUN cd source && rice embed-go From 3e645ce8a19405e078614267064b356ef396821a Mon Sep 17 00:00:00 2001 From: Willy Date: Fri, 3 Feb 2023 20:38:46 +0100 Subject: [PATCH 71/90] I forgor a folder --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 9453abe1..120d2066 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,7 @@ ENV CGO_ENABLED 1 COPY cmd ./cmd COPY database ./database COPY handlers ./handlers +COPY notifiers ./notifiers COPY source ./source COPY types ./types COPY utils ./utils From 075c6952a75eb110d24dfbe98e882f052f005417 Mon Sep 17 00:00:00 2001 From: Willy Date: Sat, 18 Feb 2023 22:39:37 +0100 Subject: [PATCH 72/90] re-enable tag trigger --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 354ebc19..eb7c1901 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,10 +3,9 @@ on: push: paths-ignore: - "**.md" -# TODO turn PR trigger back on -# pull_request: -# paths-ignore: -# - "**.md" + pull_request: + paths-ignore: + - "**.md" jobs: data: From 4d73731110e24c578b8289ab67b8bd5630d2ed66 Mon Sep 17 00:00:00 2001 From: Willy Date: Sat, 18 Feb 2023 23:01:26 +0100 Subject: [PATCH 73/90] use correct release action I don't know how I messed this up, but github's official create-release action is unmaintained. 3rd party it is --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb7c1901..35010509 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -456,7 +456,7 @@ jobs: with: name: binaries path: binaries - - uses: actions/create-release@v1 + - uses: ncipollo/release-action@v1 with: allowUpdates: true artifactErrorsFailBuild: true From 045bcefe1eeb49e9eae629ead007a7b994e6f6f5 Mon Sep 17 00:00:00 2001 From: Willy Date: Sat, 18 Feb 2023 23:35:01 +0100 Subject: [PATCH 74/90] create basic docs about the new workflow --- dev/maintainer-docs.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 dev/maintainer-docs.md diff --git a/dev/maintainer-docs.md b/dev/maintainer-docs.md new file mode 100644 index 00000000..6ae54f1e --- /dev/null +++ b/dev/maintainer-docs.md @@ -0,0 +1,42 @@ +# Statping-ng maintainer documentation +This document will briefly outline our workflows and give instructions on some common tasks. + +Feel free to expand this; at the moment it's pretty empty here. + + +## GitHub actions +Binaries and docker images get built automatically by GitHub actions. +If the builds succeed, tests are run to ensure nothing is completely broken. +Build artifacts can be downloaded from the actions tab on GitHub. + +This happens on every push to this repo and on every pull request update. + + +## Releases +We used to have a model of "stable" and "unstable" releases, which would get triggered by pushing to a respective release branch. +The new system tries to address some of the issues with the old system and simplifies the workflow definitions. + +Incoming pull requests are merged into the `main` (default) branch. +Once you feel like we have enough new changes to justify a release, a tag can be created. +This is **not** a GitHub release and sadly can't be done from github.com directly. +Either +* create a stable release ready for general usage as `v{major}.{minor}.{patch}`, e.g. `v1.2.3` +* or create a beta release intended for testing as `v{major}.{minor}.{patch}-{suffix}`, e.g. `v1.2.3-rc0` + * personal note: I don't know what a good format for suffixes is. I'm not even sure if we _need_ beta releases long term. We'll see; I'm open to suggestions + +To create a tag from your local workspace, run +```bash +git checkout main +git pull +git tag v1.2.3 +git push origin v1.2.3 +``` +You can also create tags on different branches (e.g. for backports). +Remember to check out the revision you want to tag _before_ tagging. +Do not move existing (pushed) tags! + +When a new tag is pushed, the same build+test actions described above run, but additionally the built docker images are pushed and a draft release on GitHub is created. +All artifacts will get attached to that release. + +The release will be in draft mode to allow last minute changes if necessary. +Untick the draft checkbox if everything looks alright. From 20c496a89c5bdb16375304dd04e4710fe63b66ca Mon Sep 17 00:00:00 2001 From: Willy Date: Sat, 18 Feb 2023 23:40:11 +0100 Subject: [PATCH 75/90] docker push on release --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35010509..a79a9587 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -456,6 +456,10 @@ jobs: with: name: binaries path: binaries + - uses: actions/download-artifact@v3 + with: + name: docker-images + path: images - uses: ncipollo/release-action@v1 with: allowUpdates: true @@ -466,6 +470,9 @@ jobs: omitBodyDuringUpdate: true prerelease: ${{ needs.data.outputs.is_prerelease == 'true' && 'true' || ''}} updateOnlyUnreleased: true - - # TODO push docker image(s) + - name: import images + run: for file in images/*.tar; do docker load < $file; done + - run: docker image ls + - name: push all images + run: for image in $(cat images/docker-images.txt); do echo pushing $image; docker push $image; done # TODO bring back dockerhub image From 3ec91d81f003682caf8f07baf199836a1966eb48 Mon Sep 17 00:00:00 2001 From: Willy Date: Sat, 18 Feb 2023 23:48:33 +0100 Subject: [PATCH 76/90] login to ghcr --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a79a9587..80043d4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -460,6 +460,12 @@ jobs: with: name: docker-images path: images + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} - uses: ncipollo/release-action@v1 with: allowUpdates: true From d673e4e22e852f3e684b4b203ec48785c5a1a2e3 Mon Sep 17 00:00:00 2001 From: Willy Date: Sat, 18 Feb 2023 23:49:39 +0100 Subject: [PATCH 77/90] use fromJSON for comparing to 'true' --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 80043d4c..4cae4ece 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -445,8 +445,7 @@ jobs: # all other release jobs should be based on this release: # only run release jobs on push to stable/unstable. - # yes, we need to explicitly compare to 'true' here since it's a string - if: ${{ success() && needs.data.outputs.is_release == 'true' }} + if: ${{ success() && fromJSON(needs.data.outputs.is_release) }} needs: [ data, build, test-postman-sqlite, test-postman-mysql, test-postman-postgres, docker-build ] runs-on: ubuntu-latest permissions: @@ -474,7 +473,7 @@ jobs: draft: true generateReleaseNotes: true omitBodyDuringUpdate: true - prerelease: ${{ needs.data.outputs.is_prerelease == 'true' && 'true' || ''}} + prerelease: ${{ fromJSON(needs.data.outputs.is_prerelease) && 'true' || 'false'}} updateOnlyUnreleased: true - name: import images run: for file in images/*.tar; do docker load < $file; done From e4236521f0b7a9db05b60b361f5468bbc94ccf92 Mon Sep 17 00:00:00 2001 From: Willy Date: Sun, 19 Feb 2023 00:00:36 +0100 Subject: [PATCH 78/90] fix is_prerelease --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4cae4ece..81c75fc1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,7 @@ jobs: runs-on: ubuntu-latest outputs: is_release: ${{ steps.versions.outputs.is_release }} + is_prerelease: ${{ steps.versions.outputs.is_prerelease }} version: ${{ steps.versions.outputs.version }} go_version: 1.18.x node_version: 16.14.0 @@ -29,7 +30,7 @@ jobs: TAG=$(git describe --tags) if [ "${{ github.ref }}" = "refs/tags/$TAG" ]; then echo "is_release=true" >> $GITHUB_OUTPUT - if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]$ ]]; then + if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "is_prerelease=false" >> $GITHUB_OUTPUT else echo "is_prerelease=true" >> $GITHUB_OUTPUT From 31c3623bc1eab5a163dd54016cee3eede1a69424 Mon Sep 17 00:00:00 2001 From: Willy Date: Sun, 19 Feb 2023 00:18:53 +0100 Subject: [PATCH 79/90] update docker login action to v2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81c75fc1..717de707 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -461,7 +461,7 @@ jobs: name: docker-images path: images - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.repository_owner }} From b8aacacf5a13be2a6453544d49095c31a2665d21 Mon Sep 17 00:00:00 2001 From: Willy Date: Sun, 19 Feb 2023 00:34:52 +0100 Subject: [PATCH 80/90] remove permissions key, fallback to default (more permissive) perms --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 717de707..5c18f77f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -449,8 +449,6 @@ jobs: if: ${{ success() && fromJSON(needs.data.outputs.is_release) }} needs: [ data, build, test-postman-sqlite, test-postman-mysql, test-postman-postgres, docker-build ] runs-on: ubuntu-latest - permissions: - contents: write steps: - uses: actions/download-artifact@v3 with: From 57a12cfbc9457f63192e4190f01d9f983acaf87c Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 19 Apr 2023 20:34:03 +0200 Subject: [PATCH 81/90] rework version detection --- .github/workflows/build.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c18f77f..5da236d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,7 @@ jobs: outputs: is_release: ${{ steps.versions.outputs.is_release }} is_prerelease: ${{ steps.versions.outputs.is_prerelease }} + # this will be v1.2.3 for on-tag builds and v1.2.3-numberofcommits-sha for off-tag builds version: ${{ steps.versions.outputs.version }} go_version: 1.18.x node_version: 16.14.0 @@ -27,21 +28,21 @@ jobs: - name: get version information id: versions run: | + STABLE_TAG=$(git describe --tags --exclude '*-*') TAG=$(git describe --tags) - if [ "${{ github.ref }}" = "refs/tags/$TAG" ]; then + if [ "${{ github.ref }}" = "refs/tags/$STABLE_TAG" ]; then echo "is_release=true" >> $GITHUB_OUTPUT - if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "is_prerelease=false" >> $GITHUB_OUTPUT - else - echo "is_prerelease=true" >> $GITHUB_OUTPUT - fi + echo "is_prerelease=false" >> $GITHUB_OUTPUT + echo "version=$STABLE_TAG" >> $GITHUB_OUTPUT + elif [ "${{ github.ref }}" = "refs/tags/$TAG" ]; then + echo "is_release=true" >> $GITHUB_OUTPUT + echo "is_prerelease=true" >> $GITHUB_OUTPUT + echo "version=$TAG" >> $GITHUB_OUTPUT else echo "is_release=false" >> $GITHUB_OUTPUT echo "is_prerelease=false" >> $GITHUB_OUTPUT - TAG=$(git describe --tags --exclude '*-*') + echo "version=$STABLE_TAG" >> $GITHUB_OUTPUT fi - # this will be v1.2.3 for on-tag builds and v1.2.3-numberofcommits-sha for off-tag builds - echo "version=$TAG" >> $GITHUB_OUTPUT shell: bash - name: show data results run: | From 80dd51776810c87dab0fdf3e152b55dddcc2f94c Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 19 Apr 2023 20:37:36 +0200 Subject: [PATCH 82/90] epxlicitly search for prereleases (containing `-`) --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5da236d1..5ed7b125 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,15 +29,15 @@ jobs: id: versions run: | STABLE_TAG=$(git describe --tags --exclude '*-*') - TAG=$(git describe --tags) + BETA_TAG=$(git describe --tags --match '*-*') if [ "${{ github.ref }}" = "refs/tags/$STABLE_TAG" ]; then echo "is_release=true" >> $GITHUB_OUTPUT echo "is_prerelease=false" >> $GITHUB_OUTPUT echo "version=$STABLE_TAG" >> $GITHUB_OUTPUT - elif [ "${{ github.ref }}" = "refs/tags/$TAG" ]; then + elif [ "${{ github.ref }}" = "refs/tags/BETA_TAG" ]; then echo "is_release=true" >> $GITHUB_OUTPUT echo "is_prerelease=true" >> $GITHUB_OUTPUT - echo "version=$TAG" >> $GITHUB_OUTPUT + echo "version=BETA_TAG" >> $GITHUB_OUTPUT else echo "is_release=false" >> $GITHUB_OUTPUT echo "is_prerelease=false" >> $GITHUB_OUTPUT From cee9f7954b1e4be6df97b0403e02ae7411623677 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 19 Apr 2023 20:41:54 +0200 Subject: [PATCH 83/90] more debug output --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ed7b125..02dd671c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,8 @@ jobs: run: | STABLE_TAG=$(git describe --tags --exclude '*-*') BETA_TAG=$(git describe --tags --match '*-*') + echo "stable_tag=$STABLE_TAG" >> $GITHUB_OUTPUT + echo "beta_tag=$BETA_TAG" >> $GITHUB_OUTPUT if [ "${{ github.ref }}" = "refs/tags/$STABLE_TAG" ]; then echo "is_release=true" >> $GITHUB_OUTPUT echo "is_prerelease=false" >> $GITHUB_OUTPUT @@ -37,7 +39,7 @@ jobs: elif [ "${{ github.ref }}" = "refs/tags/BETA_TAG" ]; then echo "is_release=true" >> $GITHUB_OUTPUT echo "is_prerelease=true" >> $GITHUB_OUTPUT - echo "version=BETA_TAG" >> $GITHUB_OUTPUT + echo "version=$BETA_TAG" >> $GITHUB_OUTPUT else echo "is_release=false" >> $GITHUB_OUTPUT echo "is_prerelease=false" >> $GITHUB_OUTPUT @@ -47,6 +49,8 @@ jobs: - name: show data results run: | echo == version summary == + echo stable_tag: ${{ steps.versions.outputs.stable_tag }} + echo beta_tag: ${{ steps.versions.outputs.beta_tag }} echo is_release: ${{ steps.versions.outputs.is_release }} echo is_prerelease: ${{ steps.versions.outputs.is_prerelease }} echo version: ${{ steps.versions.outputs.version }} From 21a0ae2c4f657c13378d358bf2e03be1fe94f616 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 19 Apr 2023 20:42:55 +0200 Subject: [PATCH 84/90] fix typo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02dd671c..11aa75ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: echo "is_release=true" >> $GITHUB_OUTPUT echo "is_prerelease=false" >> $GITHUB_OUTPUT echo "version=$STABLE_TAG" >> $GITHUB_OUTPUT - elif [ "${{ github.ref }}" = "refs/tags/BETA_TAG" ]; then + elif [ "${{ github.ref }}" = "refs/tags/$BETA_TAG" ]; then echo "is_release=true" >> $GITHUB_OUTPUT echo "is_prerelease=true" >> $GITHUB_OUTPUT echo "version=$BETA_TAG" >> $GITHUB_OUTPUT From 5742367ee3f367df076fc5bb1b7d7c026cba86df Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 19 Apr 2023 20:53:09 +0200 Subject: [PATCH 85/90] even more version info output in data stage --- .github/workflows/build.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11aa75ea..8bfbbd00 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,19 +14,19 @@ jobs: # also, the name is intentionally short to make later references shorter. runs-on: ubuntu-latest outputs: - is_release: ${{ steps.versions.outputs.is_release }} - is_prerelease: ${{ steps.versions.outputs.is_prerelease }} + is_release: ${{ steps.statping-versions.outputs.is_release }} + is_prerelease: ${{ steps.statping-versions.outputs.is_prerelease }} # this will be v1.2.3 for on-tag builds and v1.2.3-numberofcommits-sha for off-tag builds - version: ${{ steps.versions.outputs.version }} - go_version: 1.18.x - node_version: 16.14.0 + version: ${{ steps.statping-versions.outputs.version }} + go_version: ${{ steps.tool-versions.outputs.go_version }} + node_version: ${{ steps.tool-versions.outputs.node_version }} steps: - uses: actions/checkout@v3 with: # check on https://github.com/actions/checkout/pull/579 occasionally if actions/checkout can do this natively yet fetch-depth: 0 - - name: get version information - id: versions + - name: get statping version information + id: statping-versions run: | STABLE_TAG=$(git describe --tags --exclude '*-*') BETA_TAG=$(git describe --tags --match '*-*') @@ -46,13 +46,24 @@ jobs: echo "version=$STABLE_TAG" >> $GITHUB_OUTPUT fi shell: bash + - name: get statping version information + id: statping-versions + run: | + echo "go_version=1.18.x" >> $GITHUB_OUTPUT + echo "node_version=16.14.0" >> $GITHUB_OUTPUT + shell: bash - name: show data results run: | - echo == version summary == + echo == tools versions == + echo go_version: ${{ steps.tool-versions.outputs.go_version }} + echo node_version: ${{ steps.tool-versions.outputs.node_version }} + echo == matched tags == echo stable_tag: ${{ steps.versions.outputs.stable_tag }} echo beta_tag: ${{ steps.versions.outputs.beta_tag }} + echo == release information == echo is_release: ${{ steps.versions.outputs.is_release }} echo is_prerelease: ${{ steps.versions.outputs.is_prerelease }} + echo == statping version == echo version: ${{ steps.versions.outputs.version }} frontend: runs-on: ubuntu-latest From 48ee62d8a803b17fdf52f65cfee59eb50148798e Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 19 Apr 2023 20:55:35 +0200 Subject: [PATCH 86/90] bump go version to 1.20 --- .github/workflows/build.yml | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8bfbbd00..9f66353f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: - name: get statping version information id: statping-versions run: | - echo "go_version=1.18.x" >> $GITHUB_OUTPUT + echo "go_version=1.20.x" >> $GITHUB_OUTPUT echo "node_version=16.14.0" >> $GITHUB_OUTPUT shell: bash - name: show data results diff --git a/Dockerfile b/Dockerfile index 120d2066..4d79b78d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN yarn build && yarn cache clean # Statping Golang BACKEND building from source # Creates "/go/bin/statping" and "/usr/local/bin/sass" for copying -FROM golang:1.19-alpine AS backend +FROM golang:1.20-alpine AS backend LABEL maintainer="Statping-NG (https://github.com/statping-ng)" ARG VERSION ARG COMMIT From b0d4ccbb5800b298981a02c55ae4ae0ad75721d3 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 19 Apr 2023 20:56:12 +0200 Subject: [PATCH 87/90] fix copy-paste typo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f66353f..20136825 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: fi shell: bash - name: get statping version information - id: statping-versions + id: tool-versions run: | echo "go_version=1.20.x" >> $GITHUB_OUTPUT echo "node_version=16.14.0" >> $GITHUB_OUTPUT From f166db840a249def6fc582f080ac77037db2a154 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 19 Apr 2023 20:57:00 +0200 Subject: [PATCH 88/90] fix copy-paste typo v2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20136825..fb8cd111 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: echo "version=$STABLE_TAG" >> $GITHUB_OUTPUT fi shell: bash - - name: get statping version information + - name: get go/node version information id: tool-versions run: | echo "go_version=1.20.x" >> $GITHUB_OUTPUT From 1be3a39a4cf026378db11fdf19c07fd226c102ff Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 19 Apr 2023 22:51:22 +0200 Subject: [PATCH 89/90] remove additional "v" from version during startup --- cmd/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/main.go b/cmd/main.go index efce0b88..57294527 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -83,7 +83,7 @@ func start() { log.Errorf("Statping Log Error: %v\n", err) } - log.Info(fmt.Sprintf("Starting Statping v%s", VERSION)) + log.Info(fmt.Sprintf("Starting Statping %s", VERSION)) utils.Params.Set("SERVER_IP", ipAddress) utils.Params.Set("SERVER_PORT", port) From b1edc0269789307b4d599cbf008f9523aa420048 Mon Sep 17 00:00:00 2001 From: Willy Date: Wed, 19 Apr 2023 23:05:23 +0200 Subject: [PATCH 90/90] remove old workflows, replaced by almighty build.yaml --- .github/workflows/1_dev.yml | 418 ----------------------- .github/workflows/2_unstable.yml | 501 --------------------------- .github/workflows/3_stable.yml | 557 ------------------------------- .github/workflows/pr.yml | 173 ---------- 4 files changed, 1649 deletions(-) delete mode 100644 .github/workflows/1_dev.yml delete mode 100644 .github/workflows/2_unstable.yml delete mode 100644 .github/workflows/3_stable.yml delete mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/1_dev.yml b/.github/workflows/1_dev.yml deleted file mode 100644 index 7b00d255..00000000 --- a/.github/workflows/1_dev.yml +++ /dev/null @@ -1,418 +0,0 @@ -name: 1. Development Build and Testing -on: - push: - branches: - - dev - paths-ignore: - - '**.md' - -jobs: - - frontend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - uses: actions/setup-node@v1 - with: - node-version: 16.14.0 - - - name: Set Version - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Install Global Dependencies - run: npm install -g yarn sass cross-env mjml - - - name: Download Frontend Dependencies - working-directory: ./frontend - run: yarn - - - name: Download Go mods - run: | - go mod download - go mod verify - make test-deps - - - name: Build Frontend Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - MJML_APP: ${{ secrets.MJML_APP }} - MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: make clean generate compile - - - name: Upload Compiled Frontend (rice-box.go) - uses: actions/upload-artifact@v1 - with: - name: static-rice-box - path: ./source - - build: - needs: frontend - runs-on: ubuntu-latest - strategy: - matrix: - platform: [linux] - arch: [386, amd64, arm-7, arm-6, arm64] - include: - - platform: darwin - arch: arm64 - - platform: darwin - arch: amd64 - - platform: windows - arch: 386 - - platform: windows - arch: amd64 - - steps: - - uses: actions/checkout@v2 - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Add GOBIN to PATH - run: | - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Set Linux Build Flags - if: matrix.platform == 'linux' - run: | - echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV - echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV - shell: bash - - - name: Set MacOS (Darwin) Build Flags - if: matrix.platform == 'darwin' - run : | - echo "XGO_TAGS=netgo osusergo darwin sqlite_omit_load_extension" >> $GITHUB_ENV - shell: bash - - - name: Set Windows Build Flags - if: matrix.platform == 'windows' - run: | - echo "BUILD_FLAGS=-extldflags -static -buildmode=exe" >> $GITHUB_ENV - echo "XGO_TAGS=netgo osusergo sqlite_omit_load_extension" >> $GITHUB_ENV - shell: bash - - - name: Build ${{ matrix.platform }}/${{ matrix.arch }} - uses: crazy-max/ghaction-xgo@v1 - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - with: - xgo_version: latest - go_version: 1.17.x - dest: build - prefix: statping - targets: ${{ matrix.platform }}/${{ matrix.arch }} - v: true - x: true - pkg: cmd - buildmode: pie - tags: ${{ env.XGO_TAGS }} - ldflags: -s -w -X main.VERSION=${{ env.VERSION }} -X main.COMMIT=${{ env.COMMIT }} ${{ env.BUILD_FLAGS }} - - - name: Compress Linux Builds - if: matrix.platform == 'linux' - run: | - cd build - mv statping-linux-${{ matrix.arch }} statping - chmod +x statping - tar -czvf statping-linux-${{ matrix.arch }}.tar.gz statping - rm -rf statping - echo "compressed=statping-linux-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - - - name: Compress Windows Builds - if: matrix.platform == 'windows' - run: | - cd build - mv statping-windows-${{ matrix.arch }}.exe statping.exe - chmod +x statping.exe - zip statping-windows-${{ matrix.arch }}.zip statping.exe - rm -rf statping.exe - echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV - - - name: Compress MacOS (Darwin) Builds - if: matrix.platform == 'darwin' - run: | - cd build - mv statping-darwin-${{ matrix.arch }} statping - chmod +x statping - tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz * - rm -rf statping - echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - - - name: Upload Compiled Statping Binary - uses: actions/upload-artifact@v1 - with: - name: statping-${{ matrix.platform }}-${{ matrix.arch }} - path: ./build - - test: - needs: frontend - runs-on: ubuntu-latest - services: - postgres: - image: postgres:10.8 - env: - POSTGRES_USER: root - POSTGRES_PASSWORD: password123 - POSTGRES_DB: statping - ports: - - 5432:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: password123 - MYSQL_DATABASE: statping - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - uses: actions/setup-node@v1 - with: - node-version: 16.14.0 - - - name: Install Global Dependencies - run: npm install -g yarn sass newman cross-env wait-on @sentry/cli - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - run: | - make build certs - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - - name: Go Tests - run: | - go get gotest.tools/gotestsum - gotestsum --no-summary=skipped --format testname -- -covermode=count -coverprofile=coverage.out -p=1 ./... - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - DB_CONN: sqlite3 - STATPING_DIR: ${{ github.workspace }} - API_SECRET: demopassword123 - DISABLE_LOGS: false - ALLOW_REPORTS: true - SAMPLE_DATA: true - COVERALLS: ${{ secrets.COVERALLS }} - DISCORD_URL: ${{ secrets.DISCORD_URL }} - EMAIL_HOST: ${{ secrets.EMAIL_HOST }} - EMAIL_USER: ${{ secrets.EMAIL_USER }} - EMAIL_PASS: ${{ secrets.EMAIL_PASS }} - EMAIL_OUTGOING: ${{ secrets.EMAIL_OUTGOING }} - EMAIL_SEND_TO: ${{ secrets.EMAIL_SEND_TO }} - EMAIL_PORT: ${{ secrets.EMAIL_PORT }} - MOBILE_ID: ${{ secrets.MOBILE_ID }} - MOBILE_NUMBER: ${{ secrets.MOBILE_NUMBER }} - PUSHOVER_TOKEN: ${{ secrets.PUSHOVER_TOKEN }} - PUSHOVER_API: ${{ secrets.PUSHOVER_API }} - SLACK_URL: https://hooks.slack.com/services/TTJ1B90DP/RENU20O9M/9uI823SUnYBuGcxYlpSimD6H - TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} - TELEGRAM_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL }} - TWILIO_SID: ${{ secrets.TWILIO_SID }} - TWILIO_SECRET: ${{ secrets.TWILIO_SECRET }} - TWILIO_FROM: ${{ secrets.TWILIO_FROM }} - TWILIO_TO: ${{ secrets.TWILIO_TO }} - TEST_EMAIL: ${{ secrets.TEST_EMAIL }} - GOTIFY_URL: ${{ secrets.GOTIFY_URL }} - GOTIFY_TOKEN: ${{ secrets.GOTIFY_TOKEN }} - SNS_TOKEN: ${{ secrets.SNS_TOKEN }} - SNS_SECRET: ${{ secrets.SNS_SECRET }} - SNS_REGION: ${{ secrets.SNS_REGION }} - SNS_TOPIC: ${{ secrets.SNS_TOPIC }} - -# - name: Coveralls Testing Coverage -# run: | -# go get github.com/mattn/goveralls -# goveralls -coverprofile=coverage.out -repotoken $COVERALLS -# env: -# COVERALLS: ${{ secrets.COVERALLS }} - - test-postman-sqlite: - needs: frontend - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - run: | - make build - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - name: Run Statping - run: | - API_SECRET=demosecret123 statping --port=8585 > /dev/null & - sleep 5 - - name: Postman SQLite Tests - uses: matt-ball/newman-action@master - with: - apiKey: ${{ secrets.POSTMAN_API }} - collection: ./dev/postman.json - environment: ./dev/postman_env_sqlite.json - timeoutRequest: 30000 - delayRequest: 600 - - test-postman-mysql: - needs: frontend - runs-on: ubuntu-latest - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: password123 - MYSQL_DATABASE: statping - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - MJML_APP: ${{ secrets.MJML_APP }} - MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} - run: | - make build - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - name: Run Statping - run: | - API_SECRET=demosecret123 statping --port=8585 > /dev/null & - sleep 5 - - name: Postman MySQL Tests - uses: matt-ball/newman-action@master - with: - apiKey: ${{ secrets.POSTMAN_API }} - collection: ./dev/postman.json - environment: ./dev/postman_env_mysql.json - timeoutRequest: 30000 - delayRequest: 600 - - test-postman-postgres: - needs: frontend - runs-on: ubuntu-latest - - services: - postgres: - image: postgres:10.8 - env: - POSTGRES_USER: root - POSTGRES_PASSWORD: password123 - POSTGRES_DB: statping - ports: - - 5432:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - run: | - make build - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - name: Run Statping - run: | - API_SECRET=demosecret123 statping --port=8585 > /dev/null & - sleep 5 - - name: Postman Postgres Tests - uses: matt-ball/newman-action@master - with: - apiKey: ${{ secrets.POSTMAN_API }} - collection: ./dev/postman.json - environment: ./dev/postman_env_postgres.json - timeoutRequest: 30000 - delayRequest: 600 diff --git a/.github/workflows/2_unstable.yml b/.github/workflows/2_unstable.yml deleted file mode 100644 index 7fd72300..00000000 --- a/.github/workflows/2_unstable.yml +++ /dev/null @@ -1,501 +0,0 @@ -name: 2. Unstable Build, Test and Deploy -on: - push: - branches: - - unstable - paths-ignore: - - '**.md' - -jobs: - - frontend: - runs-on: [self-hosted, linux, aboutcher-hosted, rocky8] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - uses: actions/setup-node@v1 - with: - node-version: 16.14.0 - - - name: Set Version - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Install Global Dependencies - run: npm install -g yarn sass cross-env mjml - - - name: Download Frontend Dependencies - working-directory: ./frontend - run: yarn - - - name: Download Go mods - run: | - go mod download - go mod verify - make test-deps - - - name: Build Frontend Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - MJML_APP: ${{ secrets.MJML_APP }} - MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: make clean generate compile - - - name: Upload Compiled Frontend (rice-box.go) - uses: actions/upload-artifact@v1 - with: - name: static-rice-box - path: ./source - - build: - needs: frontend - runs-on: ubuntu-latest - strategy: - matrix: - platform: [linux] - arch: [386, amd64, arm-7, arm-6, arm64] - include: - - platform: darwin - arch: arm64 - - platform: darwin - arch: amd64 - - platform: windows - arch: 386 - - platform: windows - arch: amd64 - - steps: - - uses: actions/checkout@v2 - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Add GOBIN to PATH - run: | - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Set Linux Build Flags - if: matrix.platform == 'linux' - run: | - echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV - echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV - shell: bash - - - name: Set MacOS (Darwin) Build Flags - if: matrix.platform == 'darwin' - run : | - echo "XGO_TAGS=netgo osusergo darwin sqlite_omit_load_extension" >> $GITHUB_ENV - shell: bash - - - name: Set Windows Build Flags - if: matrix.platform == 'windows' - run: | - echo "BUILD_FLAGS=-extldflags -static -buildmode=exe" >> $GITHUB_ENV - echo "XGO_TAGS=netgo osusergo sqlite_omit_load_extension" >> $GITHUB_ENV - shell: bash - - - name: Build ${{ matrix.platform }}/${{ matrix.arch }} - uses: crazy-max/ghaction-xgo@v1 - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - with: - xgo_version: latest - go_version: 1.17.x - dest: build - prefix: statping - targets: ${{ matrix.platform }}/${{ matrix.arch }} - v: true - x: true - pkg: cmd - buildmode: pie - tags: ${{ env.XGO_TAGS }} - ldflags: -s -w -X main.VERSION=${{ env.VERSION }} -X main.COMMIT=${{ env.COMMIT }} ${{ env.BUILD_FLAGS }} - - - name: Compress Linux Builds - if: matrix.platform == 'linux' - run: | - cd build - mv statping-linux-${{ matrix.arch }} statping - chmod +x statping - tar -czvf statping-linux-${{ matrix.arch }}.tar.gz statping - rm -rf statping - echo "compressed=statping-linux-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - - - name: Compress Windows Builds - if: matrix.platform == 'windows' - run: | - cd build - mv statping-windows-${{ matrix.arch }}.exe statping.exe - chmod +x statping.exe - zip statping-windows-${{ matrix.arch }}.zip statping.exe - rm -rf statping.exe - echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV - - - name: Compress MacOS (Darwin) Builds - if: matrix.platform == 'darwin' - run: | - cd build - mv statping-darwin-${{ matrix.arch }} statping - chmod +x statping - tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz * - rm -rf statping - echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - - - name: Upload Compiled Statping Binary - uses: actions/upload-artifact@v1 - with: - name: statping-${{ matrix.platform }}-${{ matrix.arch }} - path: ./build - - - name: Upload Releases - id: upload-assets - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: ${{ env.VERSION }} - with: - tag_name: dev-v${{ env.VERSION }} - draft: true - prerelease: true - files: build/${{ env.compressed }} - -# test: -# needs: frontend -# runs-on: [self-hosted, linux, aboutcher-hosted] -# services: -# postgres: -# image: postgres:10.8 -# env: -# POSTGRES_USER: root -# POSTGRES_PASSWORD: password123 -# POSTGRES_DB: statping -# ports: -# - 5432:5432 -# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - -# mysql: -# image: mysql:5.7 -# env: -# MYSQL_ROOT_PASSWORD: password123 -# MYSQL_DATABASE: statping -# ports: -# - 3306:3306 -# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - -# steps: -# - uses: actions/checkout@v2 -# - uses: actions/setup-go@v2 -# with: -# go-version: 1.17.x -# - uses: actions/setup-node@v1 -# with: -# node-version: 16.14.0 - -# - name: Install Global Dependencies -# run: npm install -g yarn sass newman cross-env wait-on @sentry/cli - -# - name: Setting ENV's -# run: | -# echo "$(go env GOPATH)/bin" >> $GITHUB_PATH -# echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH -# echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV -# shell: bash - -# - name: Download Compiled Frontend (rice-box.go) -# uses: actions/download-artifact@v1 -# with: -# name: static-rice-box -# path: ./source - -# - name: Install Statping -# env: -# VERSION: ${{ env.VERSION }} -# COMMIT: ${{ github.sha }} -# run: | -# make build certs -# chmod +x statping -# mv statping $(go env GOPATH)/bin/ - -# - name: Go Tests -# run: | -# go get gotest.tools/gotestsum -# gotestsum --no-summary=skipped --format testname -- -covermode=count -coverprofile=coverage.out -p=1 ./... -# env: -# VERSION: ${{ env.VERSION }} -# COMMIT: ${{ github.sha }} -# DB_CONN: sqlite3 -# STATPING_DIR: ${{ github.workspace }} -# API_SECRET: demopassword123 -# DISABLE_LOGS: false -# ALLOW_REPORTS: true -# SAMPLE_DATA: true -# COVERALLS: ${{ secrets.COVERALLS }} -# DISCORD_URL: ${{ secrets.DISCORD_URL }} -# EMAIL_HOST: ${{ secrets.EMAIL_HOST }} -# EMAIL_USER: ${{ secrets.EMAIL_USER }} -# EMAIL_PASS: ${{ secrets.EMAIL_PASS }} -# EMAIL_OUTGOING: ${{ secrets.EMAIL_OUTGOING }} -# EMAIL_SEND_TO: ${{ secrets.EMAIL_SEND_TO }} -# EMAIL_PORT: ${{ secrets.EMAIL_PORT }} -# MOBILE_ID: ${{ secrets.MOBILE_ID }} -# MOBILE_NUMBER: ${{ secrets.MOBILE_NUMBER }} -# PUSHOVER_TOKEN: ${{ secrets.PUSHOVER_TOKEN }} -# PUSHOVER_API: ${{ secrets.PUSHOVER_API }} -# SLACK_URL: ${{ secrets.SLACK_URL }} -# TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} -# TELEGRAM_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL }} -# TWILIO_SID: ${{ secrets.TWILIO_SID }} -# TWILIO_SECRET: ${{ secrets.TWILIO_SECRET }} -# TWILIO_FROM: ${{ secrets.TWILIO_FROM }} -# TWILIO_TO: ${{ secrets.TWILIO_TO }} -# TEST_EMAIL: ${{ secrets.TEST_EMAIL }} -# GOTIFY_URL: ${{ secrets.GOTIFY_URL }} -# GOTIFY_TOKEN: ${{ secrets.GOTIFY_TOKEN }} -# SNS_TOKEN: ${{ secrets.SNS_TOKEN }} -# SNS_SECRET: ${{ secrets.SNS_SECRET }} -# SNS_REGION: ${{ secrets.SNS_REGION }} -# SNS_TOPIC: ${{ secrets.SNS_TOPIC }} - -# - name: Coveralls Testing Coverage -# run: | -# go get github.com/mattn/goveralls -# goveralls -coverprofile=coverage.out -repotoken $COVERALLS -# env: -# COVERALLS: ${{ secrets.COVERALLS }} - - test-postman-sqlite: - needs: frontend - runs-on: [self-hosted, linux, aboutcher-hosted, centos7] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - run: | - make build - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - name: Run Statping - run: | - API_SECRET=demosecret123 statping --port=8585 > /dev/null & - sleep 5 - - name: Postman SQLite Tests - uses: matt-ball/newman-action@master - with: - apiKey: ${{ secrets.POSTMAN_API }} - collection: ./dev/postman.json - environment: ./dev/postman_env_sqlite.json - timeoutRequest: 30000 - delayRequest: 600 - - test-postman-mysql: - needs: frontend - runs-on: ubuntu-latest - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: password123 - MYSQL_DATABASE: statping - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - MJML_APP: ${{ secrets.MJML_APP }} - MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} - run: | - make build - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - name: Run Statping - run: | - API_SECRET=demosecret123 statping --port=8585 > /dev/null & - sleep 5 - - name: Postman MySQL Tests - uses: matt-ball/newman-action@master - with: - apiKey: ${{ secrets.POSTMAN_API }} - collection: ./dev/postman.json - environment: ./dev/postman_env_mysql.json - timeoutRequest: 30000 - delayRequest: 600 - - test-postman-postgres: - needs: frontend - runs-on: ubuntu-latest - - services: - postgres: - image: postgres:10.8 - env: - POSTGRES_USER: root - POSTGRES_PASSWORD: password123 - POSTGRES_DB: statping - ports: - - 5432:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - run: | - make build - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - name: Run Statping - run: | - API_SECRET=demosecret123 statping --port=8585 > /dev/null & - sleep 5 - - name: Postman Postgres Tests - uses: matt-ball/newman-action@master - with: - apiKey: ${{ secrets.POSTMAN_API }} - collection: ./dev/postman.json - environment: ./dev/postman_env_postgres.json - timeoutRequest: 30000 - delayRequest: 600 - - docker-release: - needs: [build, test-postman-sqlite, test-postman-mysql, test-postman-postgres] - runs-on: [self-hosted, linux, aboutcher-hosted, rocky8] - - steps: - - name: Checkout Statping Repo - uses: actions/checkout@v2 - - - name: Setting ENV's - run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - id: buildx - with: - install: true - - - name: Cache Docker layers - uses: actions/cache@v2 - id: buildx-docker-master - with: - path: /tmp/.buildx-cache - key: buildx-docker-master - restore-keys: | - buildx-docker-master - -# - name: Docker Login -# env: -# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} -# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} -# run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin# - -# - name: Docker Build :base -# run: make buildx-base - - - name: Docker Login - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin - - - name: Docker Build :dev - run: make buildx-dev - - -# sentry-release: -# needs: [test, test-postman-sqlite, test-postman-postgres, test-postman-mysql] -# runs-on: [self-hosted, linux, aboutcher-hosted] -# steps: -# - name: Checkout Statping Repo -# uses: actions/checkout@v2 -# -# - name: Setup Sentry CLI -# uses: mathrix-education/setup-sentry-cli@master -# with: -# version: latest -# url: ${{ secrets.SENTRY_URL }} -# token: ${{ secrets.SENTRY_AUTH_TOKEN }} -# organization: statping -# -# - name: Setting ENV's -# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV -# shell: bash -# -# - name: Sentry Release -# run: make sentry-release diff --git a/.github/workflows/3_stable.yml b/.github/workflows/3_stable.yml deleted file mode 100644 index c92e0963..00000000 --- a/.github/workflows/3_stable.yml +++ /dev/null @@ -1,557 +0,0 @@ -name: 3. Stable Build, Test and Deploy -on: - push: - branches: - - stable - paths-ignore: - - '**.md' - -jobs: - - frontend: - runs-on: [self-hosted, linux, aboutcher-hosted, rocky8] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - uses: actions/setup-node@v1 - with: - node-version: 16.14.0 - - - name: Set Version - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Install Global Dependencies - run: npm install -g yarn sass cross-env mjml - - - name: Download Frontend Dependencies - working-directory: ./frontend - run: yarn - - - name: Download Go mods - run: | - go mod download - go mod verify - make test-deps - - - name: Build Frontend Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - MJML_APP: ${{ secrets.MJML_APP }} - MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - run: make clean generate compile - - - name: Upload Compiled Frontend (rice-box.go) - uses: actions/upload-artifact@v1 - with: - name: static-rice-box - path: ./source - -# - name: Configure AWS credentials for Asset uploads -# uses: aws-actions/configure-aws-credentials@v1 -# with: -# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} -# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# aws-region: us-west-2 -# -# - name: Upload Static Assets to S3 -# run: | -# tar -czvf source.tar.gz source/ -# aws s3 cp source.tar.gz s3://assets.statping.com/commit/${{ github.sha }}/ -# rm -rf source.tar.gz - - build: - needs: [test-postman-sqlite, test-postman-mysql, test-postman-postgres] - runs-on: ubuntu-latest - strategy: - matrix: - platform: [linux] - arch: [386, amd64, arm-7, arm-6, arm64] - include: - - platform: darwin - arch: arm64 - - platform: darwin - arch: amd64 - - platform: windows - arch: 386 - - platform: windows - arch: amd64 - - steps: - - uses: actions/checkout@v2 - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - -# - name: Configure AWS credentials for Asset uploads -# uses: aws-actions/configure-aws-credentials@v1 -# with: -# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} -# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# aws-region: us-west-2 - - - name: Add GOBIN to PATH - run: | - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Set Linux Build Flags - if: matrix.platform == 'linux' - run: | - echo "BUILD_FLAGS=-extldflags -static" >> $GITHUB_ENV - echo "XGO_TAGS=netgo osusergo linux sqlite_omit_load_extension" >> $GITHUB_ENV - shell: bash - - - name: Set MacOS (Darwin) Build Flags - if: matrix.platform == 'darwin' - run: echo "XGO_TAGS=netgo osusergo darwin sqlite_omit_load_extension" >> $GITHUB_ENV - shell: bash - - - name: Set Windows Build Flags - if: matrix.platform == 'windows' - run: | - echo "BUILD_FLAGS=-extldflags -static -buildmode=exe" >> $GITHUB_ENV - echo "XGO_TAGS=netgo osusergo sqlite_omit_load_extension" >> $GITHUB_ENV - shell: bash - - - name: Build ${{ matrix.platform }}/${{ matrix.arch }} - uses: crazy-max/ghaction-xgo@v1 - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - with: - xgo_version: latest - go_version: 1.17.x - dest: build - prefix: statping - targets: ${{ matrix.platform }}/${{ matrix.arch }} - v: false - x: false - pkg: cmd - buildmode: pie - tags: ${{ env.XGO_TAGS }} - ldflags: -s -w -X main.VERSION=${{ env.VERSION }} -X main.COMMIT=${{ env.COMMIT }} ${{ env.BUILD_FLAGS }} - - - name: Compress Linux Builds - if: matrix.platform == 'linux' - run: | - cd build - mv statping-linux-${{ matrix.arch }} statping - chmod +x statping - tar -czvf statping-linux-${{ matrix.arch }}.tar.gz statping - rm -rf statping - echo "compressed=statping-linux-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - - - name: Compress Windows Builds - if: matrix.platform == 'windows' - run: | - cd build - mv statping-windows-${{ matrix.arch }}.exe statping.exe - chmod +x statping.exe - zip statping-windows-${{ matrix.arch }}.zip statping.exe - rm -rf statping.exe - echo "compressed=statping-windows-${{ matrix.arch }}.zip" >> $GITHUB_ENV - - - name: Compress MacOS (Darwin) Builds - if: matrix.platform == 'darwin' - run: | - cd build - mv statping-darwin-${{ matrix.arch }} statping - chmod +x statping - tar -czvf statping-darwin-${{ matrix.arch }}.tar.gz statping - rm -rf statping - echo "compressed=statping-darwin-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV - - - name: Upload Compiled Statping Binary - uses: actions/upload-artifact@v1 - with: - name: statping-${{ matrix.platform }}-${{ matrix.arch }} - path: ./build - - - name: Upload Releases - id: upload-assets - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VERSION: ${{ env.VERSION }} - with: - tag_name: v${{ env.VERSION }} - draft: true - prerelease: true - files: build/${{ env.compressed }} - -# - name: Upload Compiled Binaries to S3 -# run: | -# aws s3 cp build/${{ env.compressed }} s3://assets.statping.com/commit/${{ github.sha }}/ - -# test: -# needs: frontend -# runs-on: ubuntu-latest -# services: -# postgres: -# image: postgres:10.8 -# env: -# POSTGRES_USER: root -# POSTGRES_PASSWORD: password123 -# POSTGRES_DB: statping -# ports: -# - 5432:5432 -# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 -# -# mysql: -# image: mysql:5.7 -# env: -# MYSQL_ROOT_PASSWORD: password123 -# MYSQL_DATABASE: statping -# ports: -# - 3306:3306 -# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 -# -# steps: -# - uses: actions/checkout@v2 -# - uses: actions/setup-go@v2 -# with: -# go-version: 1.17.x -# - uses: actions/setup-node@v1 -# with: -# node-version: 16.14.0 -# -# - name: Install Global Dependencies -# run: npm install -g yarn sass newman cross-env wait-on @sentry/cli -# -# - name: Setting ENV's -# run: | -# echo "$(go env GOPATH)/bin" >> $GITHUB_PATH -# echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH -# echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV -# shell: bash -# -# - name: Download Compiled Frontend (rice-box.go) -# uses: actions/download-artifact@v1 -# with: -# name: static-rice-box -# path: ./source -# -# - name: Install Statping -# env: -# VERSION: ${{ env.VERSION }} -# COMMIT: ${{ github.sha }} -# run: | -# make build certs -# chmod +x statping -# mv statping $(go env GOPATH)/bin/ -# -# - name: Go Tests -# run: | -# go get gotest.tools/gotestsum -# gotestsum --no-summary=skipped --format testname -- -covermode=count -coverprofile=coverage.out -p=1 ./... -# env: -# VERSION: ${{ env.VERSION }} -# COMMIT: ${{ github.sha }} -# DB_CONN: sqlite3 -# STATPING_DIR: ${{ github.workspace }} -# API_SECRET: demopassword123 -# DISABLE_LOGS: false -# ALLOW_REPORTS: true -# SAMPLE_DATA: true -# COVERALLS: ${{ secrets.COVERALLS }} -# DISCORD_URL: ${{ secrets.DISCORD_URL }} -# EMAIL_HOST: ${{ secrets.EMAIL_HOST }} -# EMAIL_USER: ${{ secrets.EMAIL_USER }} -# EMAIL_PASS: ${{ secrets.EMAIL_PASS }} -# EMAIL_OUTGOING: ${{ secrets.EMAIL_OUTGOING }} -# EMAIL_SEND_TO: ${{ secrets.EMAIL_SEND_TO }} -# EMAIL_PORT: ${{ secrets.EMAIL_PORT }} -# MOBILE_ID: ${{ secrets.MOBILE_ID }} -# MOBILE_NUMBER: ${{ secrets.MOBILE_NUMBER }} -# PUSHOVER_TOKEN: ${{ secrets.PUSHOVER_TOKEN }} -# PUSHOVER_API: ${{ secrets.PUSHOVER_API }} -# SLACK_URL: ${{ secrets.SLACK_URL }} -# TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} -# TELEGRAM_CHANNEL: ${{ secrets.TELEGRAM_CHANNEL }} -# TWILIO_SID: ${{ secrets.TWILIO_SID }} -# TWILIO_SECRET: ${{ secrets.TWILIO_SECRET }} -# TWILIO_FROM: ${{ secrets.TWILIO_FROM }} -# TWILIO_TO: ${{ secrets.TWILIO_TO }} -# TEST_EMAIL: ${{ secrets.TEST_EMAIL }} -# GOTIFY_URL: ${{ secrets.GOTIFY_URL }} -# GOTIFY_TOKEN: ${{ secrets.GOTIFY_TOKEN }} -# SNS_TOKEN: ${{ secrets.SNS_TOKEN }} -# SNS_SECRET: ${{ secrets.SNS_SECRET }} -# SNS_REGION: ${{ secrets.SNS_REGION }} -# SNS_TOPIC: ${{ secrets.SNS_TOPIC }} -# -# - name: Coveralls Testing Coverage -# run: | -# go get github.com/mattn/goveralls -# goveralls -coverprofile=coverage.out -repotoken $COVERALLS -# env: -# COVERALLS: ${{ secrets.COVERALLS }} - - test-postman-sqlite: - needs: frontend - runs-on: [self-hosted, linux, aboutcher-hosted, centos7] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - run: | - make build - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - name: Run Statping - run: | - API_SECRET=demosecret123 statping --port=8585 > /dev/null & - sleep 5 - - name: Postman SQLite Tests - uses: matt-ball/newman-action@master - with: - apiKey: ${{ secrets.POSTMAN_API }} - collection: ./dev/postman.json - environment: ./dev/postman_env_sqlite.json - timeoutRequest: 30000 - delayRequest: 600 - - test-postman-mysql: - needs: frontend - runs-on: ubuntu-latest - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: password123 - MYSQL_DATABASE: statping - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - MJML_APP: ${{ secrets.MJML_APP }} - MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} - run: | - make build - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - name: Run Statping - run: | - API_SECRET=demosecret123 statping --port=8585 > /dev/null & - sleep 5 - - name: Postman MySQL Tests - uses: matt-ball/newman-action@master - with: - apiKey: ${{ secrets.POSTMAN_API }} - collection: ./dev/postman.json - environment: ./dev/postman_env_mysql.json - timeoutRequest: 30000 - delayRequest: 600 - - test-postman-postgres: - needs: frontend - runs-on: ubuntu-latest - - services: - postgres: - image: postgres:10.8 - env: - POSTGRES_USER: root - POSTGRES_PASSWORD: password123 - POSTGRES_DB: statping - ports: - - 5432:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.17.x - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - run: | - make build - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - name: Run Statping - run: | - API_SECRET=demosecret123 statping --port=8585 > /dev/null & - sleep 5 - - name: Postman Postgres Tests - uses: matt-ball/newman-action@master - with: - apiKey: ${{ secrets.POSTMAN_API }} - collection: ./dev/postman.json - environment: ./dev/postman_env_postgres.json - timeoutRequest: 30000 - delayRequest: 600 - - docker-release: - needs: build - runs-on: [self-hosted, linux, aboutcher-hosted, rocky8] - steps: - - name: Checkout Statping Repo - uses: actions/checkout@v2 - - - name: Setting ENV's - run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - id: buildx - with: - install: true - - - name: Cache Docker layers - uses: actions/cache@v2 - id: buildx-docker - with: - path: /tmp/.buildx-cache - key: buildx-docker - restore-keys: | - buildx-docker - -# - name: Docker Login -# env: -# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} -# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} -# run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin -# -# - name: Docker Build :base -# run: make buildx-base - - - name: Docker Login - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin - - - name: Docker Build :lastest - run: make buildx-latest - -# sentry-release: -# needs: docker-release -# runs-on: ubuntu-latest -# steps: -# - name: Checkout Statping Repo -# uses: actions/checkout@v2 -# -# - name: Setup Sentry CLI -# uses: mathrix-education/setup-sentry-cli@master -# with: -# version: latest -# url: ${{ secrets.SENTRY_URL }} -# token: ${{ secrets.SENTRY_AUTH_TOKEN }} -# organization: statping -# -# - name: Setting ENV's -# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV -# shell: bash -# -# - name: Sentry Release -# run: make sentry-release - -# homebrew-release: -# needs: docker-release -# runs-on: ubuntu-latest -# steps: -# - name: Checkout Statping Repo -# uses: actions/checkout@v2 -# -# - name: Setting ENV's -# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV -# shell: bash -# -# - name: Update Homebrew Package -# env: -# VERSION: ${{ env.VERSION }} -# TRAVIS_API: ${{ secrets.TRAVIS_API }} -# run: make publish-homebrew -# -# slack-update: -# needs: docker-release -# runs-on: ubuntu-latest -# steps: -# - name: Checkout Statping Repo -# uses: actions/checkout@v2 -# -# - name: Setting ENV's -# run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV -# shell: bash -# -# - name: Slack Notification -# uses: rtCamp/action-slack-notify@master -# env: -# SLACK_WEBHOOK: ${{ secrets.SLACK_URL }} -# SLACK_CHANNEL: dev -# SLACK_USERNAME: StatpingDev diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 30cd68c1..00000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,173 +0,0 @@ -name: Push Request Testing -on: - push: - branches: - - '*' # matches every branch - - '*/*' # matches every branch containing a single '/' - - '!master' # excludes master - - '!dev' # excludes dev - pull_request: - branches: - - '*' # matches every branch - - '*/*' # matches every branch containing a single '/' - - '!master' # excludes master - - '!dev' # excludes dev - - -jobs: - compile: - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v2 - with: - go-version: '1.17.8' - - uses: actions/setup-node@v1 - with: - node-version: '16.14.0' - - uses: actions/checkout@v2 - - - name: Add GOBIN to PATH - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Install Global Dependencies - run: npm install -g yarn sass cross-env - - - name: Download Frontend Dependencies - if: steps.nodecache.outputs.cache-hit != 'true' - working-directory: ./frontend - run: yarn - - - name: Download Go mods - if: steps.golangcache.outputs.cache-hit != 'true' - run: | - go mod download - go mod verify - make test-deps - - - name: Build Frontend Statping - run: make clean compile - - - name: Upload Compiled Frontend (rice-box.go) - uses: actions/upload-artifact@v1 - with: - name: static-rice-box - path: ./source - - pr-test: - needs: compile - runs-on: ubuntu-latest - - services: - postgres: - image: postgres:10.8 - env: - POSTGRES_USER: root - POSTGRES_PASSWORD: password123 - POSTGRES_DB: statping - ports: - - 5432:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: password123 - MYSQL_DATABASE: statping - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.15.x - - uses: actions/setup-node@v1 - with: - node-version: 16.14.0 - - uses: actions/checkout@v2 - - - name: Install Global Dependencies - run: | - go get gotest.tools/gotestsum - npm install -g yarn sass newman cross-env wait-on @sentry/cli - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - run: | - make build certs - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - - name: Go Tests - run: | - SASS=`which sass` gotestsum --no-summary=skipped --format testname -- -covermode=count -coverprofile=coverage.out -p=1 ./... - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - DB_CONN: sqlite3 - STATPING_DIR: ${{ github.workspace }} - API_SECRET: demopassword123 - DISABLE_LOGS: false - ALLOW_REPORTS: true - PUSH_REQUEST: true - - pr-test-postman: - needs: compile - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: 1.15.x - - - name: Setting ENV's - run: | - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - echo "/opt/hostedtoolcache/node/16.14.0/x64/bin" >> $GITHUB_PATH - echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV - shell: bash - - - name: Download Compiled Frontend (rice-box.go) - uses: actions/download-artifact@v1 - with: - name: static-rice-box - path: ./source - - - name: Install Statping - env: - VERSION: ${{ env.VERSION }} - COMMIT: ${{ github.sha }} - run: | - make build - chmod +x statping - mv statping $(go env GOPATH)/bin/ - - - name: Run Statping - run: | - API_SECRET=demosecret123 statping --port=8080 > /dev/null & - sleep 3 - - - name: Postman Tests - uses: matt-ball/newman-action@master - with: - collection: ./dev/postman.json - environment: ./dev/postman_environment_sqlite.json - timeoutRequest: 15000 - delayRequest: 500