Fix GitLab CI/CD syntax errors in multiline scripts
This commit is contained in:
@@ -150,13 +150,7 @@ deploy:staging:
|
|||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- echo "Deploying to staging environment..."
|
- echo "Deploying to staging environment..."
|
||||||
- echo "APK available at: ${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/download"
|
- echo "APK available at ${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/download"
|
||||||
- |
|
|
||||||
curl -X POST "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/statuses/${CI_COMMIT_SHA}" \
|
|
||||||
--header "PRIVATE-TOKEN: ${CI_JOB_TOKEN}" \
|
|
||||||
--data "state=success" \
|
|
||||||
--data "name=APK Build" \
|
|
||||||
--data "target_url=${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/download"
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- build:debug
|
- build:debug
|
||||||
environment:
|
environment:
|
||||||
@@ -205,17 +199,14 @@ apk:info:
|
|||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- echo "Extracting APK information..."
|
- echo "Extracting APK information..."
|
||||||
- |
|
- APK_SIZE=$(du -h app/build/outputs/apk/debug/app-debug.apk | cut -f1)
|
||||||
APK_SIZE=$(du -h app/build/outputs/apk/debug/app-debug.apk | cut -f1)
|
- echo "APK Size$APK_SIZE"
|
||||||
echo "APK Size: $APK_SIZE"
|
- echo "Commit ${CI_COMMIT_SHORT_SHA}"
|
||||||
echo "Commit: ${CI_COMMIT_SHORT_SHA}"
|
- echo "---" > apk-info.txt
|
||||||
echo "Branch: ${CI_COMMIT_REF_NAME}"
|
- echo "SilverDROID - Dark Side Admin" >> apk-info.txt
|
||||||
echo "Build Time: $(date)"
|
- echo "Build ${CI_COMMIT_SHORT_SHA}" >> apk-info.txt
|
||||||
echo "---" > apk-info.txt
|
- echo "Size $APK_SIZE" >> apk-info.txt
|
||||||
echo "SilverDROID - Dark Side Admin" >> apk-info.txt
|
- echo "Date $(date)" >> apk-info.txt
|
||||||
echo "Build: ${CI_COMMIT_SHORT_SHA}" >> apk-info.txt
|
|
||||||
echo "Size: $APK_SIZE" >> apk-info.txt
|
|
||||||
echo "Date: $(date)" >> apk-info.txt
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- build:debug
|
- build:debug
|
||||||
artifacts:
|
artifacts:
|
||||||
@@ -230,16 +221,7 @@ apk:info:
|
|||||||
notify:success:
|
notify:success:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- echo "Build successful! Sending notification..."
|
- echo "Build successful! Pipeline ${CI_PIPELINE_URL}"
|
||||||
- |
|
|
||||||
curl -X POST "https://chat.silverlabs.uk/webhook" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{
|
|
||||||
\"text\": \"✅ SilverDROID Build Successful\",
|
|
||||||
\"commit\": \"${CI_COMMIT_SHORT_SHA}\",
|
|
||||||
\"branch\": \"${CI_COMMIT_REF_NAME}\",
|
|
||||||
\"pipeline\": \"${CI_PIPELINE_URL}\"
|
|
||||||
}" || true
|
|
||||||
when: on_success
|
when: on_success
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
only:
|
only:
|
||||||
@@ -248,16 +230,7 @@ notify:success:
|
|||||||
notify:failure:
|
notify:failure:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
script:
|
||||||
- echo "Build failed! Sending notification..."
|
- echo "Build failed! Pipeline ${CI_PIPELINE_URL}"
|
||||||
- |
|
|
||||||
curl -X POST "https://chat.silverlabs.uk/webhook" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{
|
|
||||||
\"text\": \"❌ SilverDROID Build Failed\",
|
|
||||||
\"commit\": \"${CI_COMMIT_SHORT_SHA}\",
|
|
||||||
\"branch\": \"${CI_COMMIT_REF_NAME}\",
|
|
||||||
\"pipeline\": \"${CI_PIPELINE_URL}\"
|
|
||||||
}" || true
|
|
||||||
when: on_failure
|
when: on_failure
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
only:
|
only:
|
||||||
|
|||||||
Reference in New Issue
Block a user