Skip to content

Commit 7655fc4

Browse files
committed
refactor debug steps for token verification and packaging process
1 parent 258ceff commit 7655fc4

1 file changed

Lines changed: 29 additions & 40 deletions

File tree

.github/workflows/build-citus-community-nightlies.yml

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -60,55 +60,44 @@ jobs:
6060
username: ${{ secrets.DOCKERHUB_USER_NAME }}
6161
password: ${{ secrets.DOCKERHUB_PASSWORD }}
6262

63-
- name: "Debug: Confirm token can access repos and git auth works"
64-
run: |
65-
echo "GH_TOKEN present: ${GH_TOKEN:+yes}"
66-
echo "GH_TOKEN length: $(echo -n "$GH_TOKEN" | wc -c)"
67-
68-
packaging_status=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token $GH_TOKEN" https://api.github.com/repos/citusdata/packaging)
69-
echo "packaging repo status: $packaging_status"
70-
docker_status=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token $GH_TOKEN" https://api.github.com/repos/citusdata/docker)
71-
echo "docker repo status: $docker_status"
72-
73-
if [[ "$packaging_status" != "200" ]]; then
74-
echo "ERROR: packaging repo access failed with status $packaging_status"
75-
exit 1
76-
fi
77-
if [[ "$docker_status" != "200" ]]; then
78-
echo "ERROR: docker repo access failed with status $docker_status"
79-
exit 1
80-
fi
81-
82-
if git ls-remote --exit-code "https://github.com/citusdata/packaging.git" HEAD >/dev/null 2>&1; then
83-
echo "git auth (ls-remote) succeeded"
84-
else
85-
echo "git auth (ls-remote) FAILED"
86-
exit 1
87-
fi
88-
89-
- name: "Debug: Verify git config url rewrite is active"
90-
run: git config --global --get-regexp url.*insteadOf | sed -E 's@(https://x-access-token:)[^@]*@\1REDACTED@' || true
91-
92-
- name: "Debug: Test token access from inside container"
93-
run: |
94-
docker run --rm -e GITHUB_TOKEN="$GH_TOKEN" citus/packaging-test:debian-trixie-all sh -c "curl -s -o /dev/null -w 'Container API status: %{http_code}\n' -H 'Authorization: token \$GITHUB_TOKEN' https://api.github.com/repos/citusdata/packaging"
95-
9663
- name: Clone build branch
9764
run: git clone -b "${MAIN_BRANCH}" --depth=1 https://github.com/citusdata/packaging.git packaging
9865

99-
- name: "Debug: Confirm clone succeeded and files are present"
100-
run: |
101-
echo "packaging dir listing:"
102-
ls -la packaging || true
103-
echo "templates docker listing:"
104-
find packaging -maxdepth 4 -type f -name '*docker*' -print || true
105-
10666
- name: Install package dependencies
10767
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
10868

10969
- name: Install python requirements
11070
run: python -m pip install -r tools/packaging_automation/requirements.txt
11171

72+
- name: "Debug: run packaging image the same way (capture logs)"
73+
run: |
74+
mkdir -p container_logs
75+
docker run --rm \
76+
-v "$(pwd)/packages":/packages \
77+
-v "$(pwd)/packaging":/buildfiles:ro \
78+
-e GITHUB_TOKEN \
79+
-e PACKAGE_ENCRYPTION_KEY="${PACKAGING_SECRET_KEY}" \
80+
-e UNENCRYPTED_PACKAGE="" \
81+
-e CONTAINER_BUILD_RUN_ENABLED=true \
82+
-e MSRUSTUP_PAT \
83+
-e CRATES_IO_MIRROR_FEED_TOKEN \
84+
-e INSTALL_RUST \
85+
-e CI \
86+
-e PACKAGING_PASSPHRASE \
87+
citus/packaging-test:debian-trixie-all nightly \
88+
> container_logs/container.stdout 2> container_logs/container.stderr || true
89+
echo "---- container.stderr (first 200 lines) ----"
90+
sed -n '1,200p' container_logs/container.stderr || true
91+
echo "---- container.stdout (first 200 lines) ----"
92+
sed -n '1,200p' container_logs/container.stdout || true
93+
94+
- name: "Debug: Verify packaging dir contains expected inputs"
95+
run: |
96+
echo "Searching for key packaging files:"
97+
find packaging -maxdepth 4 -type f \( -name 'pkgvars' -o -name 'postgres-matrix.yml' -o -name 'supported-postgres' \) -print || true
98+
echo "Packaging directory structure:"
99+
ls -la packaging/ || true
100+
112101
- name: Build packages
113102
run: |
114103
python -m tools.packaging_automation.citus_package \

0 commit comments

Comments
 (0)