I have a GitLab CI pipeline that builds an Ionic app and then uploads it onto my Nexus Maven repository. I generate both an apk and an aab file that I upload via cURL. However, even though the APK file is properly pushed to the repo, the AAB file is nowhere to be found.
.gitlab-ci.yml file:
build-apk:
stage: build
tags: [docker]
script:
- rm package-lock.json
- npm install -g ionic@5.4.15 cordova@9.0.0
- npm run build:android:$STAGE
- cd platforms/android
- ./gradlew bundleRelease
- cd ../..
- echo $ANDROID_DEBUG_KEYSTORE | base64 --decode > key.keystore
- mv platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk app-release.apk
- mv platforms/android/app/build/outputs/bundle/release/app.aab $CI_PROJECT_NAME.aab
- jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore key.keystore -storepass "$ANDROID_DEBUG_PASSPHRASE" app-release.apk <keyName>
- jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore key.keystore -storepass "$ANDROID_DEBUG_PASSPHRASE" $CI_PROJECT_NAME.aab <keyName>
- $ANDROID_SDK_ROOT/build-tools/30.0.2/zipalign 4 app-release.apk $CI_PROJECT_NAME.apk
deploy-mobile:
stage: deploy
tags: [shell]
cache: {}
script:
- curl -u $NEXUS_USER:$NEXUS_PWD -v --upload-file $CI_PROJECT_NAME.aab $NEXUS_MAVEN/$CI_PROJECT_NAME/$CI_PROJECT_NAME-$TAG.aab
- curl -u $NEXUS_USER:$NEXUS_PWD -v --upload-file $CI_PROJECT_NAME.apk $NEXUS_MAVEN/$CI_PROJECT_NAME/$CI_PROJECT_NAME-$TAG.apk
dependencies:
- build-apk
When I compare the logs of both commands the only difference I see is that the HTTP answer is 400 bad request for the aab upload (the apk upload ends with 201 Created).
Is there any missing information I should add to my cURL command so that the aab file uploads? Am I obliged to use Maven commands to upload an aab file?