|
20 | 20 |
|
21 | 21 | cd `git rev-parse --show-toplevel` || exit |
22 | 22 |
|
23 | | -DEPLOY_ENV=$(sh ./script/get-deploy-status.sh) |
24 | | - |
25 | | -if [ "$DEPLOY_ENV" = "LOCAL" ]; then |
26 | | - echo "Publishing to local registry (http://${REGISTRY})..." |
27 | | - output=$(warg publish release --registry http://${REGISTRY} --name ${PKG_NAMESPACE}:${PKG_NAME} --version ${PKG_VERSION} ./compiled/${COMPONENT_FILENAME} 2>&1) |
28 | | - exit_code=$? |
29 | | - |
30 | | - # Check for specific error conditions in the output |
31 | | - if [[ $exit_code -ne 0 ]]; then |
32 | | - if [[ "$output" =~ "failed to prove inclusion" ]]; then |
33 | | - echo "Package uploaded to local registry successfully..." |
34 | | - elif [[ "$output" =~ "error sending request for url" ]]; then |
35 | | - echo "NOTE: Check to make sure you are running the registry locally" |
36 | | - echo "${output}" |
37 | | - exit 1 |
38 | | - else |
39 | | - echo "Unknown error occurred ${output}" |
40 | | - exit 1 |
41 | | - fi |
42 | | - fi |
| 23 | +PROTOCOL="https" |
| 24 | +if [[ "$REGISTRY" == *"localhost"* ]] || [[ "$REGISTRY" == *"127.0.0.1"* ]]; then |
| 25 | + PROTOCOL="http" |
| 26 | +fi |
| 27 | +echo "Publishing to registry (${PROTOCOL}://${REGISTRY})..." |
| 28 | + |
43 | 29 |
|
44 | | - exit 0 |
45 | | -else |
46 | | - echo "Publishing to remote registry (https://${REGISTRY})..." |
47 | | - warg publish release --registry https://${REGISTRY} --name ${PKG_NAMESPACE}:${PKG_NAME} --version ${PKG_VERSION} ./compiled/${COMPONENT_FILENAME} || true |
| 30 | +output=$(warg publish release --registry ${PROTOCOL}://${REGISTRY} --name ${PKG_NAMESPACE}:${PKG_NAME} --version ${PKG_VERSION} ./compiled/${COMPONENT_FILENAME} 2>&1 || true) |
| 31 | +exit_code=$? |
| 32 | + |
| 33 | +# Check for specific error conditions in the output |
| 34 | +if [[ $exit_code -ne 0 ]]; then |
| 35 | + if [[ "$output" =~ "failed to prove inclusion" ]]; then |
| 36 | + echo "Package uploaded to local registry successfully..." |
| 37 | + elif [[ "$output" =~ "error sending request for url" ]]; then |
| 38 | + echo "NOTE: Check to make sure you are running the registry locally" |
| 39 | + echo "${output}" |
| 40 | + exit 1 |
| 41 | + else |
| 42 | + echo "Unknown error occurred ${output}" |
| 43 | + exit 1 |
| 44 | + fi |
48 | 45 | fi |
| 46 | + |
| 47 | +exit 0 |
0 commit comments