From ca9847eb741c583028381a115e69f6e95ec21552 Mon Sep 17 00:00:00 2001 From: Jason Collins Date: Tue, 14 Nov 2023 10:00:26 -0700 Subject: [PATCH] clean files --- .github/release.yml | 62 ---------------------------------- .goreleaser-da.yml | 60 --------------------------------- .goreleaser-ta.yml | 59 -------------------------------- Dockerfile | 38 --------------------- cmd/discovery/main.go | 16 --------- cmd/traceability/main.go | 16 --------- docker-compose.yml | 72 ---------------------------------------- 7 files changed, 323 deletions(-) delete mode 100644 .github/release.yml delete mode 100644 .goreleaser-da.yml delete mode 100644 .goreleaser-ta.yml delete mode 100644 Dockerfile delete mode 100644 cmd/discovery/main.go delete mode 100644 cmd/traceability/main.go delete mode 100644 docker-compose.yml diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index 060ed6d..0000000 --- a/.github/release.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Release agents with goreleaser -on: - push: - tags: - - v*.*.* - -jobs: - discovery: - runs-on: ubuntu-latest - name: Release discovery - defaults: - run: - working-directory: . - steps: - - uses: actions/checkout@v3 - - name: Unshallow Fetch - run: git fetch --prune --unshallow - - uses: actions/setup-go@v3 - with: - go-version: 1.21 - - name: Export SDK Version # exports the SDK_VERSION to be used by the goreleaser - run: echo "SDK_VERSION=$(make sdk-version)" >> $GITHUB_ENV - - name: Discovery Release - uses: goreleaser/goreleaser-action@v4.2.0 - with: - args: release -f .goreleaser-da.yml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - traceability: - runs-on: ubuntu-latest - name: Release traceability - defaults: - run: - working-directory: . - steps: - - uses: actions/checkout@v3 - - name: Unshallow Fetch - run: git fetch --prune --unshallow - - uses: actions/setup-go@v3 - with: - go-version: 1.21 - - name: Export SDK Version # exports the SDK_VERSION to be used by the goreleaser - run: echo "SDK_VERSION=$(make sdk-version)" >> $GITHUB_ENV - - name: Traceability Release - uses: goreleaser/goreleaser-action@v4.2.0 - with: - args: release -f .goreleaser-ta.yml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - notifyTeamsChannel: - needs: [discovery, traceability] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Notify Teams channel - env: - TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }} - TAG: ${{ github.ref_name }} - run: ./release.sh diff --git a/.goreleaser-da.yml b/.goreleaser-da.yml deleted file mode 100644 index 66e5b63..0000000 --- a/.goreleaser-da.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Documentation at http://goreleaser.com -before: - hooks: - - go mod download - - go mod tidy - -builds: - - id: kong_discovery_agent - binary: kong_discovery_agent - main: ./cmd/discovery/main.go - flags: - - -tags=static_all - - -a - ldflags: - - -X 'github.com/Axway/agent-sdk/pkg/cmd.BuildTime={{ .Date }}' - - -X 'github.com/Axway/agent-sdk/pkg/cmd.BuildVersion={{ .Version }}' - - -X 'github.com/Axway/agent-sdk/pkg/cmd.BuildCommitSha={{ .Commit }}' - - -X 'github.com/Axway/agent-sdk/pkg/cmd.BuildAgentName=KongDiscoveryAgent' - - -X 'github.com/Axway/agent-sdk/pkg/cmd.BuildAgentDescription=Kong Discovery Agent' - - -X 'github.com/Axway/agent-sdk/pkg/cmd.SDKBuildVersion={{ .Env.SDK_VERSION }}' - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin - ignore: - - goos: windows - goarch: arm64 - -archives: - - id: discovery_agent_archives - name_template: >- - kong_discovery_agent_{{ .Version }}_{{ .Os }}_ - {{- if eq .Arch "darwin" }}Darwin - {{- else if eq .Arch "linux" }}Linux - {{- else if eq .Arch "windows" }}Windows - {{- else if eq .Arch "386" }}i386 - {{- else if eq .Arch "amd64" }}x86_64 - {{- else }}{{ .Arch }}{{ end }} - wrap_in_directory: discovery_agent - files: - - README_discovery.md - - README_subscription.md - - src: build/kong_discovery_agent.yml - dst: . - strip_parent: true - -checksum: - name_template: "discovery_checksums.txt" - -snapshot: - name_template: "{{ .Tag }}-next" - -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' diff --git a/.goreleaser-ta.yml b/.goreleaser-ta.yml deleted file mode 100644 index d733a86..0000000 --- a/.goreleaser-ta.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Documentation at http://goreleaser.com -before: - hooks: - - go mod download - - go mod tidy - -builds: - - id: kong_traceability_agent - binary: kong_traceability_agent - main: ./cmd/traceability/main.go - flags: - - -tags=static_all - - -a - ldflags: - - -X 'github.com/Axway/agent-sdk/pkg/cmd.BuildTime={{ .Date }}' - - -X 'github.com/Axway/agent-sdk/pkg/cmd.BuildVersion={{ .Version }}' - - -X 'github.com/Axway/agent-sdk/pkg/cmd.BuildCommitSha={{ .Commit }}' - - -X 'github.com/Axway/agent-sdk/pkg/cmd.BuildAgentName=KongTraceabilityAgent' - - -X 'github.com/Axway/agent-sdk/pkg/cmd.BuildAgentDescription=Kong Traceability Agent' - - -X 'github.com/Axway/agent-sdk/pkg/cmd.SDKBuildVersion={{ .Env.SDK_VERSION }}' - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin - ignore: - - goos: windows - goarch: arm64 - -archives: - - id: traceability_agent_archives - name_template: >- - kong_traceability_agent_{{ .Version }}_{{ .Os }}_ - {{- if eq .Arch "darwin" }}Darwin - {{- else if eq .Arch "linux" }}Linux - {{- else if eq .Arch "windows" }}Windows - {{- else if eq .Arch "386" }}i386 - {{- else if eq .Arch "amd64" }}x86_64 - {{- else }}{{ .Arch }}{{ end }} - wrap_in_directory: traceability_agent - files: - - README_traceability.md - - src: build/kong_traceability_agent.yml - dst: . - strip_parent: true - -checksum: - name_template: "traceability_checksums.txt" - -snapshot: - name_template: "{{ .Tag }}-next" - -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 57fc715..0000000 --- a/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM beano.swf-artifactory.lab.phx.axway.int/beano-alpine-base:latest as builder - -RUN mkdir -p /go/src/git.ecd.axway.org/apigov/kong_traceability_agent - -WORKDIR /go/src/git.ecd.axway.org/apigov/kong_traceability_agent - -COPY . . - -RUN make build - -RUN ls -l bin/ - -# Create non-root user -RUN addgroup -g 2500 axway && adduser -u 2500 -D -G axway axway -RUN chown -R axway:axway /go/src/git.ecd.axway.org/apigov/kong_traceability_agent/bin/kong_traceability_agent -USER axway - -# alpine 3.12.0 -FROM docker.io/alpine@sha256:a15790640a6690aa1730c38cf0a440e2aa44aaca9b0e8931a9f2b0d7cc90fd65 - -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=builder /etc/passwd /etc/passwd -COPY --from=builder /go/src/git.ecd.axway.org/apigov/kong_traceability_agent/kong_traceability_agent.yml /kong_traceability_agent.yml -COPY --from=builder /go/src/git.ecd.axway.org/apigov/kong_traceability_agent/bin/kong_traceability_agent /kong_traceability_agent -COPY --from=builder /go/src/git.ecd.axway.org/apigov/kong_traceability_agent/private_key.pem private_key.pem -COPY --from=builder /go/src/git.ecd.axway.org/apigov/kong_traceability_agent/public_key.pem public_key.pem - -RUN mkdir /keys /data && \ - chown -R axway /data /keys /kong_traceability_agent.yml && \ - chmod go-w /kong_traceability_agent.yml - -RUN find / -perm /6000 -type f -exec chmod a-s {} \; || true - -USER axway - -VOLUME ["/keys"] - -ENTRYPOINT ["/kong_traceability_agent"] \ No newline at end of file diff --git a/cmd/discovery/main.go b/cmd/discovery/main.go deleted file mode 100644 index 475fb6f..0000000 --- a/cmd/discovery/main.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "github.com/Axway/agents-kong/pkg/cmd/discovery" -) - -func main() { - - if err := discovery.DiscoveryCmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } -} diff --git a/cmd/traceability/main.go b/cmd/traceability/main.go deleted file mode 100644 index c957c5f..0000000 --- a/cmd/traceability/main.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -import ( - "fmt" - "os" - - _ "github.com/Axway/agent-sdk/pkg/traceability" - "github.com/Axway/agents-kong/pkg/cmd/traceability" -) - -func main() { - if err := traceability.TraceCmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } -} diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 9f18ed1..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,72 +0,0 @@ -version: '3.7' - -services: - kong-db: - image: postgres:11 - environment: - POSTGRES_USER: kong - POSTGRES_DB: kong - POSTGRES_PASSWORD: kongpass - networks: - - kong-net - ports: - - "5432:5432" - kong-migration: -# image: kong:3.3.1 - image: kong:2.8.3 - command: kong migrations bootstrap - environment: - KONG_ADMIN_ACCESS_LOG: /dev/stdout - KONG_ADMIN_ERROR_LOG: /dev/stderr - KONG_ADMIN_LISTEN: '0.0.0.0:8001' - # KONG_DATABASE: "off" - KONG_DATABASE: postgres - KONG_PG_HOST: kong-db - KONG_PG_PASSWORD: kongpass - KONG_PASSWORD: test - # KONG_DECLARATIVE_CONFIG: /usr/local/kong/declarative/kong.yml - KONG_PROXY_ACCESS_LOG: /dev/stdout - KONG_PROXY_ERROR_LOG: /dev/stderr - networks: - - kong-net - depends_on: - - kong-db - kong: - image: kong:2.8.3 - environment: - KONG_ADMIN_ACCESS_LOG: /dev/stdout - KONG_ADMIN_ERROR_LOG: /dev/stderr - KONG_ADMIN_LISTEN: '0.0.0.0:8001' -# KONG_DATABASE: "off" - KONG_DATABASE: postgres - KONG_PG_HOST: kong-db - KONG_PG_PASSWORD: kongpass - KONG_PASSWORD: test -# KONG_DECLARATIVE_CONFIG: /usr/local/kong/declarative/kong.yml - KONG_PROXY_ACCESS_LOG: /dev/stdout - KONG_PROXY_ERROR_LOG: /dev/stderr -# volumes: -# - ./kong/:/usr/local/kong/declarative - networks: - - kong-net - ports: - - "8000:8000/tcp" - - "127.0.0.1:8001:8001/tcp" - - "8443:8443/tcp" - - "127.0.0.1:8444:8444/tcp" - healthcheck: - test: ["CMD", "kong", "health"] - interval: 10s - timeout: 10s - retries: 10 - restart: on-failure - deploy: - restart_policy: - condition: on-failure - depends_on: - - kong-db - - kong-migration - -networks: - kong-net: - external: false \ No newline at end of file