Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/actions/deploy-gitpod/Dockerfile

This file was deleted.

79 changes: 79 additions & 0 deletions .github/actions/deploy-gitpod/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: "Deploy Gitpod"
description: "Deploys Gitpod to an existing preview environment"
inputs:
name:
description: "The name of the preview environment to deploy Gitpod to"
required: false
version:
description: "The version of Gitpod to install"
required: true
with_dedicated_emu:
description: "Dedicated Config"
required: false
analytics:
description: "With analytics"
required: false
workspace_feature_flags:
description: "Workspace feature flags"
required: false
image_repo_base:
description: "The base repository for image"
required: false
outputs:
report:
description: "Preview environment report (base64 encoded)"
value: ${{ steps.deploy.outputs.report }}
runs:
using: "composite"
steps:
- name: Install previewctl
shell: bash
run: |
set -euo pipefail
leeway run dev/preview/previewctl:install

- name: Deploy Gitpod
id: deploy
shell: bash
env:
INPUT_NAME: ${{ inputs.name }}
INPUT_VERSION: ${{ inputs.version }}
INPUT_WITH_DEDICATED_EMU: ${{ inputs.with_dedicated_emu }}
INPUT_ANALYTICS: ${{ inputs.analytics }}
INPUT_WORKSPACE_FEATURE_FLAGS: ${{ inputs.workspace_feature_flags }}
INPUT_IMAGE_REPO_BASE: ${{ inputs.image_repo_base }}
run: |
set -euo pipefail

export VERSION="${INPUT_VERSION}"
export IMAGE_REPO_BASE="${INPUT_IMAGE_REPO_BASE}"

echo "Downloading installer for ${VERSION}"
oci-tool fetch file -o /tmp/installer --platform=linux-amd64 "${IMAGE_REPO_BASE}/installer:${VERSION}" app/installer
chmod +x /tmp/installer
export PATH="/tmp:$PATH"

echo "Download versions.yaml"
oci-tool fetch file -o /tmp/versions.yaml --platform=linux-amd64 "${IMAGE_REPO_BASE}/versions:${VERSION}" versions.yaml

PREVIEW_NAME="$(previewctl get-name --branch "${INPUT_NAME}")"
export PREVIEW_NAME

for var in WITH_DEDICATED_EMU ANALYTICS WORKSPACE_FEATURE_FLAGS; do
input_var="INPUT_${var}"
if [[ -n "${!input_var:-}" ]]; then
export "GITPOD_${var}"="${!input_var}"
fi
done

previewctl install-context --branch "${PREVIEW_NAME}" --log-level debug --timeout 10m
leeway run dev/preview:deploy-gitpod
previewctl report --branch "${PREVIEW_NAME}" >> "${GITHUB_STEP_SUMMARY}"

EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
report=$(previewctl report --branch "${PREVIEW_NAME}" | base64)
{
echo "report<<$EOF"
echo "$report"
echo "$EOF"
} >> "$GITHUB_OUTPUT"
45 changes: 0 additions & 45 deletions .github/actions/deploy-gitpod/entrypoint.sh

This file was deleted.

24 changes: 0 additions & 24 deletions .github/actions/deploy-gitpod/metadata.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/actions/deploy-monitoring-satellite/Dockerfile

This file was deleted.

28 changes: 28 additions & 0 deletions .github/actions/deploy-monitoring-satellite/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Deploy monitoring satellite"
description: "Deploys monitoring satellite to an existing preview environment"
runs:
using: "composite"
steps:
- name: Install previewctl
shell: bash
run: |
set -euo pipefail
leeway run dev/preview/previewctl:install

- name: Deploy monitoring satellite
shell: bash
run: |
set -euo pipefail

echo "previewctl install-context"
previewctl install-context --log-level debug --timeout 10m

echo "leeway run dev/preview:deploy-monitoring-satellite"
leeway run dev/preview:deploy-monitoring-satellite

{
echo '<p>Monitoring satellite has been installed in your preview environment.</p>'
echo '<ul>'
echo '<li><b>📚 Documentation</b> - See our <a href="https://www.notion.so/gitpod/f2938b2bcb0c4c8c99afe1d2b872380e" target="_blank">internal documentation</a> on how to use it.</li>'
echo '</ul>'
} >> "${GITHUB_STEP_SUMMARY}"
26 changes: 0 additions & 26 deletions .github/actions/deploy-monitoring-satellite/entrypoint.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .github/actions/deploy-monitoring-satellite/metadata.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/actions/preview-create/Dockerfile

This file was deleted.

44 changes: 44 additions & 0 deletions .github/actions/preview-create/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Create preview environment"
description: "Creates the infrastructure for a preview environment"
inputs:
name:
description: "The name of the preview environment to deploy Gitpod to"
required: false
large_vm:
description: "Whether to use a larger VM for the env"
required: false
default: "false"
preemptible:
description: "Whether to use preemptible VMs for the env"
required: false
default: "true"
recreate_vm:
description: "Whether to recreate the VM"
required: false
default: "false"
runs:
using: "composite"
steps:
- name: Install previewctl
shell: bash
run: |
set -euo pipefail
leeway run dev/preview/previewctl:install

- name: Create preview environment
shell: bash
env:
INPUT_NAME: ${{ inputs.name }}
INPUT_LARGE_VM: ${{ inputs.large_vm }}
INPUT_PREEMPTIBLE: ${{ inputs.preemptible }}
run: |
set -euo pipefail

TF_VAR_preview_name="$(previewctl get-name --branch "${INPUT_NAME}")"
export TF_VAR_preview_name
export TF_VAR_with_large_vm="${INPUT_LARGE_VM}"
export TF_VAR_gce_use_spot="${INPUT_PREEMPTIBLE}"
export TF_INPUT=0
export TF_IN_AUTOMATION=true

leeway run dev/preview:create-preview
21 changes: 0 additions & 21 deletions .github/actions/preview-create/entrypoint.sh

This file was deleted.

24 changes: 0 additions & 24 deletions .github/actions/preview-create/metadata.yml

This file was deleted.

14 changes: 9 additions & 5 deletions .github/workflows/branch-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ jobs:
(needs.configuration.outputs.is_main_branch != 'true') &&
(needs.configuration.outputs.is_scheduled_run != 'true')
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:gpl-npm-oidc-support-gha.42
options: --user root
concurrency:
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-infrastructure
cancel-in-progress: true
Expand All @@ -150,11 +153,9 @@ jobs:
uses: ./.github/actions/preview-create
with:
name: ${{ needs.configuration.outputs.preview_name }}
previewctl_hash: ${{ needs.build-previewctl.outputs.previewctl_hash }}
large_vm: ${{ needs.configuration.outputs.with_large_vm }}
preemptible: ${{ needs.configuration.outputs.with_preemptible }}
recreate_vm: ${{ inputs.recreate_vm }}
image_repo_base: ${{needs.configuration.outputs.image_repo_base}}/build

build-gitpod:
name: Build Gitpod
Expand Down Expand Up @@ -438,6 +439,9 @@ jobs:
environment: branch-build
if: needs.configuration.outputs.is_scheduled_run != 'true'
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:gpl-npm-oidc-support-gha.42
options: --user root
concurrency:
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-install
cancel-in-progress: ${{ needs.configuration.outputs.is_main_branch == 'false' }}
Expand Down Expand Up @@ -488,6 +492,9 @@ jobs:
needs: [ infrastructure, build-previewctl ]
environment: branch-build
runs-on: ubuntu-latest
container:
image: eu.gcr.io/gitpod-dev-artifact/dev/dev-environment:gpl-npm-oidc-support-gha.42
options: --user root
if: needs.configuration.outputs.with_monitoring == 'true' && needs.configuration.outputs.is_scheduled_run != 'true'
concurrency:
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-monitoring
Expand All @@ -503,9 +510,6 @@ jobs:
- name: Deploy monitoring satellite to the preview environment
id: deploy-monitoring-satellite
uses: ./.github/actions/deploy-monitoring-satellite
with:
previewctl_hash: ${{ needs.build-previewctl.outputs.previewctl_hash }}
image_repo_base: ${{needs.configuration.outputs.image_repo_base}}/build

integration-test:
name: "Run integration test"
Expand Down
Loading
Loading