build and deploy

This commit is contained in:
Pfeil, Scott Robert 2021-06-30 17:14:45 -04:00
parent 60b67e3350
commit 323d44deb6
5 changed files with 82 additions and 55 deletions

View File

@ -1,8 +1,8 @@
stages:
# - test
- download
# - build
# - deploy
- build
- deploy
#test:
# stage: test
@ -14,8 +14,7 @@ stages:
download_artifacts:
stage: download
script:
- cd Scripts && ./download_dependencies.sh
# - ./Scripts/download_dependencies.sh
- ./Scripts/download_dependencies.sh
only:
- branches
- feature/script_to_upload
@ -27,31 +26,30 @@ download_artifacts:
variables:
ARTIFACTORY_URL: https://oneartifactoryprod.verizon.com/artifactory
#build_project:
# stage: build
# script:
# - xcodebuild build -project MVMCore/MVMCore.xcodeproj -scheme FatLibrary | xcpretty
# - BUILD_DIR=$(xcodebuild -showBuildSettings -project MVMCore/MVMCore.xcodeproj | grep BUILD_DIR)
# only:
# - branches
# - develop
# tags:
# - xcode_12_2
#
#deploy_snapshot:
# stage: deploy
# script:
# - cd Scripts && ./upload_core_frameworks.sh
# only:
# - branches
# - develop
# tags:
# - bash_shell
# environment:
# name: oneartifactory
# url: https://oneartifactoryprod.verizon.com/artifactory
# variables:
# ARTIFACTORY_URL: https://oneartifactoryprod.verizon.com/artifactory
build_project:
stage: build
script:
- ./Scripts/build_aggregate.sh
only:
- branches
- develop
tags:
- xcode_12_2
deploy_snapshot:
stage: deploy
script:
- cd Scripts && ./upload_core_ui_frameworks.sh
only:
- branches
- develop
tags:
- bash_shell
environment:
name: oneartifactory
url: https://oneartifactoryprod.verizon.com/artifactory
variables:
ARTIFACTORY_URL: https://oneartifactoryprod.verizon.com/artifactory
#promote_snapshot:
# stage: go live

26
Scripts/build_aggregate.sh Executable file
View File

@ -0,0 +1,26 @@
unset TOOLCHAINS #Xcode 7.3 BUG FIX http://stackoverflow.com/questions/36184930/xcodebuild-7-3-cant-enable-bitcode
# define output folder environment variable
C_PROJECT_NAME="MVMCoreUI"
PHONE_CONFIGURATION="Release"
SIMULATOR_CONFIGURATION="Debug"
BUILD_DIR=$(xcodebuild -showBuildSettings -project ./MVMCoreUI.xcodeproj | grep -w -o 'BUILD_DIR = .*' | cut -d\ -f3-)
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/universal
# Step 1. Build Device and Simulator versions
xcodebuild -scheme "${C_PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${PHONE_CONFIGURATION} -sdk iphoneos -archivePath "${BUILD_DIR}/${PHONE_CONFIGURATION}-iphoneos/${C_PROJECT_NAME}" archive SKIP_INSTALL=false FRAMEWORK_SEARCH_PATHS=./Frameworks
xcodebuild -target "${C_PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${SIMULATOR_CONFIGURATION} -sdk iphonesimulator -arch x86_64 BUILD_DIR="${BUILD_DIR}" FRAMEWORK_SEARCH_PATHS=./Frameworks
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
rm -rf ${UNIVERSAL_OUTPUTFOLDER}/${C_PROJECT_NAME}.framework
cp -R ${BUILD_DIR}/${PHONE_CONFIGURATION}-iphoneos/"${C_PROJECT_NAME}".xcarchive/Products/Library/Frameworks/${C_PROJECT_NAME}.framework ${UNIVERSAL_OUTPUTFOLDER}
# Step 2. Create universal binary file using lipo
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${C_PROJECT_NAME}" "${UNIVERSAL_OUTPUTFOLDER}/${C_PROJECT_NAME}.framework/${C_PROJECT_NAME}" "${BUILD_DIR}/${SIMULATOR_CONFIGURATION}-iphonesimulator/${C_PROJECT_NAME}.framework/${C_PROJECT_NAME}"
mv ${UNIVERSAL_OUTPUTFOLDER}/${C_PROJECT_NAME} ${UNIVERSAL_OUTPUTFOLDER}/${C_PROJECT_NAME}.framework/${C_PROJECT_NAME}

View File

@ -11,6 +11,9 @@ if [ -z $ARTIFACTORY_URL ]; then
ARTIFACTORY_URL="https://oneartifactoryprod.verizon.com/artifactory"
fi
[ ! -d "./Frameworks" ] && echo mkdir "Frameworks"
# Remote View Versions
#BUILD_DIR=$(xcodebuild -showBuildSettings -project ../MVMCore/MVMCore.xcodeproj | grep -w -o 'BUILD_DIR = .*' | cut -d\ -f3-)
./download_framework.sh $ARTIFACTORY_URL "./MVMCore.framework" BPHV_MobileFirst_IOS/com/vzw/hss/myverizon/MVMCore/1.0/MVMCore-1.0-Debug-SNAPSHOT.zip
./Scripts/download_framework.sh $ARTIFACTORY_URL "./Frameworks/MVMCore.framework" BPHV_MobileFirst_IOS/com/vzw/hss/myverizon/MVMCore/1.0/MVMCore-1.0-Debug-SNAPSHOT.zip
./Scripts/download_framework.sh $ARTIFACTORY_URL "./Frameworks/MVMAnimationFramework.framework" BPHV_MobileFirst_IOS/com/vzw/hss/myverizon/MVMAnimationFramework.framework/1.9/MVMAnimationFramework.framework-1.9.zip

View File

@ -1,24 +0,0 @@
#!/bin/sh -e
# upload_core_frameworks.sh
#
# Uploads all compiled framework flavors in MVMCore to Artifactory with the SNAPSHOT classifier. This is to avoid accidently clobbering a release build of a particular version. Remove the classifier in Artificatory to make a release.
#
# Copied from Hedden, Kyle Matthew on 3/2/18.
#
FRAMEWORK_VERSION=$(cd ../MVMCore && agvtool vers -terse)
if [ $(git tag --list | grep "v${FRAMEWORK_VERSION}") ]; then
echo This version tag has already been committed! Aborting!
exit 1
fi
# Create new aggregate builds
if [ -z $ARTIFACTORY_URL ]; then
ARTIFACTORY_URL="https://oneartifactoryprod.verizon.com/artifactory"
fi
# Remote View Versions
BUILD_DIR=$(xcodebuild -showBuildSettings -project ../MVMCore/MVMCore.xcodeproj | grep -w -o 'BUILD_DIR = .*' | cut -d\ -f3-)
./upload_framework.sh $ARTIFACTORY_URL "${BUILD_DIR}/universal/MVMCore.framework" BPHV_MobileFirst_IOS/com/vzw/hss/myverizon/MVMCore/[VER]/MVMCore-[VER]-Debug-SNAPSHOT

View File

@ -0,0 +1,24 @@
#!/bin/sh -e
# upload_core_ui_frameworks.sh
#
# Uploads all compiled framework flavors in MVMCoreUI to Artifactory with the SNAPSHOT classifier. This is to avoid accidently clobbering a release build of a particular version. Remove the classifier in Artificatory to make a release.
#
# Copied from Hedden, Kyle Matthew on 3/2/18.
#
FRAMEWORK_VERSION=$(cd .. && agvtool vers -terse)
if [ $(git tag --list | grep "v${FRAMEWORK_VERSION}") ]; then
echo This version tag has already been committed! Aborting!
exit 1
fi
# Create new aggregate builds
if [ -z $ARTIFACTORY_URL ]; then
ARTIFACTORY_URL="https://oneartifactoryprod.verizon.com/artifactory"
fi
# Upload
BUILD_DIR=$(xcodebuild -showBuildSettings -project ../MVMCoreUI.xcodeproj | grep -w -o 'BUILD_DIR = .*' | cut -d\ -f3-)
./upload_framework.sh $ARTIFACTORY_URL "${BUILD_DIR}/universal/MVMCoreUI.framework" BPHV_MobileFirst_IOS/com/vzw/hss/myverizon/MVMCoreUI/[VER]/MVMCoreUI-[VER]-Debug-SNAPSHOT