如何在我的.gitlab-ci.yml
?
我想将它插入该after_script
部分,以便我可以使用工件的链接进行 webhook 调用,该链接将使用此管道生成。
我尝试了以下内容,但它只是将其读取为字符串。
stages:
- build
flutter_build_android:
timeout: 1h
stage: build
before_script:
- flutter clean
- flutter pub get
script:
- flutter build apk --dart-define=SDK_REGISTRY_TOKEN="${MAPBOX_TOKEN}"
- cp build/app/outputs/apk/release/app-release.apk ./
artifacts:
paths:
- ./app-release.apk
when: on_success
expire_in: 30 days
after_script:
- >
curl -H 'Content-Type: application/json' -d '{"text": "http://gitlab.company.pl/mobile/flutter/myproject/-/jobs/artifacts/$CI_JOB_ID/download?job=$CI_JOB_NAME"}' https://link.to.my/webhook/eca8
tags:
- gradle
- flutter
rules:
- if: '$CI_COMMIT_BRANCH == "rc"'