mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-11 00:45:36 +03:00
Fix bug in Scorecard tag Docker image creation (#1890)
Co-authored-by: Azeem Shaikh <azeems@google.com>
This commit is contained in:
parent
8c97d46a36
commit
5758364c82
@ -13,12 +13,28 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- id: 'Get Git history'
|
- id: Get Git history
|
||||||
name: 'gcr.io/cloud-builders/git'
|
name: gcr.io/cloud-builders/git
|
||||||
args: ['fetch', '--unshallow', '--tags', 'origin', '$COMMIT_SHA']
|
args:
|
||||||
- name: 'gcr.io/cloud-builders/docker'
|
- fetch
|
||||||
args: ['build', '.',
|
- '--unshallow'
|
||||||
'-t', 'gcr.io/openssf/scorecard:stable',
|
- '--tags'
|
||||||
'-t', 'gcr.io/openssf/scorecard:$TAG_NAME',
|
- origin
|
||||||
'-f', 'Dockerfile']
|
- $COMMIT_SHA
|
||||||
|
- id: Get tag commit
|
||||||
|
name: gcr.io/cloud-builders/git
|
||||||
|
entrypoint: bash
|
||||||
|
args:
|
||||||
|
- '-c'
|
||||||
|
- >-
|
||||||
|
git rev-list -n 1 tags/$TAG_NAME > /workspace/commit-sha.txt
|
||||||
|
- id: Push docker tag
|
||||||
|
name: gcr.io/cloud-builders/docker
|
||||||
|
entrypoint: bash
|
||||||
|
args:
|
||||||
|
- '-c'
|
||||||
|
- >-
|
||||||
|
docker pull gcr.io/openssf/scorecard:$(cat /workspace/commit-sha.txt) &&
|
||||||
|
docker tag gcr.io/openssf/scorecard:$(cat /workspace/commit-sha.txt) gcr.io/openssf/scorecard:$TAG_NAME &&
|
||||||
|
docker push gcr.io/openssf/scorecard:$TAG_NAME
|
||||||
images: ['gcr.io/openssf/scorecard']
|
images: ['gcr.io/openssf/scorecard']
|
||||||
|
Loading…
Reference in New Issue
Block a user