Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
my-test-group
TestAppCiNew
Commits
1a0c5818
Commit
1a0c5818
authored
Nov 27, 2025
by
jayed nahian
Browse files
fix-44
parent
2ccfd8d0
Pipeline
#8116
failed with stage
in 1 minute and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
1a0c5818
...
...
@@ -30,25 +30,50 @@ deploy_job:
variables
:
SECURE_FILES_DOWNLOAD_PATH
:
'
./android/'
VERSION_NAME
:
'
4.4.2'
APK_NAME_PREFIX
:
'
testApp'
APK_NAME_PREFIX
:
'
testApp
_01
'
APK_NAME
:
$APK_NAME_PREFIX'_'$VERSION_NAME'_'$(date '+%d%B')
script
:
# -----------------------
# Setup SSH
# -----------------------
-
mkdir -p ~/.ssh
-
echo "$SSH_KEY" > ~/.ssh/id_rsa
-
chmod 600 ~/.ssh/id_rsa
# Start SSH Agent and add password-protected key
-
eval "$(ssh-agent -s)"
-
ssh-add ~/.ssh/id_rsa <<< "$SSH_PASSPHRASE"
# Add host to known_hosts
-
ssh-keyscan -p $SSH_PORT $SERVER_IP >> ~/.ssh/known_hosts
-
curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
# -----------------------
# Build APK
# -----------------------
-
export JAVA_HOME=$(/usr/libexec/java_home -v 17)
-
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/
-
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 ./.gradle/6.8.3/executionHistory/executionHistory.lock
-
echo "sdk.dir=/Users/tltestuser/Library/Android/sdk" > local.properties
-
./gradlew assembleRelease
# List all APKs to verify location
# -----------------------
# Find & Rename APK
# -----------------------
-
find ./app/build/outputs/apk -type f -name "*.apk"
# Store APK path in variable
-
APK_DIR="./app/build/outputs/apk/release"
-
cd $APK_DIR
# Rename and copy
-
mv app-release.apk $APK_NAME_PREFIX"_"$VERSION_NAME"_"$(date '+%d%B').apk
-
scp -i /Users/tltestuser/Downloads/ndot_key_14012025 -P 3716 *.apk custodian@n.trucklagbe.com:/var/www/n.trucklagbe.com/html/APK/QO/
-
mv app-release.apk "$APK_NAME_PREFIX"_"$VERSION_NAME"_$(date '+%d%B').apk
# -----------------------
# Secure Upload (SCP)
# -----------------------
-
scp -P $SSH_PORT *.apk $SSH_USER@$SERVER_IP:/var/www/n.trucklagbe.com/html/APK/QO/
# - scp -i /Users/tltestuser/Downloads/ndot_key_14012025 -P 3716 *.apk custodian@n.trucklagbe.com:/var/www/n.trucklagbe.com/html/APK/QO/
except
:
-
pushes
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment