Skip to content

Commit

Permalink
code rabbit review
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehul-Kumar-27 committed Aug 3, 2024
1 parent efab9b4 commit 3ad87bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ jobs:
sudo apt-get install -y ca-certificates
sudo update-ca-certificates
- name: Install curl
run: sudo apt-get install -y curl

- name: Install Docker
- name: Install curl and Docker
run: |
sudo apt-get install -y curl
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Expand Down Expand Up @@ -72,11 +70,9 @@ jobs:
sudo apt-get install -y ca-certificates
sudo update-ca-certificates
- name: Install curl
run: sudo apt-get install -y curl

- name: Install Docker
- name: Install curl and Docker
run: |
sudo apt-get install -y curl
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Expand Down
8 changes: 5 additions & 3 deletions ci/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"
"fmt"
"log/slog"
"os"

Expand All @@ -14,6 +15,7 @@ import (
func main() {
if len(os.Args) < 2 {
slog.Error("Please provide the app name (satellite or ground-control) as an argument.")
os.Exit(1)
}

appName := os.Args[1]
Expand All @@ -24,7 +26,7 @@ func main() {
sha := os.Getenv("GITHUB_SHA")

if token == "" || user == "" || repo == "" || sha == "" {
panic("Missing required environment variables")
panic(fmt.Sprintf("Missing required environment variables: GITHUB_TOKEN=%s, GITHUB_USERNAME=%s, GITHUB_REPOSITORY=%s, GITHUB_SHA=%s", token, user, repo, sha))
}

config := config.Config{
Expand All @@ -49,15 +51,15 @@ func main() {
err := satelliteCI.StartSatelliteCI()
if err != nil {
slog.Error("Error executing Satellite CI: " + err.Error())
panic(err)
os.Exit(1)
}

case "ground-control":
ground_control_ci := ground_control_ci.NewGroundControlCI(client, &ctx, &config)
err := ground_control_ci.StartGroundControlCI()
if err != nil {
slog.Error("Error executing Ground Control CI: " + err.Error())
panic(err)
os.Exit(1)
}
default:
slog.Error("Invalid app name. Please provide either 'satellite' or 'ground-control'.")
Expand Down

0 comments on commit 3ad87bb

Please sign in to comment.