2

Je suis développeur iOS et J'ai récemment joué avec Gitlab essayant de comprendre si c'est mieux/plus pratique que redmine + jenkins + HockeyApp. Gitlab semble être assez cool, sauf que je ne peux pas comprendre comment télécharger ma version iOS ad hoc sur HockeyApp (ou TestFlight). Est-ce même possible?Gitlab Continuous Les options de livraison

Merci

Répondre

3

Oui, c'est certainement possible. Je recommande fortement d'utiliser le fastlane Ruby gem. Il a même docs for using it with GitLab CI. Vous pouvez utiliser spécifiquement le pilote pour télécharger la version dans TestFlight.

Si tout va bien qui aide :)

+0

Merci, je vais vérifier :) –

0

J'ai fini avec la configuration suivante:

Ajouter un fichier deploy.sh:

#!/bin/bash 
echo "deploy to hockeyapp" 

HOCKEYAPP_APP_NAME="MyApp.iOS.ipa" 
HOCKEYAPP_TOKEN="MyTOKEN" 
HOCKEYAPP_ID="MYAPPID" 

function buildNotes { 

    # We need an initial bullet point for our list of commit logs 
    echo -n "* " 
    # Get the latest app uploads 
    curl -H "X-HockeyAppToken: $HOCKEYAPP_TOKEN" \ 
    "https://rink.hockeyapp.net/api/2/apps/$HOCKEYAPP_ID/app_versions?page=1" | \ 
    # Put every property on a separate line 
    sed 's/,/\n/g' | \ 
    # Remove all the quotation marks 
    sed 's/"//g' | \ 
    # Look at only the notes properties 
    grep notes | \ 
    # Look at the first one, i.e. the latest app upload 
    head -n 1 | \ 
    # Find the commit information at the bottom of the notes 
    sed -n 's/.*(commit:\([^)]*\)).*/\1/p' | \ 
    # Let's find all the logs since that commit 
    xargs -I '{}' git log {}..HEAD --pretty=format:'%h %s' --no-merges | \ 
    # Add a star to each newline to make the list 
    sed ':a;N;$!ba;s/\n/\n* /g' 
    # The end of the revision log must have the latest commit 
    # This is so later we can do the above again 
    echo 
    echo -n "* (commit:" 
    git rev-parse HEAD | xargs echo -n 
    echo -n ')' 
} 

function deployAppFlavor() { 
    echo "executeCurlCommand" 
    curl -F "status=2" \ 
    -F "notify=1" \ 
    -F "notes=<release_notes" \ 
    -F "notes_type=0" \ 
    -F "[email protected]/build/MyApp.iOS.ipa/$1" \ 
    -H "X-HockeyAppToken: $2"\ 
    "https://rink.hockeyapp.net/api/2/apps/$3/app_versions/upload" 
} 

function deployApp { 
    buildNotes > release_notes 
    deployAppFlavor $HOCKEYAPP_APP_NAME $HOCKEYAPP_TOKEN $HOCKEYAPP_ID 
} 

deployApp 

puis mettre à jour le fichier YML:

build_project: 
    stage: build 

    script: 
    - xcodebuild clean -workspace MyApp.iOS.xcworkspace -scheme MyApp.iOS -quiet 
    - xcodebuild build -workspace MyApp.iOS.xcworkspace -scheme MyApp.iOS -destination 'platform=iOS Simulator,name=iPhone 6s' | xcpretty -s > -quiet 

archive_project: 
    stage: archive 
    script: 
    - xcodebuild clean archive -archivePath "build/MyApp.iOS.xcarchive" -workspace "MyApp.iOS.xcworkspace" -scheme MyApp.iOS -quiet 
    - xcodebuild -exportArchive -archivePath "build/MyApp.IOS.xcarchive" -exportPath "build/MyApp.iOS.ipa" -exportOptionsPlist "export.plist" -quiet 
    artifacts: 
    paths: 
     - src/build/MyApp.iOS.ipa 

deploy: 
    before_script: 
    - chmod +x ./scripts/deploy.sh 
    stage: deploy 
    script: 
    - ./scripts/deploy.sh