From 7bd6db584f2b4975ede9f18da46086d7d7ae5cc7 Mon Sep 17 00:00:00 2001 From: jakecoffman Date: Thu, 29 Sep 2022 10:18:49 -0500 Subject: [PATCH] add dependabot CLI prebuild --- .devcontainer/Dockerfile | 11 +++++++++++ .devcontainer/devcontainer.json | 33 +++++++++++++++++++++++++++++++++ .devcontainer/on-create.sh | 4 ++++ .devcontainer/post-create.sh | 7 +++++++ 4 files changed, 55 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/on-create.sh create mode 100644 .devcontainer/post-create.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..828de1fbe7e --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,11 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ubuntu/.devcontainer/base.Dockerfile + +# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04 +ARG VARIANT="jammy" +FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} + +# [Optional] Uncomment this section to install additional OS packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends + + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..80b98703148 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,33 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ubuntu +{ + "name": "Ubuntu", + "build": { + "dockerfile": "Dockerfile", + // Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04 + // Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon. + "args": { + "VARIANT": "ubuntu-22.04" + } + }, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + "onCreateCommand": "bash .devcontainer/on-create.sh", + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bash .devcontainer/post-create.sh", + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode", + "features": { + "docker-from-docker": "latest", + "github-cli": "latest", + "node": "lts", + "golang": "latest", + "ruby": "latest", + "rust": "latest", + "dotnet": "latest", + "ghcr.io/devcontainers/features/sshd:1": { + "version": "latest" + } + } +} diff --git a/.devcontainer/on-create.sh b/.devcontainer/on-create.sh new file mode 100644 index 00000000000..9ecc3725459 --- /dev/null +++ b/.devcontainer/on-create.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# This pull takes a while, adding it to the prebuild +docker pull ghcr.io/dependabot/dependabot-updater:latest +docker pull ghcr.io/github/dependabot-update-job-proxy/dependabot-update-job-proxy:latest diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100644 index 00000000000..fb20394c68c --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,7 @@ +#!/bin/bash +gh release download --repo dependabot/cli -p "*linux-amd64.tar.gz" +tar xzvf "*.tar.gz" >/dev/null 2>&1 +sudo mv dependabot /usr/local/bin +rm "*.tar.gz" + +echo "export LOCAL_GITHUB_ACCESS_TOKEN=$GITHUB_TOKEN" >> ~/.bashrc