From b6272c79e13e2d770e851c6bc41035e1942af55c Mon Sep 17 00:00:00 2001 From: Azeem Shaikh Date: Fri, 14 Jan 2022 11:34:22 -0800 Subject: [PATCH] Fix `scorecard version` in Scorecard Docker images (#1480) Co-authored-by: Azeem Shaikh --- cloudbuild/scorecard-tag.yaml | 30 ++++++++++-------------------- cloudbuild/scorecard.yaml | 3 +++ 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/cloudbuild/scorecard-tag.yaml b/cloudbuild/scorecard-tag.yaml index fc26021b..92181eeb 100644 --- a/cloudbuild/scorecard-tag.yaml +++ b/cloudbuild/scorecard-tag.yaml @@ -12,23 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -build: - images: - - gcr.io/openssf/scorecard:$TAG_NAME - options: {} - steps: - - args: - - build - - -t - - gcr.io/openssf/scorecard:$TAG_NAME - - . - name: gcr.io/cloud-builders/docker -description: scorecard build based on tag -github: - name: scorecard - owner: ossf - push: - tag: .* -name: scorecard-tag -tags: -- v* +steps: +- id: 'Get Git history' + name: 'gcr.io/cloud-builders/git' + args: ['fetch', '--unshallow', '--tags', 'origin', '$COMMIT_SHA'] +- name: 'gcr.io/cloud-builders/docker' + args: ['build', '.', + '-t', 'gcr.io/openssf/scorecard:stable', + '-t', 'gcr.io/openssf/scorecard:$TAG_NAME', + '-f', 'Dockerfile'] +images: ['gcr.io/openssf/scorecard'] diff --git a/cloudbuild/scorecard.yaml b/cloudbuild/scorecard.yaml index 9ab5e9d4..25a4353f 100644 --- a/cloudbuild/scorecard.yaml +++ b/cloudbuild/scorecard.yaml @@ -13,6 +13,9 @@ # limitations under the License. steps: +- id: 'Get Git history' + name: 'gcr.io/cloud-builders/git' + args: ['fetch', '--unshallow', '--tags', 'origin', '$COMMIT_SHA'] - name: 'gcr.io/cloud-builders/docker' args: ['build', '.', '-t', 'gcr.io/openssf/scorecard:latest',