Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy PR on request #5642

Merged
merged 26 commits into from
May 10, 2020
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 11 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ git:
quiet: true

language: node_js
dist: trusty
dist: bionic
node_js:
- '12.13.1'
- '12.16.3'

install:
echo "no install"
Expand All @@ -19,7 +19,6 @@ branches:
- /.*beta.*/
- /.*greenkeeper.*/

# TRAVIS_PULL_REQUEST == false means is running on dev branch and is not a PR
stages:
- name: Lint & Build Dist
if: type = pull_request OR type = api
Expand All @@ -39,19 +38,17 @@ stages:
if: type = cron OR branch = master
- name: Trigger ADF child build
if: (branch = develop AND type = push) OR type = api
- name: Deploy PR
if: type = pull_request && commit_message =~ /\[create peview\]/

addons:
chrome: stable
before_script:
- "sudo chown root /opt/google/chrome/chrome-sandbox"
- "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"
- export GIT_HASH=`git rev-parse HEAD`

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
services:
- xvfb

jobs:
include:
Expand Down Expand Up @@ -110,12 +107,17 @@ jobs:
name: Update Rancher
script: ./scripts/travis/deploy/deploy.sh

- stage: Deploy PR
name: Deploy PR
script: ./scripts/travis/deploy/deploy-pr.sh


- stage: Check bundle
script:
- ADF_VERSION=$(npm view @alfresco/adf-core@${TAG_NPM} version)
- ./scripts/npm-check-bundles.sh -v ${ADF_VERSION}


- stage: Trigger ADF child build
name: Trigger ADF child build
script: ./scripts/travis/update/trigger-travis-children.sh --branch $TRAVIS_BRANCH Alfresco $TRAVIS_ACCESS_TOKEN
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ All components are supported in the following browsers:
* Due to a [known issue](https://bugzilla.mozilla.org/show_bug.cgi?id=1188880) in Firefox, the Alfresco Upload Component does not currently support folder upload functionality on Firefox.

See the [Browser Support](BROWSER-SUPPORT.md) article for more details.

6 changes: 6 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,10 @@ if [ -n "${APP_BASE_SHARE_URL}" ];then
-i ./app.config.json
fi

if [[ -n "${BASE_PATH}" ]]
then
sed s%href=\"/\"%href=\""${BASE_PATH}"\"%g \
-i ./index.html
fi

nginx -g "daemon off;"
89 changes: 44 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
"mdast-zone": "^3.0.1",
"mini-css-extract-plugin": "^0.9.0",
"nconf": "^0.10.0",
"ncp": "^2.0.0",
"ng-packagr": "4.7.1",
"node-sass": "4.13.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
Expand Down
7 changes: 5 additions & 2 deletions scripts/travis/deploy/deploy-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ TAG_VERSION=$(./scripts/travis/deploy/get-docker-image-tag-name.sh)
echo "Running the docker with tag" $TAG_VERSION

# Publish Image to docker
node ./scripts/travis/deploy/move-dist-folder.js --base-href $TRAVIS_BUILD_NUMBER

sed s%href=\"/\"%href=\""${TRAVIS_BUILD_NUMBER}"\"%g \
-i ./demo-shell/dist/index.html

./node_modules/@alfresco/adf-cli/bin/adf-cli docker-publish --loginCheck --loginUsername "$DOCKER_REPOSITORY_USER" --loginPassword "$DOCKER_REPOSITORY_PASSWORD" --loginRepo "$DOCKER_REPOSITORY_DOMAIN" --dockerRepo "$DOCKER_REPOSITORY" --dockerTags "$TAG_VERSION" --pathProject "$(pwd)"

echo "Update rancher with docker tag" $TAG_VERSION --url $REPO_RANCHER --environment_name $REPO_RANCHER_ADF_NAME

# Deploy PR in Rancher env
(node --no-deprecation ./scripts/travis/deploy/rancher-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);
(node --no-deprecation ./scripts/travis/deploy/rancher-pr-deploy.js -n $TRAVIS_BUILD_NUMBER -u $RANCHER_TOKEN -p $RANCHER_SECRET -s $REPO_RANCHER --image "alfresco/demo-shell:develop-$TRAVIS_BUILD_NUMBER" --env $ENVIRONMENT_NAME -r $ENVIRONMENT_URL || exit 1);
63 changes: 0 additions & 63 deletions scripts/travis/deploy/move-dist-folder.js

This file was deleted.