Skip to content

Commit bb944a7

Browse files
committed
enhance(ci): add SGX environment sourcing instruction
- Add print_env_instructions() function to display clear post-install guidance - Instruction appears after every successful completion (fresh and idempotent runs) - Shows bordered message directing users to 'source /opt/intel/sgxsdk/environment' - Logs instruction details to /tmp/install_sgx.log for reference - Eliminates user confusion about required environment setup for SGX development
1 parent 1194205 commit bb944a7

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

ci/install_sgx_for_applicaiton_developer.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,22 @@ log_info() {
6868
# Execute command with output redirected to log
6969
log_exec() {
7070
log_info "Executing: $*"
71-
"$@" >> "${LOG_FILE}" 2>&1
71+
"$@" >>"$LOG_FILE" 2>&1
72+
}
73+
74+
# Print environment sourcing instructions
75+
print_env_instructions() {
76+
log_info "Printing environment setup instructions"
77+
78+
echo "========================================================================"
79+
echo " IMPORTANT: Before building or running SGX applications, you must run:"
80+
echo " source /opt/intel/sgxsdk/environment"
81+
echo " in your current shell to activate SGX SDK environment variables."
82+
echo "========================================================================"
83+
84+
log_info "Environment setup instructions displayed to user"
7285
}
7386

74-
# Idempotency checking functions
7587
check_sgx_packages() {
7688
log_info "Checking for existing SGX packages..."
7789

@@ -340,6 +352,7 @@ log_info "Starting idempotency checks..."
340352
if check_sgx_packages && check_sgx_sdk && check_sgx_repo; then
341353
log_info "Complete SGX installation detected - no action needed"
342354
echo "Intel SGX for Application Developer is already installed and configured."
355+
print_env_instructions
343356
exit 0
344357
fi
345358

@@ -374,4 +387,11 @@ if [ $? -ne 0 ]; then
374387
exit 1
375388
fi
376389

390+
cleanup
391+
if [ $? -ne 0 ]; then
392+
log_info "Cleanup failed"
393+
exit 1
394+
fi
395+
377396
echo "Intel SGX for Application Developer installation completed."
397+
print_env_instructions

0 commit comments

Comments
 (0)