Commit 383a1a93 authored by jayed nahian's avatar jayed nahian
Browse files

new-44

parent 2a19494e
Pipeline #8158 failed
...@@ -9,12 +9,14 @@ before_script: ...@@ -9,12 +9,14 @@ before_script:
- rm -rf node_modules package-lock.json - rm -rf node_modules package-lock.json
- npm cache clean --force - npm cache clean --force
- npm install - npm install
- ls -la node_modules/react/
- ls -la index.js
deploy_job: deploy_job:
stage: deploy stage: deploy
tags: tags:
- android-docker-runner # ← Use this tag! - android-docker-runner
variables: variables:
VERSION_NAME: '4.4.2' VERSION_NAME: '4.4.2'
APK_NAME_PREFIX: 'testApp_01' APK_NAME_PREFIX: 'testApp_01'
...@@ -24,33 +26,22 @@ deploy_job: ...@@ -24,33 +26,22 @@ deploy_job:
SSH_USER: 'custodian' SSH_USER: 'custodian'
script: script:
# Java and Android SDK are pre-installed in Docker image!
- echo "Java version:" - echo "Java version:"
- java -version - java -version
- echo "Android SDK: $ANDROID_HOME" - echo "Android SDK: $ANDROID_HOME"
# SSH setup
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
- echo "$SSH_KEY" > ~/.ssh/id_rsa - echo "$SSH_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa
- eval "$(ssh-agent -s)" - eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_rsa <<< "$SSH_PASSPHRASE" - ssh-add ~/.ssh/id_rsa <<< "$SSH_PASSPHRASE"
- ssh-keyscan -H -p $SSH_PORT $SERVER_IP >> ~/.ssh/known_hosts - ssh-keyscan -H -p $SSH_PORT $SERVER_IP >> ~/.ssh/known_hosts
# Bundle JS
- npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ - npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
# Build APK
- cd android - cd android
- rm -rf ./app/src/main/res/**/node_modules_* ./app/src/main/res/**/app_assets* ./app/src/main/res/**/assets* ./app/src/main/res/**/app* - rm -rf ./app/src/main/res/**/node_modules_* ./app/src/main/res/**/app_assets* ./app/src/main/res/**/assets* ./app/src/main/res/**/app*
- ./gradlew assembleRelease - ./gradlew assembleRelease
- cd ./app/build/outputs/apk/release
# Rename and upload - mv app-release.apk "${APK_NAME_PREFIX}_${VERSION_NAME}_$(date '+%d%B').apk"
- APK_DIR="./app/build/outputs/apk/release" - scp -P $SSH_PORT "${APK_NAME_PREFIX}_${VERSION_NAME}_$(date '+%d%B').apk" $SSH_USER@$SERVER_IP:/var/www/n.trucklagbe.com/html/APK/QO/
- cd $APK_DIR
- APK_NAME="${APK_NAME_PREFIX}_${VERSION_NAME}_$(date '+%d%B').apk"
- mv app-release.apk "$APK_NAME"
- scp -P $SSH_PORT "$APK_NAME" $SSH_USER@$SERVER_IP:/var/www/n.trucklagbe.com/html/APK/QO/
except: except:
- pushes - pushes
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment