From 6fb231eef034fa38d932d21a14c99a9ed5782bc0 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Thu, 29 Aug 2024 15:47:32 -0400 Subject: [PATCH 01/30] centralizing actions --- .github/workflows/build-push-dev-image.yml | 66 +----------- .github/workflows/build-push-release.yml | 116 +-------------------- .github/workflows/build-test.yml | 20 +--- 3 files changed, 6 insertions(+), 196 deletions(-) diff --git a/.github/workflows/build-push-dev-image.yml b/.github/workflows/build-push-dev-image.yml index 2015c87..1f9438f 100644 --- a/.github/workflows/build-push-dev-image.yml +++ b/.github/workflows/build-push-dev-image.yml @@ -22,67 +22,5 @@ on: - '*' jobs: build-push-dev-image: - runs-on: ubuntu-latest - steps: - - - name: Checkout Code - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - - name: Set short git commit SHA - id: vars - run: | - echo "short_sha=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT - # https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ - - - name: Confirm git commit SHA output - run: echo ${{ steps.vars.outputs.short_sha }} - - - name: Echo BINARY_NAME set in Makefile - id: BINARY_NAME - run: | - make echo >> $GITHUB_OUTPUT - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - logout: true - - - name: Login to Container Registry - uses: docker/login-action@v3 - with: - registry: containers.renci.org - username: ${{ secrets.CONTAINERHUB_USERNAME }} - password: ${{ secrets.CONTAINERHUB_TOKEN }} - logout: true - - - # Notes on Cache: - # https://docs.docker.com/build/ci/github-actions/examples/#inline-cache - - name: Build Push Container - uses: docker/build-push-action@v5 - with: - build-args: BINARY_NAME=${{ steps.BINARY_NAME.outputs.BINARY_NAME }} - context: . - push: true - # Push to renci-registry and dockerhub here. - # cache comes from dockerhub. - tags: | - ${{ github.repository }}:develop - ${{ github.repository }}:${{ steps.vars.outputs.short_sha }} - containers.renci.org/${{ github.repository }}:develop - containers.renci.org/${{ github.repository }}:${{ steps.vars.outputs.short_sha }} - cache-from: type=registry,ref=${{ github.repository }}:buildcache-dev - cache-to: type=registry,ref=${{ github.repository }}:buildcache-dev,mode=max + uses: helxplatform/helx-github-actions/.github/workflows/build-push-dev-image.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/build-push-release.yml b/.github/workflows/build-push-release.yml index 8d05c02..be4eb97 100644 --- a/.github/workflows/build-push-release.yml +++ b/.github/workflows/build-push-release.yml @@ -21,117 +21,5 @@ on: - 'v[0-9]+.[0-9]+.*' jobs: build-push-release: - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - - name: Set short git commit SHA - id: vars - run: | - echo "short_sha=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT - # https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ - - - name: Echo BINARY_NAME set in Makefile - id: BINARY_NAME - run: | - make echo >> $GITHUB_OUTPUT - - - name: Confirm git commit SHA output - run: echo ${{ steps.vars.outputs.short_sha }} - - # https://github.com/marketplace/actions/git-semantic-version - - name: Semver Check - uses: paulhatch/semantic-version@v5.0.3 - id: version - with: - # The prefix to use to identify tags - tag_prefix: "v" - # A string which, if present in a git commit, indicates that a change represents a - # major (breaking) change, supports regular expressions wrapped with '/' - major_pattern: "/breaking|major/" - # A string which indicates the flags used by the `major_pattern` regular expression. Supported flags: idgs - major_regexp_flags: "ig" - # Same as above except indicating a minor change, supports regular expressions wrapped with '/' - minor_pattern: "/feat|feature|minor/" - # A string which indicates the flags used by the `minor_pattern` regular expression. Supported flags: idgs - minor_regexp_flags: "ig" - # A string to determine the format of the version output - # version_format: "${major}.${minor}.${patch}-prerelease${increment}" - version_format: "${major}.${minor}.${patch}" - search_commit_body: false - - # Docker Buildx is important to caching in the Build And Push Container - # step - # https://github.com/marketplace/actions/build-and-push-docker-images - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - logout: true - - - name: Login to Container Registry - uses: docker/login-action@v3 - with: - registry: containers.renci.org - username: ${{ secrets.CONTAINERHUB_USERNAME }} - password: ${{ secrets.CONTAINERHUB_TOKEN }} - logout: true - - # Notes on Cache: - # https://docs.docker.com/build/ci/github-actions/examples/#inline-cache - - name: Build Push Container - uses: docker/build-push-action@v5 - with: - build-args: BINARY_NAME=${{ steps.BINARY_NAME.outputs.BINARY_NAME }} - push: true - # Push to renci-registry and dockerhub here. - # cache comes from dockerhub. - tags: | - containers.renci.org/${{ github.repository }}:v${{ steps.version.outputs.version }} - containers.renci.org/${{ github.repository }}:latest - containers.renci.org/${{ github.repository }}:${{ steps.vars.outputs.short_sha }} - ${{ github.repository }}:v${{ steps.version.outputs.version }} - ${{ github.repository }}:latest - ${{ github.repository }}:${{ steps.vars.outputs.short_sha }} - cache-from: type=registry,ref=${{ github.repository }}:buildcache-release - cache-to: type=registry,ref=${{ github.repository }}:buildcache-release,mode=max - -#==========================TAG & RELEASE W/ NOTES ========================= - - # Note: GITHUB_TOKEN is autogenerated feature of github app - # which is auto-enabled when using github actions. - # https://docs.github.com/en/actions/security-guides/automatic-token-authentication - # https://docs.github.com/en/rest/git/tags?apiVersion=2022-11-28#create-a-tag-object - # https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28#create-a-reference - # This creates a "lightweight" ref tag. - - name: Create Tag for Release - run: | - curl \ - -s --fail -X POST \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/git/refs \ - -d '{"ref":"refs/tags/v${{ steps.version.outputs.version }}","sha":"${{ github.sha }}"}' - -# https://cli.github.com/manual/gh_release_create - - name: Create Release - env: - RELEASE_VERSION: ${{ steps.version.outputs.version }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release create ${{ env.RELEASE_VERSION }} \ - -t "${{ env.RELEASE_VERSION }}" \ - --generate-notes \ - --latest \ No newline at end of file + uses: helxplatform/helx-github-actions/.github/workflows/build-push-release.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e01e130..98e6b70 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -3,21 +3,5 @@ on: [push] jobs: build-test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - - name: Install dependencies - run: go get . - - # Ideally we would also use golangci-lint tool - - name: Run Go fmt, vet, test - run: make test - - - name: Build - run: make build + uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@main + secrets: inherit \ No newline at end of file From 79c585039b2f1852345df1af1ac5c86f3a9f5d32 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 21:30:47 -0400 Subject: [PATCH 02/30] crazy test --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 98e6b70..41a4566 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -3,5 +3,5 @@ on: [push] jobs: build-test: - uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@main + uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@testforgittea secrets: inherit \ No newline at end of file From f8cd19fcd75a77196c5751399b98645c932c6ca6 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 21:36:34 -0400 Subject: [PATCH 03/30] ahh --- .github/workflows/build-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 41a4566..0ec4a78 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,6 +1,7 @@ name: build-test on: [push] + jobs: build-test: uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@testforgittea From 904354b6f7da9d598000c784bbad188a32e171e4 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 21:44:06 -0400 Subject: [PATCH 04/30] anotha --- .github/workflows/build-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 0ec4a78..41a4566 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,7 +1,6 @@ name: build-test on: [push] - jobs: build-test: uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@testforgittea From 4de53606964c1d1124b8be2c1ea91c65aa25fdbd Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 21:47:48 -0400 Subject: [PATCH 05/30] anotha --- .github/workflows/build-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 41a4566..ae6c62b 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,6 +1,5 @@ name: build-test on: [push] - jobs: build-test: uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@testforgittea From a25225d982f69166472e1a15ff84a68bc2df5473 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 21:50:29 -0400 Subject: [PATCH 06/30] added dispatch --- .github/workflows/build-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index ae6c62b..bbd31b9 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,5 +1,8 @@ name: build-test -on: [push] +on: + # [push] + workflow_dispatch: + jobs: build-test: uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@testforgittea From 37e598d90efd8b2cde8a8732c4a5476b505d76d5 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 21:51:10 -0400 Subject: [PATCH 07/30] added dispatch --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index bbd31b9..ca6a326 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,6 +1,6 @@ name: build-test on: - # [push] + push: workflow_dispatch: jobs: From c842e1ab2c7706706ece76d994b790919ff40e59 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 21:58:06 -0400 Subject: [PATCH 08/30] added dispatch --- .github/workflows/build-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index ca6a326..b8a4857 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -3,6 +3,7 @@ on: push: workflow_dispatch: + jobs: build-test: uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@testforgittea From c6072ec4255590ec2d9c7b4dcecd4ca3b748653c Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 22:03:00 -0400 Subject: [PATCH 09/30] changed binary --- .github/workflows/build-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b8a4857..ca6a326 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -3,7 +3,6 @@ on: push: workflow_dispatch: - jobs: build-test: uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@testforgittea From e50bf1a0b0dae67afd5b1e910b83b7948b5c6ea7 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 22:12:41 -0400 Subject: [PATCH 10/30] ugh --- .github/workflows/build-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index ca6a326..b8a4857 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -3,6 +3,7 @@ on: push: workflow_dispatch: + jobs: build-test: uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@testforgittea From c9b97055aa4726371d45d69df33408672ca4aa82 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 22:18:57 -0400 Subject: [PATCH 11/30] uh --- Dockerfile | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index c0ea387..31aa647 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,55 @@ +# # Use the official Golang image to build the binary +# FROM golang:1.20 AS build +# ENV CGO_ENABLED 0 +# ARG BINARY_NAME +# # Set the working directory +# WORKDIR /app + +# # Copy the Go source files, Makefile, etc. +# COPY . . + +# # Build the Go application passing BINARY_NAME from Makefile (local development) +# # or Github Action Build-Arg. +# RUN go build -o ${BINARY_NAME} + +# # Using a multi-stage build +# FROM alpine:3.18 +# ARG BINARY_NAME + +# # Ensure we have a valid user and group +# RUN addgroup -g 1000 -S assistant && \ +# adduser -u 1000 -G assistant -S assistant + +# COPY --from=build --chown=assistant:assistant /app/${BINARY_NAME} /app/ +# # Expose port 8080 +# EXPOSE 8080 + +# WORKDIR /app + +# # Run the compiled binary +# CMD ["./assistant"] + # Use the official Golang image to build the binary FROM golang:1.20 AS build ENV CGO_ENABLED 0 -ARG BINARY_NAME + # Set the working directory WORKDIR /app # Copy the Go source files, Makefile, etc. COPY . . -# Build the Go application passing BINARY_NAME from Makefile (local development) -# or Github Action Build-Arg. -RUN go build -o ${BINARY_NAME} +# Build the Go application +RUN go build -o assistant # Using a multi-stage build FROM alpine:3.18 -ARG BINARY_NAME # Ensure we have a valid user and group RUN addgroup -g 1000 -S assistant && \ adduser -u 1000 -G assistant -S assistant -COPY --from=build --chown=assistant:assistant /app/${BINARY_NAME} /app/ +COPY --from=build --chown=assistant:assistant /app/assistant /app/ # Expose port 8080 EXPOSE 8080 @@ -28,3 +57,4 @@ WORKDIR /app # Run the compiled binary CMD ["./assistant"] + From 482032b7f2c4660200d6139292d9004e4cb59d7a Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 22:23:10 -0400 Subject: [PATCH 12/30] changed to main --- .github/workflows/build-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b8a4857..36e5ecf 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -3,8 +3,8 @@ on: push: workflow_dispatch: - + jobs: build-test: - uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@testforgittea + uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@main secrets: inherit \ No newline at end of file From 7030a0df775a71799fda94cc1fbac0a8416f0743 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 22:26:30 -0400 Subject: [PATCH 13/30] updated docker legacy key --- Dockerfile | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/Dockerfile b/Dockerfile index 31aa647..9bdfc34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,37 +1,6 @@ -# # Use the official Golang image to build the binary -# FROM golang:1.20 AS build -# ENV CGO_ENABLED 0 -# ARG BINARY_NAME -# # Set the working directory -# WORKDIR /app - -# # Copy the Go source files, Makefile, etc. -# COPY . . - -# # Build the Go application passing BINARY_NAME from Makefile (local development) -# # or Github Action Build-Arg. -# RUN go build -o ${BINARY_NAME} - -# # Using a multi-stage build -# FROM alpine:3.18 -# ARG BINARY_NAME - -# # Ensure we have a valid user and group -# RUN addgroup -g 1000 -S assistant && \ -# adduser -u 1000 -G assistant -S assistant - -# COPY --from=build --chown=assistant:assistant /app/${BINARY_NAME} /app/ -# # Expose port 8080 -# EXPOSE 8080 - -# WORKDIR /app - -# # Run the compiled binary -# CMD ["./assistant"] - # Use the official Golang image to build the binary FROM golang:1.20 AS build -ENV CGO_ENABLED 0 +ENV CGO_ENABLED = 0 # Set the working directory WORKDIR /app From 6483b4e792a73396e24caf139ef8da52fedfe2c8 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Wed, 4 Sep 2024 22:29:52 -0400 Subject: [PATCH 14/30] removed dispatch --- .github/workflows/build-test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 36e5ecf..acd338e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,8 +1,6 @@ name: build-test on: push: - workflow_dispatch: - jobs: build-test: From 0e33d3f41cb5ffb0154315af05d16b929f58c6fa Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Thu, 24 Oct 2024 20:51:59 -0400 Subject: [PATCH 15/30] ug --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index acd338e..ea41893 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -4,5 +4,5 @@ on: jobs: build-test: - uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@main + uses: helxplatform/helx-github-actions/.github/workflows/build-test.yml@testforgittea secrets: inherit \ No newline at end of file From afc43d62cd5fc1bd55ae931b069dd1a9e04e863f Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 16:19:13 -0400 Subject: [PATCH 16/30] quick test --- .github/workflows/build-push-dev-image.yml | 20 ++++++++++---------- Dockerfile | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-push-dev-image.yml b/.github/workflows/build-push-dev-image.yml index 1f9438f..d9a145f 100644 --- a/.github/workflows/build-push-dev-image.yml +++ b/.github/workflows/build-push-dev-image.yml @@ -5,16 +5,16 @@ name: Build-Push-Dev-Image on: push: - branches: - - develop - paths-ignore: - - README.md - - .github/* - - .github/workflows/* - - LICENSE - - .gitignore - - .dockerignore - - .githooks + # branches: + # - develop + # paths-ignore: + # - README.md + # - .github/* + # - .github/workflows/* + # - LICENSE + # - .gitignore + # - .dockerignore + # - .githooks # Do not build another image on a pull request. # Any push to develop will trigger a new build however. pull_request: diff --git a/Dockerfile b/Dockerfile index 9bdfc34..a2e274a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use the official Golang image to build the binary -FROM golang:1.20 AS build +FROM golang:1.23 AS build ENV CGO_ENABLED = 0 # Set the working directory From b31e302828552b26c940425b419c30f07e38c83d Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 16:25:18 -0400 Subject: [PATCH 17/30] legacy docker code update? --- .github/workflows/build-push-dev-image.yml | 20 ++++++++++---------- Dockerfile | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-push-dev-image.yml b/.github/workflows/build-push-dev-image.yml index d9a145f..1f9438f 100644 --- a/.github/workflows/build-push-dev-image.yml +++ b/.github/workflows/build-push-dev-image.yml @@ -5,16 +5,16 @@ name: Build-Push-Dev-Image on: push: - # branches: - # - develop - # paths-ignore: - # - README.md - # - .github/* - # - .github/workflows/* - # - LICENSE - # - .gitignore - # - .dockerignore - # - .githooks + branches: + - develop + paths-ignore: + - README.md + - .github/* + - .github/workflows/* + - LICENSE + - .gitignore + - .dockerignore + - .githooks # Do not build another image on a pull request. # Any push to develop will trigger a new build however. pull_request: diff --git a/Dockerfile b/Dockerfile index a2e274a..d0ec25f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Use the official Golang image to build the binary FROM golang:1.23 AS build -ENV CGO_ENABLED = 0 +ENV CGO_ENABLED=0 # Set the working directory WORKDIR /app From 733beb5e76ad6850fa530b20854f9daaebe3ed1f Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 16:47:17 -0400 Subject: [PATCH 18/30] test --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d0ec25f..4c81d5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Use the official Golang image to build the binary FROM golang:1.23 AS build ENV CGO_ENABLED=0 - +ARG BINARY_NAME # Set the working directory WORKDIR /app From 14a0c8201005029e8715a0f6df4d1b3bbb38ceeb Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 16:53:31 -0400 Subject: [PATCH 19/30] make --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4c81d5b..518b3d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ WORKDIR /app COPY . . # Build the Go application -RUN go build -o assistant +RUN go build -o ${BINARY_NAME} # Using a multi-stage build FROM alpine:3.18 From 733a0cf9f15b0d9dffccd5fb921ee02f757291bc Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 16:57:35 -0400 Subject: [PATCH 20/30] again --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 518b3d1..0169add 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ COPY . . # Build the Go application RUN go build -o ${BINARY_NAME} +# RUN go build -o assistant # Using a multi-stage build FROM alpine:3.18 @@ -18,7 +19,8 @@ FROM alpine:3.18 RUN addgroup -g 1000 -S assistant && \ adduser -u 1000 -G assistant -S assistant -COPY --from=build --chown=assistant:assistant /app/assistant /app/ +# COPY --from=build --chown=assistant:assistant /app/assistant /app/ +COPY --from=build --chown=assistant:assistant /app/${BINARY_NAME} /app/ # Expose port 8080 EXPOSE 8080 From 3157ee20d8f17cb9fe47b82ee0c9591df14d7234 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 17:04:36 -0400 Subject: [PATCH 21/30] test binary --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3315fdc..5b063c9 100644 --- a/Makefile +++ b/Makefile @@ -42,4 +42,4 @@ clean: @echo "Cleaning up..." rm -f $(BINARY_NAME) -.PHONY: build test docker-build clean +.PHONY: build test docker-build clean \ No newline at end of file From 9a36d59e7c84f7f0ba60c7f2386275be6248204c Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 17:08:41 -0400 Subject: [PATCH 22/30] again --- .github/workflows/build-push-dev-image.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-push-dev-image.yml b/.github/workflows/build-push-dev-image.yml index 1f9438f..0eafcb4 100644 --- a/.github/workflows/build-push-dev-image.yml +++ b/.github/workflows/build-push-dev-image.yml @@ -1,7 +1,6 @@ # Workflow responsible for the # development release processes. # - name: Build-Push-Dev-Image on: push: From 55c797094926f0ea03a7892daebc5d076c507d99 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 17:11:18 -0400 Subject: [PATCH 23/30] yo --- .github/workflows/build-push-dev-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-push-dev-image.yml b/.github/workflows/build-push-dev-image.yml index 0eafcb4..37ec76d 100644 --- a/.github/workflows/build-push-dev-image.yml +++ b/.github/workflows/build-push-dev-image.yml @@ -1,6 +1,6 @@ # Workflow responsible for the # development release processes. -# + name: Build-Push-Dev-Image on: push: From 18b8d226824e8565d81a4e2ed0418f5be444dcee Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 17:20:13 -0400 Subject: [PATCH 24/30] work --- .github/workflows/build-push-dev-image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-push-dev-image.yml b/.github/workflows/build-push-dev-image.yml index 37ec76d..8d710a5 100644 --- a/.github/workflows/build-push-dev-image.yml +++ b/.github/workflows/build-push-dev-image.yml @@ -1,6 +1,7 @@ # Workflow responsible for the # development release processes. + name: Build-Push-Dev-Image on: push: From 5c92249d8f901ae2af4268d410e04451d94febaa Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 17:22:35 -0400 Subject: [PATCH 25/30] not sure --- .github/workflows/build-push-dev-image.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-push-dev-image.yml b/.github/workflows/build-push-dev-image.yml index 8d710a5..61a4c76 100644 --- a/.github/workflows/build-push-dev-image.yml +++ b/.github/workflows/build-push-dev-image.yml @@ -1,7 +1,5 @@ # Workflow responsible for the # development release processes. - - name: Build-Push-Dev-Image on: push: From 10569ebb9d369f74e86d2fa15a137166f4b5b037 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 17:28:57 -0400 Subject: [PATCH 26/30] idek --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0169add..5622767 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,8 @@ WORKDIR /app COPY . . # Build the Go application -RUN go build -o ${BINARY_NAME} +# RUN go build -o ${BINARY_NAME} +RUN make build # RUN go build -o assistant # Using a multi-stage build From 16eee145346548c70bb90f8b01c6b97072f1db33 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Tue, 29 Oct 2024 17:36:21 -0400 Subject: [PATCH 27/30] reverting --- Dockerfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5622767..65d9cdb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Use the official Golang image to build the binary FROM golang:1.23 AS build ENV CGO_ENABLED=0 -ARG BINARY_NAME + # Set the working directory WORKDIR /app @@ -9,9 +9,7 @@ WORKDIR /app COPY . . # Build the Go application -# RUN go build -o ${BINARY_NAME} -RUN make build -# RUN go build -o assistant +RUN go build -o assistant # Using a multi-stage build FROM alpine:3.18 @@ -20,8 +18,8 @@ FROM alpine:3.18 RUN addgroup -g 1000 -S assistant && \ adduser -u 1000 -G assistant -S assistant -# COPY --from=build --chown=assistant:assistant /app/assistant /app/ -COPY --from=build --chown=assistant:assistant /app/${BINARY_NAME} /app/ +COPY --from=build --chown=assistant:assistant /app/assistant /app/ + # Expose port 8080 EXPOSE 8080 From a5cd22c8b49f838170d6d4e7ef49f296d51edee9 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Fri, 8 Nov 2024 16:07:23 -0500 Subject: [PATCH 28/30] now main --- .DS_Store | Bin 0 -> 6148 bytes .github/workflows/build-test.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..2992cbbfcb27c79b51a06ae18d938bfdb562d0d0 GIT binary patch literal 6148 zcmeHKOHKko5UrLm5>ewq6Wq-SR8}tBj09JHHXK0Z69xke;p2vdlXweb;t})+uDFLD zg!rnv!EOdnH^yjJ()DJltES#OGTk&0iG073BibaQGzO!$3OB=eo=3u#bYu%C4cG{&v@Cmnu}H8#2G&79yQSEmtf@&9^})wr3^c|H< Date: Tue, 12 Nov 2024 22:00:16 -0500 Subject: [PATCH 29/30] Update Makefile arg --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5b063c9..5759cfe 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,6 @@ docker-build: build @echo "Building Docker container..." docker build \ --platform=linux/amd64 \ - --build-arg=BINARY_NAME=$(BINARY_NAME) \ --tag=$(REGISTRY_NAME)/$(CONTAINER_NAME) \ . @@ -42,4 +41,4 @@ clean: @echo "Cleaning up..." rm -f $(BINARY_NAME) -.PHONY: build test docker-build clean \ No newline at end of file +.PHONY: build test docker-build clean From 0efd5de9d1c8859a0955e0a7f1777ab11de34d03 Mon Sep 17 00:00:00 2001 From: Patrick Hachicho Date: Sun, 17 Nov 2024 22:30:38 -0500 Subject: [PATCH 30/30] made sure everything up to date --- .github/workflows/build-push-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-push-release.yml b/.github/workflows/build-push-release.yml index be4eb97..2d801a5 100644 --- a/.github/workflows/build-push-release.yml +++ b/.github/workflows/build-push-release.yml @@ -1,7 +1,5 @@ # Workflow responsible for the # major release processes. -# - name: Build-Push-Release on: push: