Skip to content

Commit

Permalink
fix(manifest): fix manifest generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tkasparek authored and psegedy committed Jan 14, 2020
1 parent ce30cb7 commit 4731eb4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion evaluator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ADD /scripts/generate_rpm_list.sh /generate_rpm_list.sh
# make sure (redhat|centos|fedora)-release is always included in the manifest
RUN /generate_rpm_list.sh | grep -v -E "^(redhat|centos|fedora)-release" > /tmp/base_rpm_list.txt

RUN microdnf install python3 which shadow-utils && microdnf clean all
RUN microdnf install python3 which shadow-utils diffutils && microdnf clean all

WORKDIR /evaluator

Expand Down
2 changes: 1 addition & 1 deletion listener/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ADD /scripts/generate_rpm_list.sh /generate_rpm_list.sh
# make sure (redhat|centos|fedora)-release is always included in the manifest
RUN /generate_rpm_list.sh | grep -v -E "^(redhat|centos|fedora)-release" > /tmp/base_rpm_list.txt

RUN microdnf install python3 which shadow-utils file tar gzip && microdnf clean all
RUN microdnf install python3 which shadow-utils file tar gzip diffutils && microdnf clean all

WORKDIR /listener

Expand Down
2 changes: 1 addition & 1 deletion manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ADD /scripts/generate_rpm_list.sh /generate_rpm_list.sh
# make sure (redhat|centos|fedora)-release is always included in the manifest
RUN /generate_rpm_list.sh | grep -v -E "^(redhat|centos|fedora)-release" > /tmp/base_rpm_list.txt

RUN microdnf install python3 which shadow-utils && microdnf clean all
RUN microdnf install python3 which shadow-utils diffutils && microdnf clean all

RUN mkdir -p /tmp/prometheus_multiproc
ENV prometheus_multiproc_dir=/tmp/prometheus_multiproc
Expand Down
4 changes: 2 additions & 2 deletions scripts/push_manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ then
retry=0
until [ $retry -ge 5 ]
do
curl -H "Authorization: token $GIT_TOKEN" -X GET $API_ENDPOINT?ref=$GIT_BRANCH | python -c "import json,sys;a=json.load(sys.stdin);print(a.get('content',''))" | base64 -d | diff $SOURCE_FILE_PATH -
curl -H "Authorization: token $GIT_TOKEN" -X GET $API_ENDPOINT?ref=$GIT_BRANCH | python3 -c "import json,sys;a=json.load(sys.stdin);print(a.get('content',''))" | base64 -d | diff $SOURCE_FILE_PATH -
diff_rc=$?
if [ $diff_rc -eq 0 ]
then
echo "Remote manifest is already up to date!"
break
fi
# fetch remote file sha (if exists)
remote_file_sha=$(curl -H "Authorization: token $GIT_TOKEN" -X GET $API_ENDPOINT?ref=$GIT_BRANCH | python -c "import json,sys;a=json.load(sys.stdin);print(a.get('sha',''))")
remote_file_sha=$(curl -H "Authorization: token $GIT_TOKEN" -X GET $API_ENDPOINT?ref=$GIT_BRANCH | python3 -c "import json,sys;a=json.load(sys.stdin);print(a.get('sha',''))")
# insert or update file
echo "{\"message\": \"Updating $GIT_FILE_PATH\", \"branch\": \"$GIT_BRANCH\", \"sha\": \"$remote_file_sha\", \"content\": \"$(base64 -w 0 $SOURCE_FILE_PATH)\"}" > /tmp/commit_payload.json
new_commit_sha=$(curl -H "Authorization: token $GIT_TOKEN" -X PUT -d "@/tmp/commit_payload.json" $API_ENDPOINT | python -c "import json,sys;a=json.load(sys.stdin);print(a.get('commit',{}).get('sha',''))")
Expand Down
2 changes: 1 addition & 1 deletion vmaas_sync/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ADD /scripts/generate_rpm_list.sh /generate_rpm_list.sh
# make sure (redhat|centos|fedora)-release is always included in the manifest
RUN /generate_rpm_list.sh | grep -v -E "^(redhat|centos|fedora)-release" > /tmp/base_rpm_list.txt

RUN microdnf install python3 which shadow-utils && microdnf clean all
RUN microdnf install python3 which shadow-utils diffutils && microdnf clean all

WORKDIR /vmaas_sync

Expand Down

0 comments on commit 4731eb4

Please sign in to comment.