SHARE
TWEET

Untitled

a guest Mar 20th, 2017 125 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. services:
  2.   - mariadb:10.1.20
  3.  
  4. variables:
  5.   MYSQL_ROOT_PASSWORD: test-database
  6.   RELEASE_BRANCH: master
  7.   RELEASE_VERSION_API: "1.0.0" # the version that will be released
  8.   NEXT_DEV_VERSION_API: "1.0.1-SNAPSHOT" # the next dev iteration version
  9.  
  10. before_script:
  11.   - mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mariadb < "src/main/resources/tests.sql"
  12.  
  13. stages:
  14.   - build
  15.   - test
  16.   - deploy
  17.  
  18. # The compile job might be executed anywhere but master/develop
  19. job_compiling_api:
  20.   stage: build
  21.   only:
  22.     - branches
  23.   except:
  24.     - master
  25.   script:
  26.     - mvn -Dspring.profiles.active=test compile
  27.  
  28. # The test job might be executed anywhere but master/develop
  29. job_testing_api:
  30.   stage: test
  31.   only:
  32.     - branches
  33.   except:
  34.     - master
  35.   script:
  36.     - mvn -Dspring.profiles.active=test test sonar:sonar
  37.  
  38. # Only on develop
  39. job_snapshot_api:
  40.   stage: deploy
  41.   only:
  42.     - develop
  43.   script:
  44.     - mvn -Dspring.profiles.active=uat -DskipTests --batch-mode deploy
  45.  
  46. # This job will be executed when triggered
  47. job_release_api:
  48.   stage: deploy
  49.   only:
  50.     - /^trigger-release.*$/
  51.   script:
  52.     - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  53.     - eval $(ssh-agent -s)
  54.     - ssh-add ~/.ssh/id_rsa
  55.     - mkdir -p ~/.ssh
  56.     - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
  57.     - git config --global user.email "gitlab@pegase.ovh"
  58.     - git config --global user.name "GitLab-CI"
  59.     - git remote set-url origin git@gitlab.pegase.ovh:NoOsea/Pegase-API.git
  60.     - git checkout -B $RELEASE_BRANCH --track origin/$RELEASE_BRANCH
  61.     - mvn -Dspring.profiles.active=prod -DskipTests release:prepare release:perform -DreleaseVersion=$RELEASE_VERSION_API -DdevelopmentVersion=$NEXT_DEV_VERSION_API -Darguments="-DskipTests"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top