Skip to content

Commit

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

* #157 Savepoint

* #157 Savepoint

* #157 Improve documentation

* #157 Improve documentation

* #157 Improve documentation

* #157 Refactor package target

* #157 Refactor package target

* #157 CHANGE DYLD_LIBRARY_PATH

* #157 Savepoint

* Savepoint

* #157 Adjust variables

* #157 Adjust variables

* #157 Adjust variables

* #157 Adjust variables

* #157 Adjust variables

* #157 Adjust variables

* #157 Adjust variables

* #157 Adjust variables

* #157 CHANGE DYLD_LIBRARY_PATH

* #157 CHANGE DYLD_LIBRARY_PATH

* #157 CHANGE DYLD_LIBRARY_PATH

* #157 CHANGE DYLD_LIBRARY_PATH

* #157 CHANGE DYLD_LIBRARY_PATH

* #157 Refactor to template

* #157 Update dependencies

* #157 Prepare for versioned release
  • Loading branch information
docktermj authored Aug 3, 2023
1 parent daf9af0 commit abfcf63
Show file tree
Hide file tree
Showing 28 changed files with 416 additions and 197 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
GITHUB_TOKEN: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }}
CREATOR: ${{ github.event.pull_request.user.login }}
jobs:
assign_one_project:
add-dependabot-request-to-project:
name: Add dependabot pull request to Senzing Community project
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/add-issue-to-project-t-comm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
env:
GITHUB_TOKEN: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }}
jobs:
assign_one_project:
add-issue-to-project:
name: Add issue to Senzing Community project
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/add-triage-label.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- reopened
- opened
jobs:
automate-issues-labels:
add-triage-label:
name: Add triage label to issue
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build-docker-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
- main
workflow_dispatch:
jobs:
buildDockerContainer:
name: Build Docker container
build-docker-container:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
name: dependabot-approve-and-merge.yaml

name: 'dependabot automation'

on:
on:
pull_request:
branches: [main]

Expand All @@ -13,4 +12,4 @@ jobs:
pull-requests: write
uses: Senzing/build-resources/.github/workflows/dependabot-approve-and-merge.yaml@main
secrets:
SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN: ${{ secrets.SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN }}
SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN: ${{ secrets.SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/go-proxy-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
build:
name: Renew documentation
go-proxy-pull:
runs-on: ubuntu-latest
steps:
- name: Pull new module version
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Based on
# -https://github.com/marketplace/actions/setup-go-environment
# - https://github.com/marketplace/actions/setup-go-environment

name: go-test.yaml

Expand Down Expand Up @@ -40,10 +40,3 @@ jobs:
- run: mkdir /tmp/sqlite
- run: cp testdata/sqlite/G2C.db /tmp/sqlite/G2C.db
- run: go test -v -p 1 ./...
# - run: go test -v ./.
# - run: go test -v ./g2configserver
# - run: go test -v ./g2configmgrserver
# - run: go test -v ./g2diagnosticserver
# - run: go test -v ./g2engineserver
# - run: go test -v ./g2productserver
# - run: go test -v ./grpcserver
7 changes: 3 additions & 4 deletions .github/workflows/go.yaml → .github/workflows/gofmt.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
name: gofmt.yaml

name: 'go'

on:
pull_request:
branches: [main]

jobs:
gofmt:
uses: Senzing/build-resources/.github/workflows/gofmt.yaml@main
uses: Senzing/build-resources/.github/workflows/gofmt.yaml@main
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Based on
# - https://github.com/securego/gosec

name: go-security.yaml
name: gosec.yaml
on:
push:
branches:
Expand All @@ -10,7 +10,7 @@ on:
branches:
- main
jobs:
tests:
gosec:
runs-on: ubuntu-latest
env:
GO111MODULE: on
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/identify-customer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
MEMBER_LIST: ${{ secrets.SENZING_MEMBERS }}
CREATOR: ${{ github.actor }}
jobs:
automate-issues-labels:
identify-customer:
name: Add customer-submission label
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/make-go-github-file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
build:
make-go-github-file:
name: Update cmd/version.go
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/make-go-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
build:
make-go-tag:
name: Make a vM.m.P tag
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---

name: 'pr closed automation'
name: move-pr-to-done.yaml

on:
pull_request:
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@

# Dependency directories (remove the comment below to include it)
# vendor/

.history
target

target/
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

-

## [0.4.12] - 2023-08-03

### Changed in 0.4.12

- Update dependencies
- github.com/senzing/go-cmdhelping v0.1.4
- github.com/senzing/go-common v0.2.8
- Refactored to template for multi-platform

## [0.4.11] - 2023-07-25

### Changed in 0.4.11
Expand Down
45 changes: 24 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@
# Stages
# -----------------------------------------------------------------------------

# ARG IMAGE_GO_BUILDER=golang:1.20.5@sha256:6b3fa4b908676231b50acbbc00e84d8cee9c6ce072b1175c0ff352c57d8a612f - Bad
ARG IMAGE_GO_BUILDER=golang:1.20.4@sha256:690e4135bf2a4571a572bfd5ddfa806b1cb9c3dea0446ebadaf32bc2ea09d4f9
ARG IMAGE_SENZINGAPI_RUNTIME=senzing/senzingapi-runtime:3.6.0
ARG IMAGE_GO_BUILDER=golang:1.20.4
ARG IMAGE_FINAL=senzing/senzingapi-runtime:3.6.0

# -----------------------------------------------------------------------------
# Stage: senzingapi_runtime
# -----------------------------------------------------------------------------

FROM ${IMAGE_SENZINGAPI_RUNTIME} as senzingapi_runtime

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

FROM ${IMAGE_GO_BUILDER} as go_builder
ENV REFRESHED_AT=2023-07-17
ENV REFRESHED_AT=2023-08-01
LABEL Name="senzing/serve-grpc-builder" \
Maintainer="support@senzing.com" \
Version="0.4.9"
Expand All @@ -23,52 +29,49 @@ ARG BUILD_VERSION=0.0.0
ARG BUILD_ITERATION=0
ARG GO_PACKAGE_NAME="unknown"

# Copy remote files from DockerHub.

COPY --from=senzing/senzingapi-runtime:3.6.0 "/opt/senzing/g2/lib/" "/opt/senzing/g2/lib/"
COPY --from=senzing/senzingapi-runtime:3.6.0 "/opt/senzing/g2/sdk/c/" "/opt/senzing/g2/sdk/c/"

# Copy local files from the Git repository.

COPY ./rootfs /
COPY . ${GOPATH}/src/${GO_PACKAGE_NAME}

# Build go program.
# Copy files from prior stage.

WORKDIR ${GOPATH}/src/${GO_PACKAGE_NAME}
RUN make build
COPY --from=senzingapi_runtime "/opt/senzing/g2/lib/" "/opt/senzing/g2/lib/"
COPY --from=senzingapi_runtime "/opt/senzing/g2/sdk/c/" "/opt/senzing/g2/sdk/c/"

# --- Test go program ---------------------------------------------------------
# Set path to Senzing libs.

ENV LD_LIBRARY_PATH=/opt/senzing/g2/lib/

# Run unit tests.
# Build go program.

# RUN go get github.com/jstemmer/go-junit-report \
# && mkdir -p /output/go-junit-report \
# && go test -v ${GO_PACKAGE_NAME}/... | go-junit-report > /output/go-junit-report/test-report.xml
WORKDIR ${GOPATH}/src/${GO_PACKAGE_NAME}
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_PACKAGE_NAME}/target/* /output/

# -----------------------------------------------------------------------------
# Stage: final
# -----------------------------------------------------------------------------

FROM ${IMAGE_FINAL} as final
ENV REFRESHED_AT=2023-07-17
ENV REFRESHED_AT=2023-08-01
LABEL Name="senzing/serve-grpc" \
Maintainer="support@senzing.com" \
Version="0.4.9"

# Copy files from repository.
# Copy local files from the Git repository.

COPY ./rootfs /
COPY ./testdata/senzing-license/g2.lic /etc/opt/senzing/g2.lic
COPY ./testdata/sqlite/G2C.db /tmp/sqlite/G2C.db

# Copy files from prior step.
# Copy files from prior stage.

COPY --from=go_builder "/output/linux/serve-grpc" "/app/serve-grpc"
COPY --from=go_builder "/output/linux-amd64/serve-grpc" "/app/serve-grpc"

# Runtime environment variables.

Expand Down
Loading

0 comments on commit abfcf63

Please sign in to comment.