Skip to content

Commit

Permalink
Merge pull request #8 from xmidt-org/add-extras
Browse files Browse the repository at this point in the history
Add extra files so docker can have access to them.
  • Loading branch information
schmidtw authored Apr 11, 2023
2 parents 33a5751 + 83ec5d5 commit fabd325
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 19 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ on:
type: boolean
default: false

release-docker-extras:
description: "Provides a way to set the `extra_files` field with the list of files/dirs to make available."
required: false
type: string

release-docker-file:
description: "Set to the docker file and path if you don't want the default of `Dockerfile` in the project root."
required: false
Expand Down Expand Up @@ -696,6 +701,15 @@ jobs:
fi
gecho " dockerfile: '${{ inputs.release-docker-file }}'"
extras='${{ inputs.release-docker-extras }}'
if [[ ! -z "${extras}" ]]; then
gecho " extra_files:"
extras=$(echo "${extras}" | sed -e 's/[\r\n\t]/ /g' | tr "," "\n")
for extra in $extras
do
gecho " - ${extra}"
done
fi
gecho ""
- name: Generate the arm64 docker .goreleaser.yml section
Expand Down Expand Up @@ -739,6 +753,15 @@ jobs:
fi
gecho " dockerfile: '${{ inputs.release-docker-file }}'"
extras='${{ inputs.release-docker-extras }}'
if [[ ! -z "${extras}" ]]; then
gecho " extra_files:"
extras=$(echo "${extras}" | sed -e 's/[\r\n\t]/ /g' | tr "," "\n")
for extra in $extras
do
gecho " - ${extra}"
done
fi
gecho ""
- name: Show the .goreleaser.yml file
Expand Down
43 changes: 24 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,32 +68,37 @@ jobs:
if: |
startsWith(github.ref, 'refs/tags/') == false
with:
license-skip: true
release-skip-publish: --skip-publish
working-directory: program
release-type: program
release-docker: true
license-skip: true
release-skip-publish: --skip-publish
working-directory: program
release-type: program
release-docker: true
release-docker-extras: |
main.go
secrets: inherit

program-tag:
uses: ./.github/workflows/ci.yml
if: |
startsWith(github.ref, 'refs/tags/')
with:
copyright-skip: true
build-skip: true
lint-skip: true
license-skip: true
style-skip: true
#tests-skip: true
release-skip-publish: --skip-publish
release-binary-name: programtest
working-directory: program
release-type: program
release-docker: true
release-docker-latest: true
release-docker-major: true
release-docker-minor: true
copyright-skip: true
build-skip: true
lint-skip: true
license-skip: true
style-skip: true
#tests-skip: true
release-skip-publish: --skip-publish
release-binary-name: programtest
working-directory: program
release-type: program
release-docker: true
release-docker-latest: true
release-docker-major: true
release-docker-minor: true
release-docker-extras: |
main.go
go.mod
secrets: inherit


Expand Down
1 change: 1 addition & 0 deletions program/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
FROM scratch
ENTRYPOINT ["/programtest"]
COPY programtest /
COPY main.go /

0 comments on commit fabd325

Please sign in to comment.