Skip to content

Commit

Permalink
Merge pull request #427 from paketo-community/pipeline-fix
Browse files Browse the repository at this point in the history
Testing pipeline builder fix
  • Loading branch information
dmikusa committed Apr 1, 2024
2 parents 52e0015 + 9d2c2a6 commit 3615878
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 22 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/pb-create-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
run: |
#!/usr/bin/env bash
set -euo pipefail
set -xeuo pipefail
# With Go 1.20, we need to set this so that we produce statically compiled binaries
#
Expand All @@ -117,21 +117,23 @@ jobs:
if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then
create-package \
--source ${SOURCE_PATH:-.} \
--source "${SOURCE_PATH:-.}" \
--cache-location "${HOME}"/carton-cache \
--destination "${HOME}"/buildpack \
--include-dependencies \
--version "${VERSION}"
else
create-package \
--source ${SOURCE_PATH:-.} \
--source "${SOURCE_PATH:-.}" \
--destination "${HOME}"/buildpack \
--version "${VERSION}"
fi
PACKAGE_FILE=${SOURCE_PATH:-.}/package.toml
[[ -e ${PACKAGE_FILE} ]] && cp ${PACKAGE_FILE} "${HOME}"/package.toml
printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}"/buildpack "${OS}" >> "${HOME}"/package.toml
PACKAGE_FILE="${SOURCE_PATH:-.}/package.toml"
if [ -f "${PACKAGE_FILE}" ]; then
cp "${PACKAGE_FILE}" "${HOME}/buildpack/package.toml"
printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}/buildpack" "${OS}" >> "${HOME}/buildpack/package.toml"
fi
env:
INCLUDE_DEPENDENCIES: "false"
OS: linux
Expand All @@ -142,12 +144,17 @@ jobs:
run: |-
#!/usr/bin/env bash
set -euo pipefail
set -xeuo pipefail
COMPILED_BUILDPACK="${HOME}/buildpack"
cp ~/package.toml ~/buildpack/package.toml
cd ~/buildpack
# create-package puts the buildpack here, we need to run from that directory
# for component buildpacks so that pack doesn't need a package.toml
cd "${COMPILED_BUILDPACK}"
CONFIG=""
if [ -f "${COMPILED_BUILDPACK}/package.toml" ]; then
CONFIG="--config ${COMPILED_BUILDPACK}/package.toml"
fi
PACKAGE_LIST=($PACKAGES)
# Extract first repo (Docker Hub) as the main to package & register
Expand Down
29 changes: 17 additions & 12 deletions .github/workflows/pb-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
run: |
#!/usr/bin/env bash
set -euo pipefail
set -xeuo pipefail
# With Go 1.20, we need to set this so that we produce statically compiled binaries
#
Expand All @@ -104,21 +104,23 @@ jobs:
if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then
create-package \
--source ${SOURCE_PATH:-.} \
--source "${SOURCE_PATH:-.}" \
--cache-location "${HOME}"/carton-cache \
--destination "${HOME}"/buildpack \
--include-dependencies \
--version "${VERSION}"
else
create-package \
--source ${SOURCE_PATH:-.} \
--source "${SOURCE_PATH:-.}" \
--destination "${HOME}"/buildpack \
--version "${VERSION}"
fi
PACKAGE_FILE=${SOURCE_PATH:-.}/package.toml
[[ -e ${PACKAGE_FILE} ]] && cp ${PACKAGE_FILE} "${HOME}"/package.toml
printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}"/buildpack "${OS}" >> "${HOME}"/package.toml
PACKAGE_FILE="${SOURCE_PATH:-.}/package.toml"
if [ -f "${PACKAGE_FILE}" ]; then
cp "${PACKAGE_FILE}" "${HOME}/buildpack/package.toml"
printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}/buildpack" "${OS}" >> "${HOME}/buildpack/package.toml"
fi
env:
INCLUDE_DEPENDENCIES: "true"
OS: linux
Expand All @@ -127,13 +129,16 @@ jobs:
run: |-
#!/usr/bin/env bash
set -euo pipefail
set -xeuo pipefail
COMPILED_BUILDPACK="${HOME}/buildpack"
CONFIG="--config "${HOME}"/package.toml"
#TODO with this, we don't need to use the package.toml, because pack exp. does not support it with multi arch yet
if ! [ -f "${PWD}/package.toml" ]; then
cd ~/buildpack
CONFIG=""
# create-package puts the buildpack here, we need to run from that directory
# for component buildpacks so that pack doesn't need a package.toml
cd "${COMPILED_BUILDPACK}"
CONFIG=""
if [ -f "${COMPILED_BUILDPACK}/package.toml" ]; then
CONFIG="--config ${COMPILED_BUILDPACK}/package.toml"
fi
PACKAGE_LIST=($PACKAGES)
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pb-update-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ jobs:
git add .github/
git add .gitignore
git add scripts/build.sh
if [ -f scripts/build.sh ]; then
git add scripts/build.sh
fi
git checkout -- .
Expand Down

0 comments on commit 3615878

Please sign in to comment.