9b36df06 by fehrlich

Update .gitlab-ci.yml file

1 parent 084d1063
Pipeline #4985 for 9b36df06 canceled in 0 seconds
1 # This file is a template, and might need editing before it works on your project.
2 # To contribute improvements to CI/CD templates, please follow the Development guide at:
3 # https://docs.gitlab.com/ee/development/cicd/templates.html
4 # This specific template is located at:
5 # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Composer.gitlab-ci.yml
6
7 # Publishes a tag/branch to Composer Packages of the current project
8 publish:
9 image: curlimages/curl:latest
10 stage: build
11 variables:
12 URL: "$CI_SERVER_PROTOCOL://$CI_SERVER_HOST:$CI_SERVER_PORT/api/v4/projects/$CI_PROJECT_ID/packages/composer?job_token=$CI_JOB_TOKEN"
13 script:
14 - version=$([[ -z "$CI_COMMIT_TAG" ]] && echo "branch=$CI_COMMIT_REF_NAME" || echo "tag=$CI_COMMIT_TAG")
15 - insecure=$([ "$CI_SERVER_PROTOCOL" = "http" ] && echo "--insecure" || echo "")
16 - response=$(curl -s -w "\n%{http_code}" $insecure --data $version $URL)
17 - code=$(echo "$response" | tail -n 1)
18 - body=$(echo "$response" | head -n 1)
19 # Output state information
20 - if [ $code -eq 201 ]; then
21 echo "Package created - Code $code - $body";
22 else
23 echo "Could not create package - Code $code - $body";
24 exit 1;
25 fi
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!