|
| 1 | +version: 2.1 |
| 2 | + |
| 3 | +jobs: |
| 4 | + build: |
| 5 | + docker: |
| 6 | + - image: circleci/openjdk:11-stretch-browsers |
| 7 | + steps: |
| 8 | + - checkout |
| 9 | + - run: |
| 10 | + command: mvn clean verify |
| 11 | + - when: |
| 12 | + condition: |
| 13 | + equal: [master, << pipeline.git.branch >>] |
| 14 | + steps: |
| 15 | + - run: |
| 16 | + name: Sonar Analysis |
| 17 | + command: > |
| 18 | + mvn sonar:sonar |
| 19 | + -Dsonar.login=${SONAR_TOKEN} |
| 20 | + -Dsonar.projectKey="camel-lsp-client-eclipse" |
| 21 | + -Dsonar.projectName="Eclipse Client for Apache Camel Language Server" |
| 22 | + -Dsonar.organization=camel-tooling |
| 23 | + -Dsonar.host.url=https://sonarcloud.io |
| 24 | + - run: |
| 25 | + name: Prepare environment variable for update site generation |
| 26 | + command: | |
| 27 | + echo "export PLUGIN_VERSION=`grep '<version>' pom.xml -m 1 | cut -d'>' -f 2 | cut -d'<' -f 1`" >> $BASH_ENV |
| 28 | + export IS_SNAPSHOT=`grep '<version>' pom.xml -m 1 | cut -d'>' -f 2 | cut -d'<' -f 1 | cut -d'-' -f 2` |
| 29 | + echo IS_SNAPSHOT=$IS_SNAPSHOT >> $BASH_ENV |
| 30 | + if [[ $IS_SNAPSHOT == "SNAPSHOT" ]]; then echo 'export DEPLOY_REPO_ROOT=nightly' >> $BASH_ENV; else echo 'export DEPLOY_REPO_ROOT=stable' >> $BASH_ENV; fi |
| 31 | + - run: |
| 32 | + name: Prepare update site |
| 33 | + command: | |
| 34 | + mkdir -v com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite/ |
| 35 | + mkdir -v com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite/${DEPLOY_REPO_ROOT}/ |
| 36 | + mv -v com.github.camel-tooling.lsp.eclipse.updatesite/target/repository/* com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite/${DEPLOY_REPO_ROOT}/ |
| 37 | + find website/* -name 'index.html' | xargs perl -pi -e "s/##VERSION##/${PLUGIN_VERSION}/g" |
| 38 | + find website/* -name 'index.html' | xargs perl -pi -e "s/##TYPE##/${DEPLOY_REPO_ROOT}/g" |
| 39 | + cp -v website/index.html com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite/${DEPLOY_REPO_ROOT}/ |
| 40 | + - store_artifacts: |
| 41 | + name: Store update site |
| 42 | + path: com.github.camel-tooling.lsp.eclipse.updatesite/target/updatesite/ |
| 43 | + - store_artifacts: |
| 44 | + name: Store log of UI tests |
| 45 | + path: /home/circleci/project/com.github.camel-tooling.lsp.eclipse.client.tests.ui/tests/com.github.cameltooling.lsp.ui.tests/target/work/data/.metadata/.log |
| 46 | +workflows: |
| 47 | + camel-lsp-client-eclipse: |
| 48 | + jobs: |
| 49 | + - build: |
| 50 | + context: sonarcloud |
0 commit comments