git clone -b source_code --single-branch https://github.com/EvgeniaPatsoni/OpenWIS_Training.git
mvnw.cmd clean install -Dmaven.test.skip
mvnw.cmd verify
java -jar target/cicd-example-1.0.0-SNAPSHOT.jar
git init
git remote add origin <repo_url>
git add .
git commit –m "<commit_message>"
git push --set-upstream origin master
language: java
jdk: openjdk11
before_install:
- chmod +x mvnw
script:
- ./mvnw clean install
notifications:
email:
recipients:
- <email_address>
on_success: always
on_failure: always
addons:
sonarcloud:
organization: "<organization_name>"
token:
secure: "**************************"
script:
- ./mvnw clean install sonar:sonar -Dsonar.projectKey=<key>
mvnw.cmd org.owasp:dependency-check-maven:aggregate
mvnw.cmd sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=<organization_name> -Dsonar.projectKey=<key> -Dsonar.login=<token>
before_install:
- openssl aes-256-cbc -K $encrypted_180f41e11b0e_key -iv $encrypted_180f41e11b0e_iv
-in <key_name>.enc -out <key_name> –d
- chmod +x mvnw
- eval "$(ssh-agent -s)"
- chmod 600 <key_name>
- ssh-add <key_name>
- echo -e "Host ${DEPLOY_HOST}\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
deploy:
- provider: script
skip-cleanup: true
script: rsync -r --quiet --delete-after ${TRAVIS_BUILD_DIR}/target/cicd-example-*.jar ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_DIRECTORY}
on:
branch: master
- provider: script
skip-cleanup: true
script: sh ${TRAVIS_BUILD_DIR}/remote_deploy.sh
on:
branch: master