git: depth: 3 quiet: true language: node_js dist: trusty sudo: required node_js: # Use the explicit NodeJS LTS version 8.9.4 to avoid any automatic upgrade of the version. - '8.9.4' install: echo "no install" branches: only: - master - development # TRAVIS_PULL_REQUEST == false means is running on dev branch and is not a PR stages: - name: Warm Up Cache if: branch = master - name: Warm Up Cache & Lint & Build Dist if: branch != master - name: Unit test - name: e2e Test - name: Create Docker PR - name: Deploy Docker PR addons: chrome: stable before_script: - "sudo chown root /opt/google/chrome/chrome-sandbox" - "sudo chmod 4755 /opt/google/chrome/chrome-sandbox" before_install: - export CHROME_BIN=chromium-browser - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 3 # give xvfb some time to start branches: only: - master - development jobs: include: - stage: Warm Up Cache script: - ./scripts/npm-build-all.sh || exit 1 - stage: Warm Up Cache & Lint & Build Dist script: - ./scripts/update-version.sh -gnu -alpha || exit 1 - npm install - ./scripts/lint.sh || exit 1 - npm run spellcheck || exit 1 - npm run stylelint || exit 1 - rm -rf tmp && (./scripts/smart-build.sh -b $TRAVIS_BRANCH || exit 1;); - npm run build:dist || exit 1 - stage: Unit test name: core script: AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "core$" || $TRAVIS_PULL_REQUEST == "false" ]]; then ng test core --watch=false || exit 1; fi - stage: Unit test name: extensions script: AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "extensions$" || $TRAVIS_PULL_REQUEST == "false" ]]; then ng test extensions --watch=false || exit 1; fi - stage: Unit test name: process-services script: AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "process-services$" || $TRAVIS_PULL_REQUEST == "false" ]]; then ng test process-services --watch=false || exit 1; fi - stage: Unit test name: insights script: AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "insights$" || $TRAVIS_PULL_REQUEST == "false" ]]; then ng test insights --watch=false || exit 1; fi - stage: Unit test name: content-services script: AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "content-services$" || $TRAVIS_PULL_REQUEST == "false" ]]; then ng test content-services --watch=false || exit 1; fi - stage: Unit test name: process-services-cloud script: AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $TRAVIS_PULL_REQUEST == "false" ]]; then ng test process-services-cloud --watch=false || exit 1; fi - stage: Unit test name: demo-shell script: if ([ "$TRAVIS_BRANCH" = "master" ]); then (./scripts/start.sh -t -ss || exit 1;); else (./scripts/start.sh -dev -t -ss -vjsapi alpha || exit 1;); fi - stage: Update children projects dependency #Update generator-ng2-alfresco-app if: tag =~ .*beta.* script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n generator-ng2-alfresco-app - stage: Update children projects dependency # Test Update alfresco-content-app if: tag =~ .*beta.* script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n alfresco-content-app - stage: Update children projects dependency # Test Update adf-app-manager-ui if: tag =~ .*beta.* script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n adf-app-manager-ui - stage: Update children projects dependency # Test Update aalfresco-ng2-components if: tag =~ .*beta.* script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n alfresco-ng2-components - stage: Update children projects dependency # Test Update alfresco-modeler-app if: tag =~ .*beta.* script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n alfresco-modeler-app - stage: e2e Test # Test core name: core script: AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")"; AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "core$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then (./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" --host_bpm "$E2E_HOST_BPM" --host_identity "$E2E_HOST_IDENTITY" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder core --skip-lint --use-dist || exit 1;); fi - stage: e2e Test # Test process-services name: process-services script: AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")"; AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "process-services$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services --skip-lint --use-dist || exit 1;); fi - stage: e2e Test # Test content-services name: content-services script: AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")"; AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder content-services --skip-lint --use-dist || exit 1;); fi - stage: e2e Test # Test search name: search script: AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")"; AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" ]]; then (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder search --skip-lint --use-dist || exit 1;); fi - stage: e2e Test # Test process-services-cloud name: process-services-cloud script: AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")"; AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then (./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" --host_bpm "$E2E_HOST_BPM" --host_identity "$E2E_HOST_IDENTITY" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services-cloud --skip-lint --use-dist || exit 1;); fi - stage: e2e Test # Test insights name: insights script: AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")"; AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder insights --skip-lint --use-dist || exit 1;); fi - stage: Create Docker PR script: node ./scripts/move-dist-folder.js --base-href $TRAVIS_BUILD_NUMBER && (./scripts/pr-publish.sh -n $TRAVIS_BUILD_NUMBER -r $REPO_DOCKER -u $USERNAME_DOCKER -p $PASSWORD_DOCKER || exit 1) - stage: Deploy Docker PR script: node --no-deprecation ./scripts/pr-deploy.js -n $TRAVIS_BUILD_NUMBER -u $RANCHER_TOKEN -p $RANCHER_SECRET -s $REPO_RANCHER --image "docker:$REPO_DOCKER/adf/demo-shell:$TRAVIS_BUILD_NUMBER" --env $ENVIRONMENT_NAME -r $ENVIRONMENT_URL || exit 1 # Send coverage data to codecov after_success: bash <(curl -s https://codecov.io/bash) -X gcov cache: directories: - node_modules - demo-shell/dist - tmp