|
8 | 8 | # https://github.com/armbian/build/
|
9 | 9 |
|
10 | 10 | function cli_artifact_pre_run() {
|
| 11 | + case "${ARMBIAN_COMMAND}" in |
| 12 | + download-artifact) |
| 13 | + display_alert "download-only mode:" "won't build '${WHAT}'" "info" |
| 14 | + DONT_BUILD_ARTIFACTS="${WHAT}" |
| 15 | + ;; |
| 16 | + esac |
| 17 | + |
11 | 18 | initialize_artifact "${WHAT}"
|
12 | 19 | # Run the pre run adapter
|
13 | 20 | artifact_cli_adapter_pre_run
|
@@ -45,31 +52,45 @@ function cli_artifact_run() {
|
45 | 52 | declare ignore_local_cache="${ignore_local_cache:-"${default_update_remote_only}"}"
|
46 | 53 | declare deploy_to_remote="${deploy_to_remote:-"${default_update_remote_only}"}"
|
47 | 54 |
|
48 |
| - # If OCI_TARGET_BASE is explicitly set, ignore local, skip if found in remote, and deploy to remote after build. |
49 |
| - if [[ -n "${OCI_TARGET_BASE}" ]]; then |
50 |
| - skip_unpack_if_found_in_caches="yes" |
51 |
| - ignore_local_cache="yes" |
52 |
| - deploy_to_remote="yes" |
53 |
| - |
54 |
| - # Pass ARTIFACT_USE_CACHE=yes to actually use the cache versions, but don't deploy to remote. |
55 |
| - # @TODO this is confusing. each op should be individually controlled... |
56 |
| - # what we want is: |
57 |
| - # 1: - check remote, if not found, check local, if not found, build, then deploy to remote |
58 |
| - # - if remote found, do nothing. |
59 |
| - # - if local found, deploy it to remote (for switching targets) |
60 |
| - # 2: - get from remote -> get local -> build, then DON'T deploy to remote |
61 |
| - if [[ "${ARTIFACT_USE_CACHE}" == "yes" ]]; then |
| 55 | + case "${ARMBIAN_COMMAND}" in |
| 56 | + download-artifact) |
| 57 | + display_alert "Running in download-artifact mode" "download-artifact" "ext" |
62 | 58 | skip_unpack_if_found_in_caches="no"
|
63 | 59 | ignore_local_cache="no"
|
64 | 60 | deploy_to_remote="no"
|
65 |
| - fi |
66 |
| - fi |
| 61 | + ;; |
| 62 | + *) |
| 63 | + # @TODO: rpardini: i'm braindead. I really can't make sense of my own code! |
| 64 | + # If OCI_TARGET_BASE is explicitly set, ignore local, skip if found in remote, and deploy to remote after build. |
| 65 | + if [[ -n "${OCI_TARGET_BASE}" ]]; then |
| 66 | + skip_unpack_if_found_in_caches="yes" |
| 67 | + ignore_local_cache="yes" |
| 68 | + deploy_to_remote="yes" |
| 69 | + |
| 70 | + # Pass ARTIFACT_USE_CACHE=yes to actually use the cache versions, but don't deploy to remote. |
| 71 | + # @TODO this is confusing. each op should be individually controlled... |
| 72 | + # what we want is: |
| 73 | + # 1: - check remote, if not found, check local, if not found, build, then deploy to remote |
| 74 | + # - if remote found, do nothing. |
| 75 | + # - if local found, deploy it to remote (for switching targets) |
| 76 | + # 2: - get from remote -> get local -> build, then DON'T deploy to remote |
| 77 | + if [[ "${ARTIFACT_USE_CACHE}" == "yes" ]]; then |
| 78 | + skip_unpack_if_found_in_caches="no" |
| 79 | + ignore_local_cache="no" |
| 80 | + deploy_to_remote="no" |
| 81 | + fi |
| 82 | + fi |
| 83 | + ;; |
| 84 | + esac |
67 | 85 |
|
68 | 86 | # Force artifacts download we need to populate repository
|
69 | 87 | if [[ "${FORCE_ARTIFACTS_DOWNLOAD}" == "yes" ]]; then
|
70 | 88 | skip_unpack_if_found_in_caches="no"
|
71 | 89 | fi
|
72 | 90 |
|
| 91 | + # display a summary of the 3 vars above: skip_unpack_if_found_in_caches, ignore_local_cache, deploy_to_remote |
| 92 | + display_alert "CLI Artifact summary" "skip_unpack_if_found_in_caches=${skip_unpack_if_found_in_caches}, ignore_local_cache=${ignore_local_cache}, deploy_to_remote=${deploy_to_remote}" "info" |
| 93 | + |
73 | 94 | if [[ "${ARTIFACT_BUILD_INTERACTIVE}" == "yes" ]]; then # Set by `kernel-config`, `kernel-patch`, `uboot-config`, `uboot-patch`, etc.
|
74 | 95 | display_alert "Running artifact build in interactive mode" "log file will be incomplete" "info"
|
75 | 96 | do_with_default_build obtain_complete_artifact
|
|
0 commit comments