You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local inventory_file="${SPIN_INVENTORY_FILE:-"/etc/ansible/collections/ansible_collections/serversideup/spin/plugins/inventory/spin-dynamic-inventory.sh"}"
49
-
local infrastructure_folder=".infrastructure"
50
-
51
-
if [ !-d"$infrastructure_folder" ];then
52
-
echo"${BOLD}${RED}❌ Infrastructure folder not found${RESET}"
53
-
echo"Please ensure you're in the root of your project."
54
-
return 1
55
-
fi
56
-
57
-
if [ !-d"$infrastructure_folder/deploy-keys" ] || [ !-f"$infrastructure_folder/deploy-keys/.gitignore" ];then
echo"${BOLD}${RED}❌ Infrastructure folder not found${RESET}"
187
+
echo"Please ensure you're in the root of your project."
188
+
return 1
189
+
fi
190
+
191
+
if [ !-f".spin.yml" ];then
192
+
echo"${BOLD}${RED}❌ .spin.yml not found${RESET}"
193
+
echo"Please ensure you're in the root of your project and a .spin.yml file exists."
194
+
return 1
195
+
fi
196
+
197
+
if is_encrypted_with_ansible_vault ".spin.yml"&& \
198
+
[ !-f".vault-password" ];then
199
+
echo"${BOLD}${RED}❌Error: .spin.yml is encrypted with Ansible Vault, but '.vault-password' file is missing.${RESET}"
200
+
echo"${BOLD}${YELLOW}Please save your vault password in '.vault-password' in your project root and try again.${RESET}"
201
+
return 1
202
+
fi
203
+
204
+
# Create ci folder if it doesn't exist
205
+
if [ !-d"$SPIN_CI_FOLDER" ] || [ !-f"$SPIN_CI_FOLDER/.gitignore" ];then
206
+
mkdir -p "$SPIN_CI_FOLDER"
207
+
echo"*">"$SPIN_CI_FOLDER/.gitignore"
208
+
echo"!.gitignore">>"$SPIN_CI_FOLDER/.gitignore"
209
+
fi
210
+
211
+
return 0
212
+
}
213
+
194
214
validate_environment_file() {
195
215
local gha_environment="$1"
196
216
local env_file=".env.$gha_environment"
@@ -207,7 +227,7 @@ validate_environment_file() {
207
227
fi
208
228
}
209
229
210
-
validate_repository_setup() {
230
+
validate_github_repository_setup() {
211
231
if! repository_exists;then
212
232
echo"${BOLD}${RED}❌ Repository not detected.${RESET}"
213
233
echo"Please ensure you're in the root of your project. If you need to create a repository, run \`git init\` then \`spin gh repo create\` to create one."
0 commit comments