From 0a4b8fd35dd0a911a16153efc8c6fea1f0245962 Mon Sep 17 00:00:00 2001 From: Raymond Tukpe Date: Fri, 23 Aug 2024 14:08:08 +0200 Subject: [PATCH] Push docker images to DockerHub (#2122) * feat: update build-image.yml * feat: multi arch build * feat: update images and remove useless action files * chore: test update --- .github/workflows/build-image.yml | 158 +++++++++++++++--- .github/workflows/do-deploy.yml | 34 ---- .github/workflows/go.yml | 13 -- .github/workflows/immune-test.yml | 83 --------- .github/workflows/linter.yml | 2 +- .github/workflows/release-ee.yml | 78 --------- .github/workflows/release.yml | 16 +- .publisher-ee.yml | 100 ----------- .publisher.yml | 70 -------- configs/convoy.templ.json | 7 - configs/docker-compose.templ.yml | 26 +-- configs/local/docker-compose.yml | 6 +- datastore/filter.go | 9 +- datastore/filter_test.go | 2 +- docker-compose.dev.yml | 15 -- release.Dockerfile | 2 +- scripts/ui.sh | 2 +- worker/task/testdata/Config/basic-convoy.json | 7 - 18 files changed, 154 insertions(+), 476 deletions(-) delete mode 100644 .github/workflows/do-deploy.yml delete mode 100644 .github/workflows/immune-test.yml delete mode 100644 .github/workflows/release-ee.yml delete mode 100644 .publisher-ee.yml diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index c007963748..1917ae2245 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -1,4 +1,4 @@ -name: Build docker image +name: Build and Push Docker Images on: workflow_dispatch: @@ -6,31 +6,147 @@ on: name: description: "Manual workflow name" required: true - + push: + tags: + # Release binary for every tag. + - v* + +env: + DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} + IMAGE_NAME: getconvoy/convoy + RELEASE_VERSION: ${{ github.ref_name }} jobs: - deploy: - runs-on: "ubuntu-latest" + build_ui: + name: Build UI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build Artifact + run: "make ui_install type=ce" + + - name: Archive Build artifacts + uses: actions/upload-artifact@v4 + with: + name: dist-without-markdown + path: | + web/ui/dashboard/dist + !web/ui/dashboard/dist/**/*.md + + build-and-push-arch: + runs-on: ubuntu-latest + needs: [build_ui] + strategy: + matrix: + include: + - arch: amd64 + platform: linux/amd64 + dockerfile: release.Dockerfile + - arch: arm64 + platform: linux/arm64 + dockerfile: release.Dockerfile + + steps: + - uses: actions/checkout@v4 + - name: Download Build Artifact + uses: actions/download-artifact@v4 + with: + name: dist-without-markdown + path: api/ui/build + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.21 + + - name: Check out code + uses: actions/checkout@v4 + + - name: Get and verify dependencies + run: go mod tidy && go mod download && go mod verify + + - name: Go vet + run: go vet ./... + + - name: Build app to make sure there are zero issues + run: go build -o convoy ./cmd + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ env.DOCKER_HUB_USERNAME }} + password: ${{ env.DOCKER_HUB_TOKEN }} + + - name: Build and push arch specific images + uses: docker/build-push-action@v2 + with: + context: . + file: ${{ matrix.dockerfile }} + platforms: ${{ matrix.platform }} + push: true + tags: | + ${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}-${{ matrix.arch }} + build-args: | + ARCH=${{ matrix.arch }} + + + build-and-push-default: + runs-on: ubuntu-latest + needs: [build_ui] steps: + - uses: actions/checkout@v4 + + - name: Download Build Artifact + uses: actions/download-artifact@v4 + with: + name: dist-without-markdown + path: api/ui/build + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.21 + + - name: Check out code + uses: actions/checkout@v4 + + - name: Get and verify dependencies + run: go mod tidy && go mod download && go mod verify + + - name: Go vet + run: go vet ./... - - name: Checkout code - uses: actions/checkout@v2 + - name: Build app to make sure there are zero issues + run: go build -o convoy ./cmd - - name: Get the version - id: get_version - run: echo ::set-output name=tag::$(cat VERSION) + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - - name: Authenticate - uses: actions-hub/docker/login@master - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.PAT }} - DOCKER_REGISTRY_URL: ghcr.io + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 - - name: Build latest image - run: docker build -t ghcr.io/${GITHUB_REPOSITORY}:${{ steps.get_version.outputs.tag }} . + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ env.DOCKER_HUB_USERNAME }} + password: ${{ env.DOCKER_HUB_TOKEN }} - - name: Push - uses: actions-hub/docker@master - with: - args: push ghcr.io/${GITHUB_REPOSITORY}:${{ steps.get_version.outputs.tag }} + - name: Build and push default image + uses: docker/build-push-action@v2 + with: + context: . + file: release.Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }} + ${{ env.IMAGE_NAME }}:latest diff --git a/.github/workflows/do-deploy.yml b/.github/workflows/do-deploy.yml deleted file mode 100644 index e90f9443b1..0000000000 --- a/.github/workflows/do-deploy.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: DigitalOcean Deploy - -on: - push: - branches: - - main - workflow_dispatch: - inputs: - name: - description: "Manual workflow name" - required: true - -jobs: - deploy: - runs-on: "ubuntu-latest" - env: - REPO: registry.digitalocean.com/convoy-deployer - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Build image - run: docker build -t $REPO/convoy:edge -f Dockerfile.dev . - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 60 - - - name: Push image to DigitalOcean Container Registry - run: docker push $REPO/convoy:edge diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 62006fa714..d9d834f1da 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,7 +14,6 @@ jobs: os: [ubuntu-latest, macos-latest] postgres-version: ["15"] redis-version: ["6.2.6"] - typesense-version: ["0.24.0"] runs-on: ubuntu-latest services: @@ -36,12 +35,6 @@ jobs: redis-version: ${{ matrix.redis-version }} redis-port: 6379 - - name: Start Typesense v${{ matrix.typesense-version }} - uses: jirevwe/typesense-github-action@v1.0.1 - with: - typesense-version: ${{ matrix.typesense-version }} - typesense-api-key: some-api-key - - name: Get the version id: get_version run: echo ::set-output name=tag::$(echo ${GITHUB_SHA:8}) @@ -97,9 +90,6 @@ jobs: TEST_REDIS_SCHEME: redis TEST_REDIS_HOST: localhost TEST_REDIS_PORT: 6379 - TEST_TYPESENSE_HOST: http://localhost:8108 - TEST_TYPESENSE_API_KEY: some-api-key - TEST_SEARCH_TYPE: typesense - name: Run integration tests (with test containers) run: make docker_e2e_tests @@ -114,7 +104,4 @@ jobs: TEST_REDIS_SCHEME: redis TEST_REDIS_HOST: localhost TEST_REDIS_PORT: 6379 - TEST_TYPESENSE_HOST: http://localhost:8108 - TEST_TYPESENSE_API_KEY: some-api-key - TEST_SEARCH_TYPE: typesense diff --git a/.github/workflows/immune-test.yml b/.github/workflows/immune-test.yml deleted file mode 100644 index 09d342f79c..0000000000 --- a/.github/workflows/immune-test.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: Build and run immune tests -on: - push: - branches: - - main - pull_request: - -jobs: - test: - if: ${{ !(contains(github.head_ref, 'ui/')) || !(contains(github.head_ref, 'cms/')) }} - strategy: - matrix: - go-version: [1.16.x, 1.17.x] - immune-test-file-names: [] - immune-version: ["0.2.1"] - mongodb-version: ["4.0", "4.2", "4.4"] - redis-version: ["6.2.6"] - - runs-on: ubuntu-latest - steps: - - name: Start MongoDB - uses: supercharge/mongodb-github-action@1.4.1 - with: - mongodb-version: ${{ matrix.mongodb-version }} - - - name: Start Redis v${{ matrix.redis-version }} - uses: supercharge/redis-github-action@1.4.0 - with: - redis-version: ${{ matrix.redis-version }} - redis-port: 6379 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - - - name: Check out code - uses: actions/checkout@v2 - - - name: Pull immune - run: | - wget --output-document=./immune.tar.gz \ - https://github.com/frain-dev/immune/releases/download/v${{ matrix.immune-version }}/immune_${{ matrix.immune-version }}_linux_amd64.tar.gz - tar -xvzf ./immune.tar.gz - mv ./immune $(go env GOPATH)/bin/immune - - - name: Setup custom host for endpoint - run: echo "127.0.0.1 www.endpoint.url" | sudo tee -a /etc/hosts - - - name: Pull certgen - uses: danvixent/certgen-action@v0.1.6 - with: - output-folder: $(go env GOPATH)/bin - os: ${{ runner.os }} - certgen-version: 0.2.0 - - - name: Start convoy & run immune tests - env: - PORT: 5005 - CONVOY_RETRY_LIMIT: "3" - CONVOY_INTERVAL_SECONDS: "10" - CONVOY_SIGNATURE_HEADER: "X-Convoy-CI" - CONVOY_STRATEGY_TYPE: "default" - CONVOY_SIGNATURE_HASH: "SHA256" - CONVOY_DB_TYPE: "mongodb" - CONVOY_SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - CONVOY_DB_DSN: "mongodb://localhost:27017/testdb" - CONVOY_REDIS_DSN: "redis://localhost:6379" - CONVOY_QUEUE_PROVIDER: "redis" - IMMUNE_EVENT_TARGET_URL: https://www.endpoint.url:9098 - IMMUNE_SSL: true - run: | - ref=$(certgen -domains="www.endpoint.url,endpoint.url") - echo "$ref" - go run ./cmd server & - IFS=', ' read -ra array <<< "$ref" - echo "${array[0]}" - echo "${array[1]}" - export IMMUNE_SSL_CERT_FILE="${array[0]}" - export IMMUNE_SSL_KEY_FILE="${array[1]}" - sleep 70 - cd ./immune-test-files - immune run --config ./${{ matrix.immune-test-file-names }} diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1db58a862c..c192c46b11 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -8,7 +8,7 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: diff --git a/.github/workflows/release-ee.yml b/.github/workflows/release-ee.yml deleted file mode 100644 index 6c1e394151..0000000000 --- a/.github/workflows/release-ee.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Release EE Binaries - -on: - workflow_dispatch: - inputs: - name: - description: "Manual workflow name" - required: true - push: - tags: - # Release binary for every tag. - - v* - -jobs: - build_ui: - name: Build UI - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build Artifact - run: "make ui_install type=ee" - - name: Archive Build artifacts - uses: actions/upload-artifact@v2 - with: - name: dist-without-markdown - path: | - web/ui/dashboard/dist - !web/ui/dashboard/dist/**/*.md - - release-matrix: - name: Release & Publish Go Binary - needs: [build_ui] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download Build Artifact - uses: actions/download-artifact@v2 - with: - name: dist-without-markdown - path: api/ui/build - fetch-depth: 0 - - - uses: docker/login-action@v1 - name: Authenticate with Docker - with: - registry: docker.cloudsmith.io - username: ${{ secrets.CLOUDSMITH_USERNAME }} - password: ${{ secrets.CLOUDSMITH_API_KEY }} - - - uses: actions/setup-go@v2 - name: Setup go - with: - go-version: '1.21' - - - uses: docker/setup-qemu-action@v3 - name: Set up QEMU - - - uses: actions/setup-python@v3 - name: Setup Python - with: - python-version: '3.9' - - - name: Install Cloudsmith CLI - run: | - echo $(pip --version) - pip install --upgrade cloudsmith-cli - echo $(cloudsmith --version) - - - uses: goreleaser/goreleaser-action@v2 - name: Release, Upload & Publish - with: - version: latest - args: -f .publisher-ee.yml release --clean - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - REPO_NAME: ${{ github.repository }} - CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ebb4b5977b..197b3378c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: needs: [build_ui] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Download Build Artifact uses: actions/download-artifact@v2 with: @@ -40,22 +40,10 @@ jobs: path: api/ui/build fetch-depth: 0 - - uses: docker/login-action@v1 - name: Authenticate with Docker - with: - registry: docker.cloudsmith.io - username: ${{ secrets.CLOUDSMITH_USERNAME }} - password: ${{ secrets.CLOUDSMITH_API_KEY }} - - - uses: actions/setup-go@v2 - name: Setup go - with: - go-version: '1.21' - - uses: docker/setup-qemu-action@v3 name: Set up QEMU - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v5 name: Setup Python with: python-version: '3.9' diff --git a/.publisher-ee.yml b/.publisher-ee.yml deleted file mode 100644 index f8e722a27b..0000000000 --- a/.publisher-ee.yml +++ /dev/null @@ -1,100 +0,0 @@ -project_name: convoy - -before: - hooks: - - go mod tidy -builds: - - env: - - CGO_ENABLED=0 - main: ./ee/cmd - id: cobin - goos: - - linux - - darwin - - windows - goarch: - - amd64 - - arm64 - -# https://goreleaser.com/customization/archive/ -archives: - - name_template: "{{ .ProjectName}}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" - id: cobin-archive - builds: - - cobin - -dockers: - - image_templates: - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:latest-amd64" - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:{{ .Tag }}-amd64" - use: buildx - goos: linux - goarch: amd64 - dockerfile: release.Dockerfile - extra_files: - - configs/local/start.sh - ids: - - cobin - build_flag_templates: - - --platform=linux/amd64 - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.description=A fast & secure open source webhooks service - - --label=org.opencontainers.image.url=https://github.com/{{ .Env.REPO_NAME }}-ee - - --label=org.opencontainers.image.source=https://github.com/{{ .Env.REPO_NAME }}-ee - - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} - - --label=org.opencontainers.image.licenses=MPL-2.0 - - - image_templates: - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:latest-arm64" - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:{{ .Tag }}-arm64" - use: buildx - goos: linux - goarch: arm64 - dockerfile: release.Dockerfile - extra_files: - - configs/local/start.sh - ids: - - cobin - build_flag_templates: - - --platform=linux/arm64 - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.description=A fast & secure open source webhooks service - - --label=org.opencontainers.image.url=https://github.com/{{ .Env.REPO_NAME }}-ee - - --label=org.opencontainers.image.source=https://github.com/{{ .Env.REPO_NAME }}-ee - - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} - - --label=org.opencontainers.image.licenses=MPL-2.0 - - - image_templates: - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:latest-slim" - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:{{ .Tag }}-slim" - goos: linux - goarch: amd64 - dockerfile: slim.Dockerfile - ids: - - cobin - build_flag_templates: - - --platform=linux/amd64 - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.description=A fast & secure open source webhooks service - - --label=org.opencontainers.image.url=https://github.com/{{ .Env.REPO_NAME }}-ee - - --label=org.opencontainers.image.source=https://github.com/{{ .Env.REPO_NAME }}-ee - - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} - - --label=org.opencontainers.image.licenses=MPL-2.0 - -docker_manifests: - - name_template: "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:{{ .Tag }}" - image_templates: - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:{{ .Tag }}-amd64" - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:{{ .Tag }}-arm64" - - - name_template: "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:latest" - image_templates: - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:latest-amd64" - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}-ee:latest-arm64" - -checksum: - name_template: "{{ .ProjectName}}_checksums.txt" - -release: - # Will not auto-publish the release on GitHub - disable: true diff --git a/.publisher.yml b/.publisher.yml index 345f25d394..e496c2a668 100644 --- a/.publisher.yml +++ b/.publisher.yml @@ -87,76 +87,6 @@ brews: name: homebrew-tools url_template: https://dl.cloudsmith.io/public/convoy/convoy/raw/versions/{{.Version}}/{{ .ArtifactName }} -dockers: - - image_templates: - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:latest-amd64" - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:{{ .Tag }}-amd64" - use: buildx - goos: linux - goarch: amd64 - dockerfile: release.Dockerfile - extra_files: - - configs/local/start.sh - ids: - - cobin - build_flag_templates: - - --platform=linux/amd64 - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.description=A fast & secure open source webhooks service - - --label=org.opencontainers.image.url=https://github.com/{{ .Env.REPO_NAME }} - - --label=org.opencontainers.image.source=https://github.com/{{ .Env.REPO_NAME }} - - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} - - --label=org.opencontainers.image.licenses=MPL-2.0 - - - image_templates: - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:latest-arm64" - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:{{ .Tag }}-arm64" - use: buildx - goos: linux - goarch: arm64 - dockerfile: release.Dockerfile - extra_files: - - configs/local/start.sh - ids: - - cobin - build_flag_templates: - - --platform=linux/arm64 - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.description=A fast & secure open source webhooks service - - --label=org.opencontainers.image.url=https://github.com/{{ .Env.REPO_NAME }} - - --label=org.opencontainers.image.source=https://github.com/{{ .Env.REPO_NAME }} - - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} - - --label=org.opencontainers.image.licenses=MPL-2.0 - - - image_templates: - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:latest-slim" - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:{{ .Tag }}-slim" - use: buildx - goos: linux - goarch: amd64 - dockerfile: slim.Dockerfile - ids: - - cobin - build_flag_templates: - - --platform=linux/amd64 - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.description=A fast & secure open source webhooks service - - --label=org.opencontainers.image.url=https://github.com/{{ .Env.REPO_NAME }} - - --label=org.opencontainers.image.source=https://github.com/{{ .Env.REPO_NAME }} - - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} - - --label=org.opencontainers.image.licenses=MPL-2.0 - -docker_manifests: - - name_template: "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:{{ .Tag }}" - image_templates: - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:{{ .Tag }}-amd64" - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:{{ .Tag }}-arm64" - - - name_template: "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:latest" - image_templates: - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:latest-amd64" - - "docker.cloudsmith.io/convoy/convoy/{{ .Env.REPO_NAME }}:latest-arm64" - checksum: name_template: "{{ .ProjectName}}_checksums.txt" diff --git a/configs/convoy.templ.json b/configs/convoy.templ.json index 20ea2d4155..d9fc65086f 100644 --- a/configs/convoy.templ.json +++ b/configs/convoy.templ.json @@ -26,13 +26,6 @@ "password": "", "from": "support@frain.dev" }, - "search": { - "type": "typesense", - "typesense": { - "host": "http://typesense:8108", - "api_key": "convoy" - } - }, "server": { "http": { "ssl": false, diff --git a/configs/docker-compose.templ.yml b/configs/docker-compose.templ.yml index c7604b17d7..b3787fc020 100644 --- a/configs/docker-compose.templ.yml +++ b/configs/docker-compose.templ.yml @@ -2,7 +2,7 @@ version: "3" services: web: - image: docker.cloudsmith.io/convoy/convoy/frain-dev/convoy:$VERSION + image: getconvoy/convoy:latest command: [ "/start.sh" ] hostname: web container_name: web @@ -12,12 +12,11 @@ services: depends_on: - postgres - redis_server - - typesense networks: - backendCluster scheduler: - image: docker.cloudsmith.io/convoy/convoy/frain-dev/convoy:$VERSION + image: getconvoy/convoy:latest command: ["./cmd", "scheduler", "--config", "convoy.json"] volumes: - ./convoy.json:/convoy.json @@ -25,12 +24,11 @@ services: depends_on: - postgres - redis_server - - typesense networks: - backendCluster worker: - image: docker.cloudsmith.io/convoy/convoy/frain-dev/convoy:$VERSION + image: getconvoy/convoy:latest command: ["./cmd", "worker", "--config", "convoy.json"] volumes: - ./convoy.json:/convoy.json @@ -38,12 +36,11 @@ services: depends_on: - postgres - redis_server - - typesense networks: - backendCluster ingest: - image: docker.cloudsmith.io/convoy/convoy/frain-dev/convoy:$VERSION + image: getconvoy/convoy:latest command: ["./cmd", "ingest", "--config", "convoy.json"] volumes: - ./convoy.json:/convoy.json @@ -51,7 +48,6 @@ services: depends_on: - postgres - redis_server - - typesense networks: - backendCluster @@ -76,20 +72,6 @@ services: networks: - backendCluster - typesense: - image: typesense/typesense:0.22.2 - hostname: typesense - container_name: typesense - restart: always - environment: - TYPESENSE_DATA_DIR: /data/typesense - TYPESENSE_ENABLE_CORS: "true" - TYPESENSE_API_KEY: "convoy" - volumes: - - ./typesense-data:/data/typesense - networks: - - backendCluster - caddy: image: caddy restart: unless-stopped diff --git a/configs/local/docker-compose.yml b/configs/local/docker-compose.yml index cdd7eecba9..ffdd414f2a 100644 --- a/configs/local/docker-compose.yml +++ b/configs/local/docker-compose.yml @@ -2,7 +2,7 @@ version: "3" services: web: - image: docker.cloudsmith.io/convoy/convoy/frain-dev/convoy:v24.6.4 + image: getconvoy/convoy:latest command: ["/start.sh"] volumes: - ./convoy.json:/convoy.json @@ -21,7 +21,7 @@ services: - pgbouncer worker: - image: docker.cloudsmith.io/convoy/convoy/frain-dev/convoy:v24.6.4 + image: getconvoy/convoy:latest command: ["./cmd", "worker", "--config", "convoy.json"] volumes: - ./convoy.json:/convoy.json @@ -31,7 +31,7 @@ services: condition: service_healthy ingest: - image: docker.cloudsmith.io/convoy/convoy/frain-dev/convoy:v24.6.4 + image: getconvoy/convoy:latest command: ["./cmd", "ingest", "--config", "convoy.json"] volumes: - ./convoy.json:/convoy.json diff --git a/datastore/filter.go b/datastore/filter.go index e50132a0ed..9bcb4c860b 100644 --- a/datastore/filter.go +++ b/datastore/filter.go @@ -46,10 +46,11 @@ type FilterBy struct { SearchParams SearchParams } -func (f *FilterBy) String() *string { +func (f *FilterBy) String() string { var s string filterByBuilder := new(strings.Builder) - filterByBuilder.WriteString(fmt.Sprintf("project_id:=%s", f.ProjectID)) // TODO(daniel, RT): how to work around this? + // TODO(daniel, raymond): how to work around this? + filterByBuilder.WriteString(fmt.Sprintf("project_id:=%s", f.ProjectID)) filterByBuilder.WriteString(fmt.Sprintf(" && created_at:[%d..%d]", f.SearchParams.CreatedAtStart, f.SearchParams.CreatedAtEnd)) if len(f.EndpointID) > 0 { @@ -62,9 +63,7 @@ func (f *FilterBy) String() *string { s = filterByBuilder.String() - // we only return a pointer address here - // because the typesense lib needs a string pointer - return &s + return s } type SearchFilter struct { diff --git a/datastore/filter_test.go b/datastore/filter_test.go index 867c798a73..d7c6f034d9 100644 --- a/datastore/filter_test.go +++ b/datastore/filter_test.go @@ -42,7 +42,7 @@ func Test_FilterBy(t *testing.T) { for _, tt := range args { t.Run(tt.name, func(t *testing.T) { s := tt.filter.String() - require.Equal(t, tt.expected, *s) + require.Equal(t, tt.expected, s) }) } } diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 41a54390b7..2f186d8a68 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -3,7 +3,6 @@ version: "3" volumes: postgres_data: redis_data: - typesense_data: services: web: @@ -19,7 +18,6 @@ services: depends_on: - postgres - redis_server - - typesense scheduler: build: @@ -32,7 +30,6 @@ services: depends_on: - postgres - redis_server - - typesense worker: build: @@ -45,7 +42,6 @@ services: depends_on: - postgres - redis_server - - typesense ingest: build: @@ -58,7 +54,6 @@ services: depends_on: - postgres - redis_server - - typesense postgres: image: postgres:15.2-alpine @@ -77,16 +72,6 @@ services: volumes: - ./redis_data:/data - typesense: - image: typesense/typesense:0.22.2 - restart: always - environment: - TYPESENSE_DATA_DIR: /data/typesense - TYPESENSE_ENABLE_CORS: "true" - TYPESENSE_API_KEY: "convoy" - volumes: - - ./typesense_data:/data/typesense - prometheus: image: prom/prometheus:v2.24.0 volumes: diff --git a/release.Dockerfile b/release.Dockerfile index b24afca2c3..9d644c2113 100644 --- a/release.Dockerfile +++ b/release.Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.16.2 +FROM alpine:3.20.2 COPY convoy /cmd COPY configs/local/start.sh /start.sh diff --git a/scripts/ui.sh b/scripts/ui.sh index b112c5986c..1271b258cb 100755 --- a/scripts/ui.sh +++ b/scripts/ui.sh @@ -12,7 +12,7 @@ buildUi() { cd ./web/ui/dashboard || exit 1 # Install dependencies - npm ci + npm i # Run production build if [[ "$build" == "ce" ]]; then diff --git a/worker/task/testdata/Config/basic-convoy.json b/worker/task/testdata/Config/basic-convoy.json index ab2f3fbcba..28e491efa4 100644 --- a/worker/task/testdata/Config/basic-convoy.json +++ b/worker/task/testdata/Config/basic-convoy.json @@ -47,12 +47,5 @@ "username": "apikey", "password": "", "from": "support@frain.dev" - }, - "search": { - "type": "typesense", - "typesense": { - "host": "http://localhost:8108", - "api_key": "convoy" - } } }