Advertisement
Guest User

.gitlab-ci.yml

a guest
Apr 15th, 2019
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.23 KB | None | 0 0
  1. image: jamesdbloom/docker-java8-maven
  2.  
  3. variables:
  4. #  MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
  5.   MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
  6.   GIT_SSL_NO_VERIFY: "true"
  7.  
  8.  
  9. before_script:
  10. #  - apt-get update || apt-get update
  11.   - apt-get install zip unzip -y
  12.   - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  13.   - mkdir -p ~/.ssh
  14.   - eval $(ssh-agent -s)
  15.   - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
  16.  
  17. build:
  18.   stage: build
  19.   script:
  20.    - mvn compile
  21.   only:
  22.    - biblioteka
  23.  
  24. deploy:
  25.   stage: deploy
  26.   script:
  27.    - mvn deploy
  28.     - ssh-add <(echo "$SSH_PRIVATE_KEY")
  29.     - (cd ../shop-assistant-mvn-repo ; git init)
  30.     - (cd ../shop-assistant-mvn-repo ; git remote add origin git@git.e-science.pl:wwojcik235621/81e_WWojcik_Maven.git)
  31.     - (cd ../shop-assistant-mvn-repo ; git fetch -p)
  32.     - (cd ../shop-assistant-mvn-repo ; git checkout gitlabRunner -f)
  33.     - (cd ../shop-assistant-mvn-repo ; git add -A)
  34.     - (cd ../shop-assistant-mvn-repo ; git commit -m "gitlab runner realise")
  35.     - (echo "git push origin gitlabRunner")
  36.     - (cd ../shop-assistant-mvn-repo ; git push origin gitlabRunner)
  37.   only:
  38.    - biblioteka
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement