Skip to content

Commit

Permalink
59.dockter.1 (#64)
Browse files Browse the repository at this point in the history
* #59 Update dependencies

* #59 Prepare for versioned release
  • Loading branch information
docktermj authored Oct 18, 2023
1 parent 5da686f commit 106fb41
Show file tree
Hide file tree
Showing 16 changed files with 166 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
# - https://github.com/srggrs/assign-one-project-github-action

name: add-dependabot-request-to-project-t-comm.yaml

on:
pull_request:
types:
- opened
- reopened

env:
GITHUB_TOKEN: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }}
CREATOR: ${{ github.event.pull_request.user.login }}

jobs:
add-dependabot-request-to-project:
name: Add dependabot pull request to Senzing Community project
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/add-issue-to-project-t-comm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
# - https://github.com/srggrs/assign-one-project-github-action

name: add-issue-to-project-t-comm.yaml

on:
issues:
types:
- reopened
- opened

env:
GITHUB_TOKEN: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }}

jobs:
add-issue-to-project:
name: Add issue to Senzing Community project
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/add-triage-label.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# - https://github.com/andymckay/labeler

name: add-triage-label.yaml

on:
issues:
types:
- reopened
- opened

jobs:
add-triage-label:
name: Add triage label to issue
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/go-test-darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ name: go-test-darwin.yaml
on: [push]

jobs:
build:
runs-on: macos-latest
go-test-darwin:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
name: Go ${{ matrix.go }} - darwin
os: [macos-latest]
name: "go test with OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/go-test-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ name: go-test-linux.yaml
on: [push]

jobs:
build:
runs-on: ubuntu-latest
go-test-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
name: Go ${{ matrix.go }} - linux
os: [ubuntu-latest]
name: "go test with OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/go-test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ name: go-test-windows.yaml
on: [push]

jobs:
build:
runs-on: windows-latest
go-test-windows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
name: Go ${{ matrix.go }} - windows
os: [windows-latest]
name: "go test with OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/gosec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
# - https://github.com/securego/gosec

name: gosec.yaml

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
gosec:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/identify-customer.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: identify-customer.yaml

on:
issues:
types:
- opened

env:
GITHUB_TOKEN: ${{ secrets.ORG_MEMBERSHIP_TOKEN }}
MEMBER_LIST: ${{ secrets.SENZING_MEMBERS }}
CREATOR: ${{ github.actor }}

jobs:
identify-customer:
name: Add customer-submission label
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

-

## [0.1.4] - 2023-10-18

### Changed in 0.1.4

- Refactor to [template-go](https://github.com/Senzing/template-go)
- Update dependencies
- github.com/aws/aws-sdk-go-v2 v1.21.2
- github.com/aws/aws-sdk-go-v2/config v1.19.0
- github.com/aws/aws-sdk-go-v2/service/sqs v1.24.7
- github.com/rabbitmq/amqp091-go v1.9.0
- github.com/senzing/g2-sdk-go v0.7.4
- github.com/senzing/go-common v0.3.1
- github.com/senzing/go-logging v1.3.3

## [0.1.3] - 2023-08-16

### Changed in 0.1.3
Expand Down
17 changes: 5 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,32 @@
# -----------------------------------------------------------------------------

ARG IMAGE_GO_BUILDER=golang:1.21.0-bullseye
ARG IMAGE_FINAL=senzing/senzingapi-runtime:3.6.0
ARG IMAGE_FINAL=senzing/senzingapi-runtime:3.7.1

# -----------------------------------------------------------------------------
# Stage: go_builder
# -----------------------------------------------------------------------------

FROM ${IMAGE_GO_BUILDER} as go_builder
ENV REFRESHED_AT=2023-08-01
ENV REFRESHED_AT=2023-10-02
LABEL Name="senzing/go-queueing-builder" \
Maintainer="support@senzing.com" \
Version="0.0.5"

# Build arguments.

ARG PROGRAM_NAME="unknown"
ARG BUILD_VERSION=0.0.0
ARG BUILD_ITERATION=0
ARG GO_PACKAGE_NAME="unknown"

# Copy local files from the Git repository.

COPY ./rootfs /
COPY . ${GOPATH}/src/${GO_PACKAGE_NAME}
COPY . ${GOPATH}/src/go-queueing

# Build go program.

WORKDIR ${GOPATH}/src/${GO_PACKAGE_NAME}
WORKDIR ${GOPATH}/src/go-queueing
RUN make build

# Copy binaries to /output.

RUN mkdir -p /output \
&& cp -R ${GOPATH}/src/${GO_PACKAGE_NAME}/target/* /output/
&& cp -R ${GOPATH}/src/go-queueing/target/* /output/

# -----------------------------------------------------------------------------
# Stage: final
Expand Down
37 changes: 17 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ GO_PACKAGE_NAME := $(shell echo $(GIT_REMOTE_URL) | sed -e 's|^git@github.com:|g

# Recursive assignment ('=')

CC = gcc
GO_OSARCH = $(subst /, ,$@)
GO_OS = $(word 1, $(GO_OSARCH))
GO_ARCH = $(word 2, $(GO_OSARCH))
Expand Down Expand Up @@ -55,6 +54,10 @@ default: help
-include Makefile.$(OSTYPE)
-include Makefile.$(OSTYPE)_$(OSARCH)


.PHONY: hello-world
hello-world: hello-world-osarch-specific

# -----------------------------------------------------------------------------
# Dependency management
# -----------------------------------------------------------------------------
Expand All @@ -67,17 +70,19 @@ dependencies:

# -----------------------------------------------------------------------------
# Build
# - The "build" target is implemented in Makefile.OS.ARCH files.
# - docker-build: https://docs.docker.com/engine/reference/commandline/build/
# -----------------------------------------------------------------------------

PLATFORMS := darwin/amd64 linux/amd64 windows/amd64
$(PLATFORMS):
@echo Building $(TARGET_DIRECTORY)/$(GO_OS)-$(GO_ARCH)/$(PROGRAM_NAME)
@mkdir -p $(TARGET_DIRECTORY)/$(GO_OS)-$(GO_ARCH) || true
@GOOS=$(GO_OS) GOARCH=$(GO_ARCH) go build -o $(TARGET_DIRECTORY)/$(GO_OS)-$(GO_ARCH)/$(PROGRAM_NAME)


.PHONY: build
build: build-osarch-specific


.PHONY: build-all $(PLATFORMS)
build-all: $(PLATFORMS)
@mv $(TARGET_DIRECTORY)/windows-amd64/$(PROGRAM_NAME) $(TARGET_DIRECTORY)/windows-amd64/$(PROGRAM_NAME).exe
Expand All @@ -86,11 +91,6 @@ build-all: $(PLATFORMS)
.PHONY: docker-build
docker-build:
@docker build \
--build-arg BUILD_ITERATION=$(BUILD_ITERATION) \
--build-arg BUILD_VERSION=$(BUILD_VERSION) \
--build-arg GO_PACKAGE_NAME=$(GO_PACKAGE_NAME) \
--build-arg PROGRAM_NAME=$(PROGRAM_NAME) \
--file Dockerfile \
--tag $(DOCKER_IMAGE_NAME) \
--tag $(DOCKER_IMAGE_NAME):$(BUILD_VERSION) \
.
Expand All @@ -100,8 +100,7 @@ docker-build:
# -----------------------------------------------------------------------------

.PHONY: test
test:
@go test -v -p 1 ./...
test: test-osarch-specific

# -----------------------------------------------------------------------------
# Run
Expand All @@ -111,18 +110,17 @@ test:
docker-run:
@docker run \
--interactive \
--rm \
--tty \
--name $(DOCKER_CONTAINER_NAME) \
$(DOCKER_IMAGE_NAME)


.PHONY: run
run:
@go run main.go
run: run-osarch-specific

# -----------------------------------------------------------------------------
# Package
# - The "package" target is implemented in Makefile.OS.ARCH files.
# -----------------------------------------------------------------------------

.PHONY: docker-build-package
Expand All @@ -137,18 +135,18 @@ docker-build-package:
--tag $(DOCKER_BUILD_IMAGE_NAME) \
.


.PHONY: package
package: package-osarch-specific

# -----------------------------------------------------------------------------
# Utility targets
# -----------------------------------------------------------------------------

.PHONY: clean
clean:
clean: clean-osarch-specific
@go clean -cache
@go clean -testcache
@docker rm --force $(DOCKER_CONTAINER_NAME) 2> /dev/null || true
@docker rmi --force $(DOCKER_IMAGE_NAME) $(DOCKER_BUILD_IMAGE_NAME) 2> /dev/null || true
@rm -rf $(TARGET_DIRECTORY) || true
@rm -f $(GOPATH)/bin/$(PROGRAM_NAME) || true


.PHONY: help
Expand All @@ -166,8 +164,7 @@ print-make-variables:


.PHONY: setup
setup:
@echo "No setup required."
setup: setup-osarch-specific


.PHONY: update-pkg-cache
Expand Down
44 changes: 37 additions & 7 deletions Makefile.darwin
Original file line number Diff line number Diff line change
@@ -1,19 +1,49 @@
# Makefile extensions for darwin.

# -----------------------------------------------------------------------------
# Makefile targets supported by all platforms.
# Variables
# -----------------------------------------------------------------------------

.PHONY: hello-world
hello-world:
@echo "Hello World, from darwin."
SENZING_DIR ?= /opt/senzing/g2
SENZING_TOOLS_SENZING_DIRECTORY ?= $(SENZING_DIR)

LD_LIBRARY_PATH := $(SENZING_TOOLS_SENZING_DIRECTORY)/lib:$(SENZING_TOOLS_SENZING_DIRECTORY)/lib/macos
DYLD_LIBRARY_PATH := $(LD_LIBRARY_PATH)

# -----------------------------------------------------------------------------
# Build
# OS-ARCH specific targets
# -----------------------------------------------------------------------------

.PHONY: build
build: darwin/amd64
.PHONY: build-osarch-specific
build-osarch-specific: darwin/amd64


.PHONY: clean-osarch-specific
clean-osarch-specific:
@docker rm --force $(DOCKER_CONTAINER_NAME) 2> /dev/null || true
@docker rmi --force $(DOCKER_IMAGE_NAME) $(DOCKER_BUILD_IMAGE_NAME) 2> /dev/null || true
@rm -rf $(TARGET_DIRECTORY) || true
@rm -f $(GOPATH)/bin/$(PROGRAM_NAME) || true


.PHONY: hello-world-osarch-specific
hello-world-osarch-specific:
@echo "Hello World, from darwin."


.PHONY: run-osarch-specific
run-osarch-specific:
@go run -exec macos_exec_dyld.sh main.go


.PHONY: setup-osarch-specific
setup-osarch-specific:
@echo "No setup required."


.PHONY: test-osarch-specific
test-osarch-specific:
@go test -exec macos_exec_dyld.sh -v -p 1 ./...

# -----------------------------------------------------------------------------
# Makefile targets supported only by this platform.
Expand Down
Loading

0 comments on commit 106fb41

Please sign in to comment.