Skip to content

Commit

Permalink
Merge pull request #140 from infrawatch/STF-1809/fix-integration-sg-b…
Browse files Browse the repository at this point in the history
…ridge-pull-same-branch

Fix git ls-remote command when running sg-bridge
  • Loading branch information
vkmc authored Sep 16, 2024
2 parents e0e07aa + a8f6ed4 commit e839a5c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ jobs:
id: bridge_branch
continue-on-error: true
run: |
echo "${GITHUB_REF#refs/heads/}"
git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo ${GITHUB_REF#refs/heads/})"
echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}")"
- name: Start sg-bridge from container image
if: steps.bridge_branch.outcome != 'success'
run: |
Expand All @@ -74,7 +74,7 @@ jobs:
if: steps.bridge_branch.outcome == 'success'
run: |
docker run --name=sgbridge --network host $BRIDGE_VOLUME -d -uroot \
-e GITHUB_REF -e BRIDGE_SOCKET -e QDR_CHANNEL -e OPSTOOLS_REPO \
-e GITHUB_HEAD_REF -e BRIDGE_SOCKET -e QDR_CHANNEL -e OPSTOOLS_REPO \
--workdir=$(dirname $BRIDGE_SOCKET) --volume ${{ github.workspace }}:$PROJECT_ROOT:z \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/run_bridge.sh
- name: Install collectd
Expand Down Expand Up @@ -158,8 +158,8 @@ jobs:
id: bridge_branch
continue-on-error: true
run: |
echo "${GITHUB_REF#refs/heads/}"
git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo ${GITHUB_REF#refs/heads/})"
echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}")"
- name: Start sg-bridge from container image
if: steps.bridge_branch.outcome != 'success'
run: |
Expand All @@ -170,7 +170,7 @@ jobs:
if: steps.bridge_branch.outcome == 'success'
run: |
docker run --name=sgbridge --network host $BRIDGE_VOLUME -d -uroot \
-e GITHUB_REF -e BRIDGE_SOCKET -e QDR_CHANNEL -e OPSTOOLS_REPO \
-e GITHUB_HEAD_REF -e BRIDGE_SOCKET -e QDR_CHANNEL -e OPSTOOLS_REPO \
--workdir=$(dirname $BRIDGE_SOCKET) --volume ${{ github.workspace }}:$PROJECT_ROOT:z \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/metrics/run_bridge.sh
- name: Set Ceilometer pipelines to QDR output and restart notification agent
Expand Down Expand Up @@ -323,8 +323,8 @@ jobs:
id: bridge_branch
continue-on-error: true
run: |
echo "${GITHUB_REF#refs/heads/}"
git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo ${GITHUB_REF#refs/heads/})"
echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}")"
- name: Start sg-bridge from container image
if: steps.bridge_branch.outcome != 'success'
run: |
Expand All @@ -334,7 +334,7 @@ jobs:
if: steps.bridge_branch.outcome == 'success'
run: |
docker run --name=sgbridge $BRIDGE_VOLUME -d -uroot --network host -e OPSTOOLS_REPO \
-e GITHUB_REF -e BRIDGE_SOCKET --workdir=$(dirname $BRIDGE_SOCKET) --volume ${{ github.workspace }}:$PROJECT_ROOT:z \
-e GITHUB_HEAD_REF -e BRIDGE_SOCKET --workdir=$(dirname $BRIDGE_SOCKET) --volume ${{ github.workspace }}:$PROJECT_ROOT:z \
$TEST_IMAGE bash $PROJECT_ROOT/ci/integration/logging/run_bridge.sh
- name: Run rsyslog to produce log messages
run: |
Expand Down
2 changes: 1 addition & 1 deletion ci/integration/logging/run_bridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-OpsTools.repo
dnf install -y git gcc make qpid-proton-c-devel redhat-rpm-config

# install and start sg-bridge
BRANCH="$(echo ${GITHUB_REF#refs/heads/})"
BRANCH="$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}})"
git clone https://github.com/infrawatch/sg-bridge.git
pushd sg-bridge
git checkout $BRANCH || true
Expand Down
2 changes: 1 addition & 1 deletion ci/integration/metrics/run_bridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-OpsTools.repo
dnf install -y git gcc make qpid-proton-c-devel redhat-rpm-config

# install and start sg-bridge
BRANCH="$(echo ${GITHUB_REF#refs/heads/})"
BRANCH="$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}})"
git clone https://github.com/infrawatch/sg-bridge.git
pushd sg-bridge
git checkout $BRANCH || true
Expand Down

0 comments on commit e839a5c

Please sign in to comment.