| #!/usr/bin/env 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. |
| |
| GIT_REPO="ppa:git-core/ppa" |
| GIT_LFS_REPO="https://packagecloud.io/install/repositories/github/git-lfs" |
| |
| ## Install git |
| add-apt-repository $GIT_REPO -y |
| apt-get update |
| apt-get install --upgrade git -y |
| git --version |
| |
| # Install git-lfs |
| curl -s $GIT_LFS_REPO/script.deb.sh | bash |
| apt-get install -y git-lfs=2.13.3 |
| |
| # Install git-ftp |
| apt-get install git-ftp -y |
| |
| # Remove source repo's |
| add-apt-repository --remove $GIT_REPO |
| rm /etc/apt/sources.list.d/github_git-lfs.list |
| |
| #Install hub |
| tmp_hub="/tmp/hub" |
| mkdir -p "$tmp_hub" |
| url=$(curl -s https://api.github.com/repos/github/hub/releases/latest | jq -r '.assets[].browser_download_url | select(contains("hub-linux-amd64"))') |
| download_with_retries "$url" "$tmp_hub" |
| tar xzf "$tmp_hub"/hub-linux-amd64-*.tgz --strip-components 1 -C "$tmp_hub" |
| mv "$tmp_hub"/bin/hub /usr/local/bin |
| |
| # Add well-known SSH host keys to known_hosts |
| ssh-keyscan -t rsa github.com >> /etc/ssh/ssh_known_hosts |
| ssh-keyscan -t rsa ssh.dev.azure.com >> /etc/ssh/ssh_known_hosts |