Skip to content

Commit

Permalink
Merge pull request #330 from cloudfoundry/fix-ci-scripts
Browse files Browse the repository at this point in the history
Fix ci scripts
  • Loading branch information
MarcPaquette authored Dec 21, 2023
2 parents 0c24909 + 3e68655 commit 861e755
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ the bottom-right corner. Place the `fly` binary somewhere on your `$PATH`.

- `./scripts/create-docker-container.bash`: This will create a docker container with mounts for running linter and templates tests
- `./scripts/fly/build-binaries.bash`: This will build binaries required for testing garden-runc-release
- `./scripts/fly/test.bash`: This will test a specific package e.g. './scripts/fly/test.bash src/grootfs'
- `./scripts/fly/test.bash`: This will test a specific package e.g. './scripts/fly/test.bash grootfs'
- `./scripts/fly/test-all.bash`: This will test all packages.
- `./scripts/test-in-docker-locally.bash`: This will only test templates and linters

Expand Down
4 changes: 2 additions & 2 deletions scripts/create-docker-container.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ docker rm -f $CONTAINER_NAME
docker run -it \
--env "REPO_NAME=$REPO_NAME" \
--env "REPO_PATH=/repo" \
--env "GARDEN_TEST_ROOTFS=/artifacts/garden-runc-release-rootfs.tar" \
--env "GARDEN_FUSE_TEST_ROOTFS=/artifacts/garden-runc-release-fuse-rootfs.tar" \
--env "GARDEN_TEST_ROOTFS=/artifacts/garden-rootfs.tar" \
--env "GARDEN_FUSE_TEST_ROOTFS=/artifacts/garden-fuse.tar" \
--rm \
--name "$CONTAINER_NAME" \
-v "${REPO_PATH}:/repo" \
Expand Down
6 changes: 3 additions & 3 deletions scripts/fly/build-binaries.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ set -eu
set -o pipefail

THIS_FILE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
WORKSPACE_DIR="${THIS_FILE_DIR}/../.."
WORKSPACE_DIR="${THIS_FILE_DIR}/../../.."
BUILT_BINARIES="$WORKSPACE_DIR/built-binaries/garden-runc-release"
CI="${THIS_FILE_DIR}/../../wg-app-platform-runtime-ci"
CI="${WORKSPACE_DIR}/wg-app-platform-runtime-ci"
. "$CI/shared/helpers/git-helpers.bash"
REPO_NAME=$(git_get_remote_name)
REPO_PATH="${THIS_FILE_DIR}/../"
REPO_PATH="${THIS_FILE_DIR}/../../"
unset THIS_FILE_DIR

DEFAULT_PARAMS="ci/$REPO_NAME/default-params/build-binaries/linux.yml" "$CI/bin/fly-exec.bash" build-binaries -i repo="${REPO_PATH}" -o built-binaries="${BUILT_BINARIES}"
2 changes: 1 addition & 1 deletion scripts/fly/test-all.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ REPO_NAME=$(git_get_remote_name)

internal_repos=$(yq -r '.internal_repos|.[].name' "$CI/$REPO_NAME/index.yml")
for component in $internal_repos; do
"$THIS_FILE_DIR/test.bash" "src/${component}"
"$THIS_FILE_DIR/test.bash" "${component}"
done
16 changes: 10 additions & 6 deletions scripts/fly/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ set -eu
set -o pipefail

THIS_FILE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
WORKSPACE_DIR="${THIS_FILE_DIR}/../.."
WORKSPACE_DIR="${THIS_FILE_DIR}/../../.."
LOCATION="$WORKSPACE_DIR/artifacts"
BUILT_BINARIES="$WORKSPACE_DIR/built-binaries/garden-runc-release"
CI="${THIS_FILE_DIR}/../../wg-app-platform-runtime-ci"
CI="${WORKSPACE_DIR}/wg-app-platform-runtime-ci"
. "$CI/shared/helpers/git-helpers.bash"
REPO_NAME=$(git_get_remote_name)
REPO_PATH="${THIS_FILE_DIR}/../"
REPO_PATH="${THIS_FILE_DIR}/../../"
unset THIS_FILE_DIR

pushd $REPO_PATH > /dev/null
Expand All @@ -22,7 +22,11 @@ LOCATION=${LOCATION} make
popd

echo "Testing ${1}"
ENVS='GARDEN_TEST_ROOTFS=$PWD/input-01/garden-runc-release-rootfs.tar
GARDEN_FUSE_TEST_ROOTFS=$PWD/input-01/garden-runc-release-fuse-rootfs.tar' \
DIR=${1} \

ROOTFS_ENVS='GARDEN_TEST_ROOTFS=$PWD/input-01/garden-rootfs.tar
GARDEN_FUSE_TEST_ROOTFS=$PWD/input-01/garden-fuse.tar'

ENVS="$ROOTFS_ENVS
${ENVS:-}" \
DIR="src/${1}" \
"$CI/bin/fly-exec.bash" run-bin-test -i repo="${REPO_PATH}" -i built-binaries="${BUILT_BINARIES}" -i input-01="${LOCATION}" -p

0 comments on commit 861e755

Please sign in to comment.