User Tools

Site Tools


gitlab-ci-composer-publish

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
gitlab-ci-composer-publish [2020/06/21 11:06] – [Extended config] admingitlab-ci-composer-publish [2020/06/21 11:16] – [Extended config] admin
Line 17: Line 17:
     script:     script:
         - version=$([ -z "$CI_COMMIT_TAG" ] && echo "branch=$CI_COMMIT_REF_NAME" || echo "tag=$CI_COMMIT_TAG")         - version=$([ -z "$CI_COMMIT_TAG" ] && echo "branch=$CI_COMMIT_REF_NAME" || echo "tag=$CI_COMMIT_TAG")
-        - response=$(curl -s -w "\n%{http_code}" --insecure --data $version $URL)+        - insecure=$([ "$CI_SERVER_PROTOCOL" -eq "http"] && echo "--insecure" || echo ""
 +        - response=$(curl -s -w "\n%{http_code}" $insecure --data $version $URL)
         - code=$(echo "$response" | tail -n 1)         - code=$(echo "$response" | tail -n 1)
         - body=$(echo "$response" | head -n 1)         - body=$(echo "$response" | head -n 1)
Line 32: Line 33:
 ===== Extended config ===== ===== Extended config =====
  
-Make sure to adjust ''test:script'' block according to your need.+Make sure to adjust ''test:script'' block according to your needs.
  
 <code yaml> <code yaml>
Line 57: Line 58:
     script:     script:
         - version=$([ -z "$CI_COMMIT_TAG" ] && echo "branch=$CI_COMMIT_REF_NAME" || echo "tag=$CI_COMMIT_TAG")         - version=$([ -z "$CI_COMMIT_TAG" ] && echo "branch=$CI_COMMIT_REF_NAME" || echo "tag=$CI_COMMIT_TAG")
-        - response=$(curl -s -w "\n%{http_code}" --insecure --data $version $URL)+        - insecure=$([ "$CI_SERVER_PROTOCOL" -eq "http"] && echo "--insecure" || echo ""
 +        - response=$(curl -s -w "\n%{http_code}" $insecure --data $version $URL)
         - code=$(echo "$response" | tail -n 1)         - code=$(echo "$response" | tail -n 1)
         - body=$(echo "$response" | head -n 1)         - body=$(echo "$response" | head -n 1)
gitlab-ci-composer-publish.txt · Last modified: 2020/06/21 23:19 by admin