Repository navigation
Expand file tree
/
Copy pathdev-setup.sh
More file actions
executable file
·99 lines (88 loc) · 3.03 KB
/
Copy pathdev-setup.sh
File metadata and controls
executable file
·99 lines (88 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
# Copyright (c) Microsoft Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
echo "================================================"
echo "DACS Storage - Development Environment Setup"
echo "================================================"
echo ""
# Update package lists
echo "[1/7] Updating package lists..."
sudo apt update
# Install essential tools
echo "[2/7] Installing essential tools..."
sudo apt install -y \
make \
git \
git-lfs \
jq
# Install Go (Microsoft build)
echo "[3/7] Installing Microsoft Go..."
if ! command -v go &> /dev/null; then
# Add Microsoft package repository
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc > /dev/null
sudo apt-add-repository -y "https://packages.microsoft.com/ubuntu/$(lsb_release -rs)/prod"
sudo apt update
# Install Microsoft Go
sudo apt install -y msft-golang
echo " Microsoft Go installed"
else
echo " Go already installed"
fi
# Initialize Git LFS
echo "[4/7] Initializing Git LFS..."
git lfs install
echo " Git LFS initialized"
# Install Docker + Kubernetes tools (skips if already present)
echo "[5/7] Installing Docker and Kubernetes tools (minikube, kubectl, helm)..."
PREREQ_SCRIPT=".pipelines/scripts/k8s/prerequisites.sh"
if [ -f "$PREREQ_SCRIPT" ]; then
bash "$PREREQ_SCRIPT"
else
echo "Prerequisites script not found at $PREREQ_SCRIPT. Please run the Kubernetes tool installs manually."
fi
# Fix Docker permissions for current user
echo "[6/7] Configuring Docker permissions..."
if command -v docker &> /dev/null; then
sudo usermod -aG docker $USER
sudo chmod 666 /var/run/docker.sock 2>/dev/null || true
echo " Docker permissions configured"
fi
# Install Azure CLI (for CI/CD pipelines)
echo "[7/7] Installing Azure CLI..."
if ! command -v az &> /dev/null; then
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
echo " Azure CLI installed"
else
echo " Azure CLI already installed"
fi
echo ""
echo "================================================"
echo "All tools installed successfully!"
echo "================================================"
echo ""
echo "Next steps:"
echo " 1. Configure Git (if not already done):"
echo " git config --global user.email \"you@example.com\""
echo " git config --global user.name \"Your Name\""
echo ""
echo " 2. Restart WSL session for Docker permissions:"
echo " exit"
echo " Then in PowerShell/CMD: wsl -d Ubuntu"
echo ""
echo " 3. Start building:"
echo " cd ~/DACS"
echo " make build"
echo " make test"
echo ""