From 4731eb4d22359cba63bedc8cc39015653cc09585 Mon Sep 17 00:00:00 2001 From: Tomas Kasparek Date: Tue, 14 Jan 2020 11:49:58 +0100 Subject: [PATCH] fix(manifest): fix manifest generation --- evaluator/Dockerfile | 2 +- listener/Dockerfile | 2 +- manager/Dockerfile | 2 +- scripts/push_manifest.sh | 4 ++-- vmaas_sync/Dockerfile | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/evaluator/Dockerfile b/evaluator/Dockerfile index 66cdfc0c9..d7ca96544 100644 --- a/evaluator/Dockerfile +++ b/evaluator/Dockerfile @@ -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 diff --git a/listener/Dockerfile b/listener/Dockerfile index 9c0a84ff5..cbb0af80f 100644 --- a/listener/Dockerfile +++ b/listener/Dockerfile @@ -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 diff --git a/manager/Dockerfile b/manager/Dockerfile index 941965d26..d8009645f 100644 --- a/manager/Dockerfile +++ b/manager/Dockerfile @@ -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 diff --git a/scripts/push_manifest.sh b/scripts/push_manifest.sh index 02dff944e..04fcd8f9e 100755 --- a/scripts/push_manifest.sh +++ b/scripts/push_manifest.sh @@ -16,7 +16,7 @@ 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 @@ -24,7 +24,7 @@ then 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',''))") diff --git a/vmaas_sync/Dockerfile b/vmaas_sync/Dockerfile index c3ee5090d..dfe6c602a 100644 --- a/vmaas_sync/Dockerfile +++ b/vmaas_sync/Dockerfile @@ -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