kafka_neu-1778570057504.zip-extract/kafka-4.2.0-src/committer-tools/update-cache.sh

Path
kafka_neu-1778570057504.zip-extract/kafka-4.2.0-src/committer-tools/update-cache.sh
Status
scanned
Type
file
Name
update-cache.sh
Extension
.sh
Programming language
Bash
Mime type
text/x-shellscript
File type
Bourne-Again shell script, ASCII text executable
Tag

      
    
Rootfs path

      
    
Size
1630 (1.6 KB)
MD5
ec02f673d297b921da9c715bf88581b9
SHA1
4354c2413f9e2222ef975f0a1b541ee977457250
SHA256
0a803cad8dc96b7b04ea9aac048688b907d5b9c5bbd9e287843d74305628b57c
SHA512

      
    
SHA1_git
6dbc12e8a1bb1ca9e8e5d316aaf1d0ccea2b3bb6
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
update-cache.sh | 1.6 KB |

#!/bin/bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # Get the latest commit SHA that contains the Gradle build cache. sha=$(curl -s "https://api.github.com/repos/apache/kafka/actions/caches?key=gradle-home-v1&ref=refs/heads/trunk" \ | jq -r '.actions_caches | max_by(.created_at) | .key | split("-")[4]') if ! git show "$sha" &> /dev/null; then printf '\e[33m%s %s\e[0m ' \ "Cannot update 'trunk-cached' because SHA $sha" \ "does not exist locally. Please update your remote and try again." else if git branch -f trunk-cached "$sha" &> /dev/null; then rel_date="$(git show --no-patch $sha --date=relative --pretty=format:'%cr')" printf '%s ' "Local branch 'trunk-cached' successfully updated to $(head -c 10 <<< "$sha") (from $rel_date)." else printf '\e[31m%s\e[0m ' "Failed to update ref for 'trunk-cached' and commit $(head -c 10 <<< "$sha")." fi fi
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
47.41
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 10 10
https://api.github.com/repos/apache/kafka/actions/caches?key=gradle-home-v1&ref=refs/heads/trunk 20 20