Skip to content

Commit deed1d3

Browse files
committed
[supervisor] analyze image file changes
1 parent a5a31ee commit deed1d3

File tree

11 files changed

+396
-87
lines changed

11 files changed

+396
-87
lines changed

components/gitpod-cli/cmd/rebuild.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ func runRebuild(ctx context.Context, supervisorClient *supervisor.SupervisorClie
238238
for _, env := range debugEnvs.Envs {
239239
envs += env + "\n"
240240
}
241+
for _, env := range rebuildOpts.GitpodEnvs {
242+
envs += env + "\n"
243+
}
241244
for _, env := range workspaceEnvs {
242245
envs += fmt.Sprintf("%s=%s\n", env.Name, env.Value)
243246
}
@@ -432,6 +435,9 @@ var rebuildOpts struct {
432435
LogLevel string
433436
From string
434437
Prebuild bool
438+
439+
// internal
440+
GitpodEnvs []string
435441
}
436442

437443
var rebuildCmd = &cobra.Command{
@@ -467,4 +473,8 @@ func init() {
467473
rebuildCmd.PersistentFlags().StringVarP(&rebuildOpts.LogLevel, "log", "", "error", "Log level to use. Allowed values are 'error', 'warn', 'info', 'debug', 'trace'.")
468474
rebuildCmd.PersistentFlags().StringVarP(&rebuildOpts.From, "from", "", "", "Starts from 'prebuild' or 'snapshot'.")
469475
rebuildCmd.PersistentFlags().BoolVarP(&rebuildOpts.Prebuild, "prebuild", "", false, "starts as a prebuild workspace (--from is ignored).")
476+
477+
// internal
478+
rebuildCmd.PersistentFlags().StringArrayVarP(&rebuildOpts.GitpodEnvs, "gitpod-env", "", nil, "")
479+
rebuildCmd.PersistentFlags().MarkHidden("gitpod-env")
470480
}

components/gitpod-cli/rebuild.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
# Copyright (c) 2023 Gitpod GmbH. All rights reserved.
3+
# Licensed under the GNU Affero General Public License (AGPL).
4+
# See License.AGPL.txt in the project root for license information.
5+
6+
set -Eeuo pipefail
7+
8+
DIR="$(dirname "$(realpath "$0")")"
9+
COMPONENT="$(basename "$DIR")"
10+
cd "$DIR"
11+
12+
# build
13+
go build .
14+
echo "$COMPONENT built"
15+
16+
sudo rm -rf "/.supervisor/$COMPONENT" && true
17+
sudo mv ./"$COMPONENT" /.supervisor
18+
echo "$COMPONENT in /.supervisor replaced"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach to Process",
6+
"type": "go",
7+
"request": "attach",
8+
"mode": "local",
9+
"asRoot": true,
10+
"console": "integratedTerminal",
11+
"processId": "supervisor"
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)