mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-04 04:22:50 +00:00
feat: automate generation for universal link files
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
app
|
||||
Gemfile.lock
|
||||
.vscode
|
||||
.vscode
|
||||
.DS_Store
|
||||
2
Makefile
2
Makefile
@@ -1,6 +1,7 @@
|
||||
SHELL := /bin/bash
|
||||
APP_DIR := $(PWD)/app
|
||||
BRANCH ?= develop
|
||||
START_TIME := $(date +%s)
|
||||
|
||||
clean:
|
||||
rm -rf app
|
||||
@@ -27,6 +28,7 @@ web-build: configuration-web
|
||||
cd app && ionic build --prod
|
||||
|
||||
web: web-build
|
||||
mkdir -p app/www/.well-known && source app.conf && sh static/scripts/universal_link_files.sh
|
||||
cd app/www && zip -r ../../www.zip .
|
||||
echo "Web application artifact for version ${VERSION} is archived in www.zip"
|
||||
|
||||
|
||||
58
static/scripts/universal_link_files.sh
Normal file
58
static/scripts/universal_link_files.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
. $PWD/app.conf
|
||||
|
||||
# iOS universal link file generation
|
||||
if [ -z "$TEAM_ID" ] && [ -z "$IOS_BUNDLE_IDENTIFIER" ]
|
||||
then
|
||||
echo "Unable to find Apple Team ID and bundle identifier. Skipping apple-app-site-association generation..."
|
||||
else
|
||||
file_content=$(cat <<EOF
|
||||
{
|
||||
"applinks": {
|
||||
"details": [
|
||||
{
|
||||
"appIDs": [ "${TEAM_ID}.${IOS_BUNDLE_IDENTIFIER}"],
|
||||
"components": [
|
||||
{
|
||||
"/": "/*",
|
||||
"comment": "Match all links"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
EOF
|
||||
)
|
||||
echo $file_content > $PWD/app/www/.well-known/apple-app-site-association
|
||||
fi
|
||||
|
||||
|
||||
# Google Play/Android universal link file generation
|
||||
KEYTOOL_INFO=$(keytool -list -v -keystore ./playstore.keystore -alias $ANDROID_KEYSTORE_KEY_ALIAS -storepass $ANDROID_KEYSTORE_PASSWORD -keypass $ANDROID_KEYSTORE_KEY_PASSWORD || true)
|
||||
CERT_FINGERPRINT=$(echo $KEYTOOL_INFO | sed -n 's/.*SHA256: //p')
|
||||
|
||||
if [ -z "$CERT_FINGERPRINT" ]
|
||||
then
|
||||
echo "Unable to retrieve Android sigining SHA256 fingerprint. Skipping assetlinks.json generation..."
|
||||
else
|
||||
file_content=$(cat <<EOF
|
||||
[
|
||||
{
|
||||
"relation": [
|
||||
"delegate_permission/common.handle_all_urls"
|
||||
],
|
||||
"target": {
|
||||
"namespace": "android_app",
|
||||
"package_name": "${ANDROID_PACKAGE_NAME}",
|
||||
"sha256_cert_fingerprints": [
|
||||
"${CERT_FINGERPRINT}"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
EOF
|
||||
)
|
||||
echo $file_content > $PWD/app/www/.well-known/assetlinks.json
|
||||
fi
|
||||
Reference in New Issue
Block a user