Skip to content

Commit

Permalink
Bump senzing-factory/build-resources from 1 to 2 (#52)
Browse files Browse the repository at this point in the history
* Bump senzing-factory/build-resources from 1 to 2

Bumps [senzing-factory/build-resources](https://github.com/senzing-factory/build-resources) from 1 to 2.
- [Release notes](https://github.com/senzing-factory/build-resources/releases)
- [Changelog](https://github.com/senzing-factory/build-resources/blob/main/CHANGELOG.md)
- [Commits](senzing-factory/build-resources@v1...v2)

---
updated-dependencies:
- dependency-name: senzing-factory/build-resources
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix linting

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sam <109683132+kernelsam@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and kernelsam authored Jun 1, 2024
1 parent b1cd293 commit 1dc993a
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 56 deletions.
2 changes: 2 additions & 0 deletions .github/linters/.checkov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
quiet: true
skip-check: CKV_DOCKER_7
3 changes: 3 additions & 0 deletions .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"threshold": 3
}
2 changes: 1 addition & 1 deletion .github/workflows/add-labels-standardized.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
secrets:
ORG_MEMBERSHIP_TOKEN: ${{ secrets.ORG_MEMBERSHIP_TOKEN }}
SENZING_MEMBERS: ${{ secrets.SENZING_MEMBERS }}
uses: senzing-factory/build-resources/.github/workflows/add-labels-to-issue.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/add-labels-to-issue.yaml@v2
2 changes: 1 addition & 1 deletion .github/workflows/add-to-project-garage-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
add-to-project-dependabot:
secrets:
SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/add-to-project-dependabot.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/add-to-project-dependabot.yaml@v2
with:
project: ${{ vars.SENZING_PROJECT_GARAGE }}
2 changes: 1 addition & 1 deletion .github/workflows/add-to-project-garage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
add-to-project:
secrets:
SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/add-to-project.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/add-to-project.yaml@v2
with:
classic: false
project-number: ${{ vars.SENZING_PROJECT_GARAGE }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/dependabot-approve-and-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ on:
pull_request:
branches: [main]

permissions:
contents: write
pull-requests: write

jobs:
dependabot-approve-and-merge:
permissions:
contents: write
pull-requests: write
secrets:
SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN: ${{ secrets.SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/dependabot-approve-and-merge.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/dependabot-approve-and-merge.yaml@v2
3 changes: 3 additions & 0 deletions .github/workflows/docker-build-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
workflow_dispatch:

permissions:
contents: read

jobs:
docker-build-container:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docker-push-containers-to-dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: read

jobs:
docker-push-containers-to-dockerhub:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gofmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ permissions:

jobs:
gofmt:
uses: senzing-factory/build-resources/.github/workflows/gofmt.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/gofmt.yaml@v2
2 changes: 1 addition & 1 deletion .github/workflows/lint-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ permissions:

jobs:
lint-workflows:
uses: senzing-factory/build-resources/.github/workflows/lint-workflows.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/lint-workflows.yaml@v2
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 @@ -11,7 +11,7 @@ permissions:

jobs:
make-go-github-file:
uses: senzing-factory/build-resources/.github/workflows/make-go-github-file.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/make-go-github-file.yaml@v2
secrets:
SENZING_GITHUB_ACTOR: ${{ secrets.SENZING_GITHUB_ACTOR }}
SENZING_GITHUB_GPG_PASSPHRASE: ${{ secrets.SENZING_GITHUB_GPG_PASSPHRASE }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/move-pr-to-done-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
move-pr-to-done-dependabot:
secrets:
SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/move-pr-to-done-dependabot.yaml@v1
uses: senzing-factory/build-resources/.github/workflows/move-pr-to-done-dependabot.yaml@v2
with:
project: ${{ vars.SENZING_PROJECT_GARAGE }}
50 changes: 27 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ FROM ${IMAGE_FINAL} as senzingapi_runtime
FROM ${IMAGE_GO_BUILDER} as go_builder
ENV REFRESHED_AT=2024-02-07
LABEL Name="senzing/demo-quickstart-builder" \
Maintainer="support@senzing.com" \
Version="0.0.4"
Maintainer="support@senzing.com" \
Version="0.0.4"

# Copy local files from the Git repository.

Expand All @@ -43,7 +43,7 @@ RUN make build
# Copy binaries to /output.

RUN mkdir -p /output \
&& cp -R ${GOPATH}/src/demo-quickstart/target/* /output/
&& cp -R ${GOPATH}/src/demo-quickstart/target/* /output/

# -----------------------------------------------------------------------------
# Stage: final
Expand All @@ -52,8 +52,8 @@ RUN mkdir -p /output \
FROM ${IMAGE_FINAL} as final
ENV REFRESHED_AT=2024-02-07
LABEL Name="senzing/demo-quickstart" \
Maintainer="support@senzing.com" \
Version="0.0.1"
Maintainer="support@senzing.com" \
Version="0.0.1"

# Copy local files from the Git repository.

Expand All @@ -63,34 +63,38 @@ COPY ./rootfs /

COPY --from=go_builder "/output/linux/demo-quickstart" "/app/demo-quickstart"

# Install packages via apt.
# Install packages via apt-get.

RUN export STAT_TMP=$(stat --format=%a /tmp) \
&& chmod 777 /tmp \
&& apt update \
&& apt -y install \
gnupg2 \
jq \
libodbc1 \
postgresql-client \
supervisor \
unixodbc \
&& chmod ${STAT_TMP} /tmp \
&& rm -rf /var/lib/apt/lists/*
&& chmod 777 /tmp \
&& apt-get update \
&& apt-get -y install \
gnupg2 \
jq \
libodbc1 \
postgresql-client \
supervisor \
unixodbc \
&& chmod ${STAT_TMP} /tmp \
&& rm -rf /var/lib/apt/lists/*

# Install Java-11.

RUN mkdir -p /etc/apt/keyrings \
&& wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public > /etc/apt/keyrings/adoptium.asc
&& wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public > /etc/apt/keyrings/adoptium.asc

RUN echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" >> /etc/apt/sources.list

RUN export STAT_TMP=$(stat --format=%a /tmp) \
&& chmod 777 /tmp \
&& apt update \
&& apt -y install temurin-11-jdk \
&& chmod ${STAT_TMP} /tmp \
&& rm -rf /var/lib/apt/lists/*
&& chmod 777 /tmp \
&& apt-get update \
&& apt-get -y install temurin-11-jdk \
&& chmod ${STAT_TMP} /tmp \
&& rm -rf /var/lib/apt/lists/*

HEALTHCHECK CMD ["/app/healthcheck.sh"]

USER 1001

# Runtime environment variables.

Expand Down
48 changes: 26 additions & 22 deletions package.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ FROM ${IMAGE_SENZINGAPI_RUNTIME} as senzingapi_runtime
FROM ${IMAGE_GO_BUILDER} as go_builder
ENV REFRESHED_AT=2023-08-01
LABEL Name="senzing/demo-quickstart-builder" \
Maintainer="support@senzing.com" \
Version="0.2.0"
Maintainer="support@senzing.com" \
Version="0.2.0"

# Build arguments.

Expand All @@ -48,7 +48,7 @@ RUN make linux/amd64
# 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: fpm_builder
Expand All @@ -59,8 +59,8 @@ RUN mkdir -p /output \
FROM ${IMAGE_FPM_BUILDER} as fpm_builder
ENV REFRESHED_AT=2023-08-01
LABEL Name="senzing/demo-quickstart-fpm-builder" \
Maintainer="support@senzing.com" \
Version="0.2.0"
Maintainer="support@senzing.com" \
Version="0.2.0"

# Use arguments from prior stage.

Expand All @@ -76,25 +76,25 @@ COPY --from=go_builder "/output/linux-amd64/*" "/output/linux-amd64/"
# Create Linux RPM package.

RUN fpm \
--input-type dir \
--output-type rpm \
--name ${PROGRAM_NAME} \
--package /output/${PROGRAM_NAME}-${BUILD_VERSION}.rpm \
--version ${BUILD_VERSION} \
--iteration ${BUILD_ITERATION} \
/output/linux-amd64/=/usr/bin
--input-type dir \
--output-type rpm \
--name ${PROGRAM_NAME} \
--package /output/${PROGRAM_NAME}-${BUILD_VERSION}.rpm \
--version ${BUILD_VERSION} \
--iteration ${BUILD_ITERATION} \
/output/linux-amd64/=/usr/bin

# Create Linux DEB package.

RUN fpm \
--deb-no-default-config-files \
--input-type dir \
--iteration ${BUILD_ITERATION} \
--name ${PROGRAM_NAME} \
--output-type deb \
--package /output/${PROGRAM_NAME}-${BUILD_VERSION}.deb \
--version ${BUILD_VERSION} \
/output/linux-amd64/=/usr/bin
--deb-no-default-config-files \
--input-type dir \
--iteration ${BUILD_ITERATION} \
--name ${PROGRAM_NAME} \
--output-type deb \
--package /output/${PROGRAM_NAME}-${BUILD_VERSION}.deb \
--version ${BUILD_VERSION} \
/output/linux-amd64/=/usr/bin

# -----------------------------------------------------------------------------
# Stage: final
Expand All @@ -103,8 +103,8 @@ RUN fpm \
FROM ${IMAGE_FINAL} as final
ENV REFRESHED_AT=2023-08-01
LABEL Name="senzing/demo-quickstart" \
Maintainer="support@senzing.com" \
Version="0.2.0"
Maintainer="support@senzing.com" \
Version="0.2.0"

# Use arguments from prior stage.

Expand All @@ -115,4 +115,8 @@ ARG PROGRAM_NAME
COPY --from=fpm_builder "/output/*" "/output/"
COPY --from=fpm_builder "/output/linux-amd64/${PROGRAM_NAME}" "/output/linux-amd64/${PROGRAM_NAME}"

HEALTHCHECK CMD ["/app/healthcheck.sh"]

USER 1001

CMD ["/bin/bash"]
12 changes: 12 additions & 0 deletions rootfs/app/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# Return codes.

OK=0
NOT_OK=1

# Tests.

echo "Doing healthtest."

exit ${OK}

0 comments on commit 1dc993a

Please sign in to comment.