Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. TAG="UPDTR"
  4. BRANCH=$(git symbolic-ref -q --short HEAD)
  5.  
  6. # Prints horizontal link for all terminal width.
  7. function mess() {
  8. echo "*** $1"
  9. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' '*'
  10. }
  11.  
  12.  
  13. mess "Export translation .po files on stage"
  14. drush @stage.all language-export-translations fr sites/all/translations --y --replace
  15. mess "Copy updated .po files from stage to local instance"
  16. scp -r telerama@stage.telerama.adyax.net:../../var/www/stage/current/docroot/sites/all/translations/* sites/all/translations
  17. mess "Check changes of translations"
  18. CHANGED=$(echo $(git diff-index --name-status --exit-code HEAD | grep ".fr.po"))
  19. if [ -n "${CHANGED}" ]; then
  20. mess "Commit changes in branch $BRANCH"
  21. git add ../sites/all/translations/\*.po
  22. git commit -m "[$TAG] update translations from stage instance"
  23. git push origin $BRANCH
  24. else
  25. mess "No changes found"
  26. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement