|
2 | 2 |
|
3 | 3 | set -e |
4 | 4 |
|
5 | | -sudo chown -R sentry:sentry /workspace/sentry/log |
| 5 | +cd /workspace/sentry |
6 | 6 |
|
7 | | -git config --global --add safe.directory /workspace/sentry |
| 7 | +sudo chown -R sentry:sentry log |
| 8 | + |
| 9 | +mkdir -p vendor/gems |
| 10 | +sudo chown -R sentry:sentry vendor/gems |
| 11 | +git config --global --add safe.directory /workspace/sentry/vendor/gems |
8 | 12 |
|
9 | | -# Function to run setup for a specific service |
10 | 13 | run_service_setup() { |
11 | | - local service="$1" |
12 | | - |
13 | | - echo "🚀 Running setup for service: $service" |
14 | | - |
15 | | - case "$service" in |
16 | | - "dev") |
17 | | - .devcontainer/setup --with-foreman --only-bundle |
18 | | - ;; |
19 | | - "test") |
20 | | - .devcontainer/setup --with-foreman --only-bundle --only . |
21 | | - ;; |
22 | | - "test-services") |
23 | | - .devcontainer/setup --with-foreman --only .,spec/apps/rails-mini |
24 | | - ;; |
25 | | - *) |
26 | | - echo "❌ Unknown service: $service" |
27 | | - echo "Available services: dev, test, test-services" |
28 | | - exit 1 |
29 | | - ;; |
30 | | - esac |
31 | | - |
32 | | - echo "✅ Setup completed for service: $service" |
| 14 | + local service="$1" |
| 15 | + |
| 16 | + echo "🚀 Running setup for service: $service" |
| 17 | + |
| 18 | + case "$service" in |
| 19 | + "dev") |
| 20 | + .devcontainer/setup --with-foreman --only-bundle |
| 21 | + ;; |
| 22 | + "test") |
| 23 | + .devcontainer/setup --with-foreman --only-bundle --only . |
| 24 | + ;; |
| 25 | + "test-services") |
| 26 | + .devcontainer/setup --with-foreman --only .,spec/apps/rails-mini |
| 27 | + ;; |
| 28 | + *) |
| 29 | + echo "❌ Unknown service: $service" |
| 30 | + echo "Available services: dev, test, test-services" |
| 31 | + exit 1 |
| 32 | + ;; |
| 33 | + esac |
| 34 | + |
| 35 | + echo "✅ Setup completed for service: $service" |
33 | 36 | } |
34 | 37 |
|
35 | 38 | # Parse arguments |
36 | 39 | if [ "$1" = "--service" ] && [ -n "$2" ]; then |
37 | | - service="$2" |
38 | | - shift 2 # Remove --service and service name from arguments |
39 | | - |
40 | | - # Run service-specific setup |
41 | | - run_service_setup "$service" |
42 | | - |
43 | | - # Execute the remaining command |
44 | | - if [ $# -gt 0 ]; then |
45 | | - exec "$@" |
46 | | - else |
47 | | - # If no command provided, start an interactive shell |
48 | | - exec bash |
49 | | - fi |
| 40 | + service="$2" |
| 41 | + shift 2 |
| 42 | + |
| 43 | + run_service_setup "$service" |
| 44 | + |
| 45 | + if [ $# -gt 0 ]; then |
| 46 | + exec "$@" |
| 47 | + else |
| 48 | + exec bash |
| 49 | + fi |
50 | 50 | else |
51 | | - echo "❌ Usage: $0 --service <service-name> [command...]" |
52 | | - echo "Available services: dev, test, test-services" |
53 | | - exit 1 |
| 51 | + echo "❌ Usage: $0 --service <service-name> [command...]" |
| 52 | + echo "Available services: dev, test, test-services" |
| 53 | + exit 1 |
54 | 54 | fi |
0 commit comments