This is an automated email from the ASF dual-hosted git repository.
ash pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow-ci-infra.git
The following commit(s) were added to refs/heads/main by this push:
new b98275c Install `gh` CLI in runners (#40)
b98275c is described below
commit b98275c217daea84214e28ca4c65a96d85bd0ac2
Author: Ash Berlin-Taylor <[email protected]>
AuthorDate: Wed Sep 8 13:57:23 2021 +0100
Install `gh` CLI in runners (#40)
---
.../packer/files/install-github-cli.sh | 28 ++++++++++++++++++++++
github-runner-ami/packer/ubuntu2004.pkr.hcl | 1 +
2 files changed, 29 insertions(+)
diff --git a/github-runner-ami/packer/files/install-github-cli.sh
b/github-runner-ami/packer/files/install-github-cli.sh
new file mode 100644
index 0000000..a09714e
--- /dev/null
+++ b/github-runner-ami/packer/files/install-github-cli.sh
@@ -0,0 +1,28 @@
+#!/bin/bash -e
+
+# 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.
+
+set -uo pipefail
+
+#
https://github.com/actions/virtual-environments/blob/f2fdcef0e020770b1b6cc58bda3b4a01f0286f5e/images/linux/scripts/installers/github-cli.sh
+url=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | jq -r
'.assets[].browser_download_url|select(contains("linux") and contains("amd64")
and contains(".deb"))')
+
+cd /tmp
+curl -fsL --remote-name "$url"
+apt install /tmp/gh_*_linux_amd64.deb
+rm /tmp/gh_*_linux_amd64.deb
diff --git a/github-runner-ami/packer/ubuntu2004.pkr.hcl
b/github-runner-ami/packer/ubuntu2004.pkr.hcl
index cf6e6f0..63151fb 100644
--- a/github-runner-ami/packer/ubuntu2004.pkr.hcl
+++ b/github-runner-ami/packer/ubuntu2004.pkr.hcl
@@ -138,6 +138,7 @@ build {
"./files/source-list-additions.sh",
"./files/install-dependencies.sh",
"./files/install-nodejs.sh",
+ "./files/install-github-cli.sh",
"./files/docker-compose.sh",
"./files/runner_bootstrap.sh",
"./files/cleanup.sh",