Skip to content

Commit

Permalink
Issue #94 Make sure the right HTTP status of the update command is re…
Browse files Browse the repository at this point in the history
…ported

- Update Dockerfile to build from master (relevant for osio)
  • Loading branch information
hferentschik committed Feb 8, 2018
1 parent 20de243 commit f63b70e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions scripts/webhook-migration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ ENV ORG=github.com/fabric8-services
ENV REPO=$ORG/fabric8-jenkins-proxy
ENV BUILD_DIR=$GOPATH/src/$REPO
RUN mkdir -p $GOPATH/src/$ORG
RUN git clone https://github.com/hferentschik/fabric8-jenkins-proxy $BUILD_DIR
RUN cd $BUILD_DIR && git checkout issue-94 && git rev-parse --short HEAD && make osio
RUN git clone https://$REPO $BUILD_DIR
RUN cd $BUILD_DIR && git rev-parse --short HEAD && make osio

COPY updateWebhooks.sh /usr/local/bin/updateWebhooks.sh

Expand Down
7 changes: 3 additions & 4 deletions scripts/webhook-migration/updateWebhooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,9 @@ updateGitHubWebhooks() {
--data '{"config": {"url": "'${JENKINS_PROXY_URL}'github-webhook/"}}' https://api.github.com/repos/${REPOS[$i]}/hooks/${id}
echo " "
else
response=$(curl -sgSL -H "Authorization: token ${GITHUB_TOKENS[$i]}" -X PATCH \
--data '{"config": {"url": "'${JENKINS_PROXY_URL}'github-webhook/"}}' \
https://api.github.com/repos/${REPOS[$i]}/hooks/${id} | \
jq -r '.last_response.message')
response=$(curl -sgSL -H "Authorization: token ${GITHUB_TOKENS[$i]}" -o /dev/null -w "%{http_code}" \
-X PATCH --data '{"config": {"url": "'${JENKINS_PROXY_URL}'github-webhook/"}}' \
https://api.github.com/repos/${REPOS[$i]}/hooks/${id})
echo "${url} updated. Status: $response"
fi
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/webhook-migration/webhook-migration.job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ parameters:
- name: IMAGE
value: hferentschik/webhook-migration
- name: IMAGE_TAG
value: 1.0.0
value: 1.0.2
- name: TARGET_ENV
value: "stage"
- name: DRY_RUN
Expand Down

0 comments on commit f63b70e

Please sign in to comment.