From e263a78bf1b56491f04aeb17a873b88de67e3b8e Mon Sep 17 00:00:00 2001 From: Jacob Hrbek Date: Tue, 19 May 2020 17:40:38 +0200 Subject: [PATCH] gitpod: stub and deprecation (#121) This repository depends on root access for testing and VM support for cross-platform development neither of which is supported by Gitpod and so it was deprecated in this repository. FIXME: Implementation is rushed Blocked by: gitpod-io/gitpod#1265 Blocked by: gitpod-io/gitpod#39 Signed-off-by: Jacob Hrbek --- gitpod/debian.Dockerfile | 14 ++++++++++++ gitpod/exherbo.Dockerfile | 16 ++++++++++++- gitpod/gitpod.Dockerfile | 14 ++++++++++++ gitpod/scripts/root-access.sh | 43 +++++++++++++++++++++++++++++++++++ gitpod/scripts/vm-support.sh | 43 +++++++++++++++++++++++++++++++++++ 5 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 gitpod/scripts/root-access.sh create mode 100644 gitpod/scripts/vm-support.sh diff --git a/gitpod/debian.Dockerfile b/gitpod/debian.Dockerfile index df8e266..5169ecb 100644 --- a/gitpod/debian.Dockerfile +++ b/gitpod/debian.Dockerfile @@ -1,5 +1,19 @@ FROM debian:latest +# Blocked by https://github.com/gitpod-io/gitpod/issues/39 +COPY gitpod/scripts/root-access.sh /usr/bin/root-access +RUN true "5g5fdhsfd" \ + && chmod +x /usr/bin/root-access \ + && /usr/bin/root-access \ + && rm /usr/bin/root-access + +# Blocked by https://github.com/gitpod-io/gitpod/issues/1265 +COPY gitpod/scripts/vm-support.sh /usr/bin/vm-support +RUN true "8g7as2dga7" \ + && chmod +x /usr/bin/vm-support \ + && /usr/bin/vm-support \ + && rm /usr/bin/vm-support + # FIXME: Outputs `gitpod@ws-ce281d58-997b-44b8-9107-3f2da7feede3:/workspace/gitpod-tests1$` in terminal # FIXME: Add hadolint executable # FIXME: We can use /bin/sh instead of /bin/bash to get minor optimization diff --git a/gitpod/exherbo.Dockerfile b/gitpod/exherbo.Dockerfile index 449fd74..cf6ed97 100644 --- a/gitpod/exherbo.Dockerfile +++ b/gitpod/exherbo.Dockerfile @@ -1 +1,15 @@ -FROM scratch \ No newline at end of file +FROM scratch + +# Blocked by https://github.com/gitpod-io/gitpod/issues/39 +COPY gitpod/scripts/root-access.sh /usr/bin/root-access +RUN true "7a8fhs1g" \ + && chmod +x /usr/bin/root-access \ + && /usr/bin/root-access \ + && rm /usr/bin/root-access + +# Blocked by https://github.com/gitpod-io/gitpod/issues/1265 +COPY gitpod/scripts/vm-support.sh /usr/bin/vm-support +RUN true "dg798sda7h" \ + && chmod +x /usr/bin/vm-support \ + && /usr/bin/vm-support \ + && rm /usr/bin/vm-support \ No newline at end of file diff --git a/gitpod/gitpod.Dockerfile b/gitpod/gitpod.Dockerfile index 276d701..0c9b087 100644 --- a/gitpod/gitpod.Dockerfile +++ b/gitpod/gitpod.Dockerfile @@ -1,5 +1,19 @@ FROM gitpod/workspace-full-vnc:latest +# Blocked by https://github.com/gitpod-io/gitpod/issues/39 +COPY gitpod/scripts/root-access.sh /usr/bin/root-access +RUN true "7a8fhs1g" \ + && chmod +x /usr/bin/root-access \ + && /usr/bin/root-access \ + && rm /usr/bin/root-access + +# Blocked by https://github.com/gitpod-io/gitpod/issues/1265 +COPY gitpod/scripts/vm-support.sh /usr/bin/vm-support +RUN true "dg798sda7h" \ + && chmod +x /usr/bin/vm-support \ + && /usr/bin/vm-support \ + && rm /usr/bin/vm-support + # FIXME: Add hadolint executable # To avoid bricked workspaces (https://github.com/gitpod-io/gitpod/issues/1171) diff --git a/gitpod/scripts/root-access.sh b/gitpod/scripts/root-access.sh new file mode 100644 index 0000000..0a6c624 --- /dev/null +++ b/gitpod/scripts/root-access.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# Created by Jacob Hrbek under GPLv3 in 19/05/2020 16:28 + +###! Terminate gitpod if the blocking root access bug has not been resolved yet + +# FIXME: Quick-script + +set -e + +# FIXME: Rushed +die() { + printf 'FATAL: %s\n' "$2" + exit "$1" +} + +# FIXME: Sanitize +if ! command -v curl 1>/dev/null; then + apt-get update + apt-get install curl -y +elif command -v curl 1>/dev/null; then + true +else + die 255 "processing curl" +fi + +bugStatus="$(curl https://api.github.com/repos/gitpod-io/gitpod/issues/39 2>/dev/null | grep -o state.* || true)" + +case "$bugStatus" in + "state\": \"open\",") + printf '\033[31m\033[1mBLOCKED:\033[0m %s\n' "Gitpod does not provide a root access which is mandatory for this repository, see it's tracking in https://github.com/gitpod-io/gitpod/issues/39" + if [ "$GITPOD_IGNORE_BLOCKERS" != 1 ]; then + exit 1 + else + true + fi + ;; + "state\": \"closed\",") + true + ;; + *) + printf '\033[31m\033[1mBUG:\033[0m %s\n' "GitHub API returned an unknown state '$bugStatus' of bug https://github.com/gitpod-io/gitpod/issues/39" + exit 1 +esac \ No newline at end of file diff --git a/gitpod/scripts/vm-support.sh b/gitpod/scripts/vm-support.sh new file mode 100644 index 0000000..e9b99e5 --- /dev/null +++ b/gitpod/scripts/vm-support.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# Created by Jacob Hrbek under GPLv3 in 19/05/2020 16:28 + +###! Terminate gitpod if the blocking root access bug has not been resolved yet + +# FIXME: Quick-script + +set -e + +# FIXME: Rushed +die() { + printf 'FATAL: %s\n' "$2" + exit "$1" +} + +# FIXME: Sanitize +if ! command -v curl 1>/dev/null; then + apt-get update + apt-get install curl -y +elif command -v curl 1>/dev/null; then + true +else + die 255 "processing curl" +fi + +bugStatus="$(curl https://api.github.com/repos/gitpod-io/gitpod/issues/1265 2>/dev/null | grep -o state.* || true)" + +case "$bugStatus" in + "state\": \"open\",") + die 1 "Gitpod does not provide a VM support which blocks cross-platform development, see tracking on https://github.com/gitpod-io/gitpod/issues/1265" + if [ "$GITPOD_IGNORE_BLOCKERS" != 1 ]; then + exit 1 + else + true + fi + ;; + "state\": \"closed\",") + true + ;; + *) + printf '\033[31m\033[1mBUG:\033[0m %s\n' "GitHub API returned an unknown state '$bugStatus' of bug https://github.com/gitpod-io/gitpod/issues/1265" + exit 1 +esac \ No newline at end of file