Skip to content

Commit 26568af

Browse files
alexlianidesalexlianides
and
alexlianides
authored
implemented pull_config_yamls and updated updated test-devcontainer feature to test feature (#113)
Co-authored-by: alexlianides <[email protected]>
1 parent 2adb85e commit 26568af

File tree

5 files changed

+59
-3
lines changed

5 files changed

+59
-3
lines changed

.devcontainer/artifacts.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
config:
2+
containerRegistries:
3+
- url: ghcr.io
4+
repositoryPrefix: microsoft/azure-orbital-space-sdk
5+
push_enabled: true
6+
pull_enabled: true
7+
login_enabled: false
8+
login_username_file: ${HOME}/.ssh/ghcr_username
9+
login_password_file: ${HOME}/.ssh/ghcr_password
10+
- url: testdoesnotexist.azurecr.io
11+
push_enabled: false
12+
pull_enabled: true
13+
login_enabled: false
14+
extraBuildArtifacts:
15+
- file: testartifact.txt
16+
directory: tmp/test
17+
repository: test
18+
tag: 0.11.0
19+

.devcontainer/features/spacefx-dev/devcontainer-feature.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Microsoft Azure Orbital Space SDK - DevContainer Feature",
33
"id": "spacefx-dev",
4-
"version": "0.10.0",
4+
"version": "0.11.0",
55
"description": "Deploys the environmental configuration used for developing payload application and plugins within the Azure Orbital Framework",
66
"documentationURL": "https://github.com/microsoft/azure-orbital-space-sdk-setup",
77
"options": {

.devcontainer/features/spacefx-dev/updateContent.sh

+29
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,36 @@ function pull_config_yamls(){
7474
info_log "START: ${FUNCNAME[0]}"
7575

7676

77+
if [[ ${#ADDL_CONFIG_YAMLS[@]} -eq 0 ]]; then
78+
info_log "...no additional yamls specified in devcontainer.json. Nothing to do"
79+
info_log "END: ${FUNCNAME[0]}"
80+
return
81+
fi
82+
83+
for config_yaml in "${ADDL_CONFIG_YAMLS[@]}"; do
84+
if [[ -z "${config_yaml}" ]]; then
85+
continue
86+
fi
87+
88+
# debug_log "Container Working Dir: ${CONTAINER_WORKING_DIR}"
89+
# debug_log "Host Folder: ${HOST_FOLDER}"
90+
# config_yaml=${config_yaml//$CONTAINER_WORKING_DIR/$HOST_FOLDER}
7791

92+
info_log "checking for ${config_yaml}"
93+
94+
if [[ ! -f "${config_yaml}" ]]; then
95+
exit_with_error "Unable to find config yaml '${config_yaml}'. Please check your path and rebuild devcontainer. Path must be from devcontainer's perspective"
96+
fi
97+
98+
info_log "...adding config yaml'${config_yaml}' to ${SPACEFX_DIR}/config..."
99+
100+
run_a_script "basename ${config_yaml}" config_yaml_filename
101+
102+
info_log "Copying '${config_yaml}' to '${SPACEFX_DIR}/config/${config_yaml_filename}'..."
103+
run_a_script "cp ${config_yaml} ${SPACEFX_DIR}/config/${config_yaml_filename}"
104+
info_log "...successfully copied '${config_yaml}' to '${SPACEFX_DIR}/config/${config_yaml_filename}'"
105+
106+
done
78107

79108

80109
info_log "END: ${FUNCNAME[0]}"

.devcontainer/test-feature/devcontainer.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"ghcr.io/microsoft/azure-orbital-space-sdk/spacefx-dev:0.11.0_test_do_not_use-nightly": {
1111
"app_name": "spacesdk-setup",
1212
"app_type": "none",
13-
"extract_setup_files": "false"
13+
"extract_setup_files": "false",
14+
"addl_config_yamls":"/workspaces/azure-orbital-space-sdk-setup/.devcontainer/artifacts.yaml"
1415
}
1516
},
1617
"hostRequirements": {
@@ -104,5 +105,5 @@
104105
}
105106
},
106107
"remoteUser": "root",
107-
"initializeCommand": "${localWorkspaceFolder}/.vscode/copy_to_spacedev.sh --output-dir ${localWorkspaceFolder}/.devcontainer/features/spacefx-dev/azure-orbital-space-sdk-setup"
108+
"initializeCommand": "bash ${localWorkspaceFolder}/.vscode/copy_to_spacedev.sh --output-dir ${localWorkspaceFolder}/.devcontainer/features/spacefx-dev/azure-orbital-space-sdk-setup ; bash ${localWorkspaceFolder}/.vscode/copy_to_spacedev.sh"
108109
}

tests/dev_cluster.sh

+7
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ wait_for_namespace_to_provision --namespace coresvc
169169
wait_for_namespace_to_provision --namespace hostsvc
170170
wait_for_namespace_to_provision --namespace platformsvc
171171

172+
echo "Checking for artifacts.yaml in /var/spacedev/config..."
173+
artifact_yaml="/var/spacedev/config/artifacts.yaml"
174+
if [[ ! -f "${artifact_yaml}" ]]; then
175+
echo "artifacts.yaml not found in /var/spacedev/config. Please ensure the file is present."
176+
exit 1
177+
fi
178+
172179
echo ""
173180
echo ""
174181
echo ""

0 commit comments

Comments
 (0)