This is an old revision of the document!
Token: Set variable PERSONAL_TOKEN
in your project's Settings → CI/CD → Variables
stages: - publish publish: image: curlimages/curl:latest stage: publish script: - if [ -z "$CI_COMMIT_TAG" ]; then export PACKAGE_VERSION="branch=$CI_COMMIT_REF_NAME"; else export PACKAGE_VERSION="tag=$CI_COMMIT_TAG"; fi - if [ $(curl --write-out %{http_code} --silent --output /dev/null --insecure --data $PACKAGE_VERSION "http://__token__:$PERSONAL_TOKEN@$CI_SERVER_HOST:3000/api/v4/projects/$CI_PROJECT_ID/packages/composer") = "201" ]; then echo "Package created ..."; else echo "Could not create package ..."; exit 1; fi
stages: - test - publish test: image: composer:2 stage: test script: - composer install - vendor/bin/codecept run --html artifacts: paths: - tests/_output/report.html expire_in: 1 weeks publish: image: curlimages/curl:latest stage: publish script: - if [ -z "$CI_COMMIT_TAG" ]; then export PACKAGE_VERSION="branch=$CI_COMMIT_REF_NAME"; else export PACKAGE_VERSION="tag=$CI_COMMIT_TAG"; fi - if [ $(curl --write-out %{http_code} --silent --output /dev/null --insecure --data $PACKAGE_VERSION "http://__token__:$PERSONAL_TOKEN@$CI_SERVER_HOST:3000/api/v4/projects/$CI_PROJECT_ID/packages/composer") = "201" ]; then echo "Package created ..."; else echo "Could not create package ..."; exit 1; fi