remove travis remains (#3051)

This commit is contained in:
Denys Vuika
2023-03-14 17:01:56 -04:00
committed by GitHub
parent 680319596a
commit eba0f9aef8
24 changed files with 28 additions and 527 deletions
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
storage_dir="./storage-state/AdminUserState.json"
rm -rf $storage_dir
# Upload protractor-smartrunner artifact related to this particular job to S3
./scripts/ci/utils/artifact-to-s3.sh -a "$SMART_RUNNER_DIRECTORY" -o "$S3_DBP_FOLDER/protractor-smartrunner-$TRAVIS_JOB_ID.tar.bz2"
@@ -1,3 +0,0 @@
#!/usr/bin/env bash
npx playwright install chromium
-48
View File
@@ -1,48 +0,0 @@
#!/usr/bin/env bash
# ---------------------------------------------------------------
# Validating replaced app.config.json
# ---------------------------------------------------------------
app_config_checker(){
APP_CONFIG_FILE_PATH=$1;
echo -n " \_ Validating replaced config file ... ";
$(npm bin)/ajv validate -s ./node_modules/@alfresco/adf-core/app.config.schema.json -d $APP_CONFIG_FILE_PATH --errors=text --verbose || exit 4
if grep -E -q '\$\{[A-Z0-9_]*\}' $APP_CONFIG_FILE_PATH; then
echo -e "\e[31m \_ ERROR: Variables are still present in the app.config.json file. Some of them might not have default value set.\e[0m";
exit 5;
fi
}
FROM=$1;
TO=$2;
PARAMS=$3;
echo "====== Check content UP ====="
./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host "$APP_CONFIG_ECM_HOST" -u "$ADMIN_EMAIL" -p "$ADMIN_PASSWORD" || exit 1
echo "====== Download artifacts ====="
# Download built application artifact from S3
./scripts/ci/utils/artifact-from-s3.sh -a "$FROM" -o "$TO"
APP_CONFIG_FILE_PATH="$TO/app.config.json"
EXTRA_ENV_SETTINGS=""
# Replace variables in app.config.json
envsub $EXTRA_ENV_SETTINGS --all $APP_CONFIG_FILE_PATH $APP_CONFIG_FILE_PATH || exit 1
app_config_checker $APP_CONFIG_FILE_PATH
# Download protractor-smartrunner artifact related to this particular job from S3, if exists
./scripts/ci/utils/artifact-from-s3.sh -a "$S3_DBP_FOLDER/protractor-smartrunner-$TRAVIS_JOB_ID.tar.bz2" -o "$SMART_RUNNER_DIRECTORY"
echo "====== Update webdriver-manager ====="
if [ "$CI" = "true" ]; then
export chrome=$(google-chrome --product-version)
echo "Updating wedriver-manager with chromedriver: $chrome."
webdriver-manager update --gecko=false --versions.chrome=$chrome
else
echo "Updating wedriver-manager with latest chromedriver, be sure to use evergreen Chrome."
webdriver-manager update --gecko=false
fi
-42
View File
@@ -1,42 +0,0 @@
#!/usr/bin/env bash
PARENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
# Build and test options -----------------------------------------------------------------------
export BUILD_OPTS="--configuration=production,e2e"
export TEST_OPTS=""
export E2E_PROTRACTOR_OPTS=""
export E2E_TSCONFIG="tsconfig.e2e.json"
# Commit settings for ADF linking -----------------------------------------------------
export HEAD_COMMIT_HASH=${TRAVIS_PULL_REQUEST_SHA:-${TRAVIS_COMMIT}}
export COMMIT_MESSAGE=`git log --format=%B -n 1 $HEAD_COMMIT_HASH`
# Settings for Angular builder --------------------------------------------------------
export NODE_OPTIONS="--max_old_space_size=30000"
# Settings for protractor-smartrunner -------------------------------------------------
export GIT_HASH=`git rev-parse HEAD`
export SMART_RUNNER_DIRECTORY=".protractor-smartrunner"
# Settings for Nx ---------------------------------------------------------------------
export BASE_HASH="$(git describe --tags `git rev-list --tags --max-count=1`)"
export HEAD_HASH="HEAD"
# Settings for S3 caching -------------------------------------------------------------
pip install --user awscli
S3_DBP_PATH="s3://alfresco-travis-builds/aca"
if [ "${TRAVIS_EVENT_TYPE}" == "push" ]; then
export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/$TRAVIS_BRANCH"
elif [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/$TRAVIS_PULL_REQUEST"
export BASE_HASH="origin/$TRAVIS_BRANCH"
source $PARENT_DIR/partials/_adf-linking.sh
elif [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/cron"
else
export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/api"
fi
export S3_DBP_FOLDER="$S3_DBP_ROOT_FOLDER/$TRAVIS_BUILD_ID"
echo "BASE_HASH: $BASE_HASH"
echo "S3 DBP root folder: $S3_DBP_ROOT_FOLDER"
echo "S3 DBP destination: $S3_DBP_FOLDER"
-44
View File
@@ -1,44 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
show_help() {
echo "Usage: affected-filtered-project.sh"
echo ""
echo "-target Project target"
echo "-tag Filter project with tag"
echo "-name Filter project with name"
echo "-test-runner Test runner to use (playwright or protractor)"
}
project_target(){
PROJECT_TARGET=$1
}
target_options(){
OPTIONS="$1"
}
test_runner(){
TEST_RUNNER=$1
}
while [[ $1 == -* ]]; do
case "$1" in
-target) project_target $2; shift 2;;
-options) target_options $2; shift 2;;
-test-runner) test_runner $2; shift 2;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
esac
done
./node_modules/.bin/tsc -p "./e2e/$E2E_TSCONFIG" || exit 1;
./node_modules/.bin/http-server -c-1 $CONTENT_CE_DIST_PATH -p 4200 > /dev/null &\
if [ "$TEST_RUNNER" == "playwright" ]; then
echo "Running playwright tests with options $OPTIONS"
npx playwright test --config $OPTIONS
else
echo "Running protractor tests with options $OPTIONS"
echo "./node_modules/.bin/protractor \"./protractor.conf.js\" $OPTIONS || exit 1"
./node_modules/.bin/protractor "./protractor.conf.js" $OPTIONS $E2E_PROTRACTOR_OPTS || exit 1
fi
-5
View File
@@ -1,5 +0,0 @@
#!/usr/bin/env bash
BRANCH=`echo $COMMIT_MESSAGE | grep -o "\[link-adf\:[^]]*\]" | sed -e 's#\[link-adf:##g' | sed -e 's#\]##g'`
echo -e "\e[31mPRs are not mergeable with conditional build. This build was run with custom ADF branch: $BRANCH \e[0m"
exit 1
-83
View File
@@ -1,83 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR=${DIR}/../../..
DIST_DIR=${ROOT_DIR}/dist/@alfresco
PROJECTS_DIR=${ROOT_DIR}/projects
DRY_RUN=""
if [ "$PUBLISH_PROJECTS" = "false" ]; then
DRY_RUN=true
echo "PUBLISH_PROJECTS is set to false, run in dry mode"
fi
VERSION_IN_PACKAGE_JSON=`node -p "require('$ROOT_DIR/package.json')".version;`;
if [[ $TRAVIS_BRANCH =~ ^master.*?$ ]] ; then
NEW_LIBRARY_VERSION=VERSION_IN_PACKAGE_JSON
else
NEW_LIBRARY_VERSION="${VERSION_IN_PACKAGE_JSON}-${TRAVIS_BUILD_NUMBER}"
fi
if [[ $TRAVIS_BRANCH =~ ^master(-patch.*)?$ ]]
then
# Pre-release versions
if [[ $VERSION_IN_PACKAGE_JSON =~ ^[0-9]*\.[0-9]*\.[0-9]*-A\.[0-9]*$ ]];
then
TAG_NPM=next
# Stable major versions
else
TAG_NPM=latest
fi
fi
if [[ $TRAVIS_BRANCH =~ ^develop(-patch.*)?$ ]]
then
TAG_NPM=alpha
fi
echo -e "Branch is '$TRAVIS_BRANCH', therefore publish with '$TAG_NPM' tag\n"
PROJECTS=(
'aca-shared'
'aca-folder-rules'
'adf-office-services-ext'
'aca-about'
'aca-preview'
'aca-viewer'
'aca-content'
);
for PROJECT in "${PROJECTS[@]}"
do
echo "Update ${PROJECT} version to ${NEW_LIBRARY_VERSION}"
cd $PROJECTS_DIR/${PROJECT}
npm version ${NEW_LIBRARY_VERSION};
done
echo -e "\n\nBuild projects"
cd ${ROOT_DIR}
npm run build-libs
for PROJECT in "${PROJECTS[@]}"
do
cd $DIST_DIR/${PROJECT}
if [ "$DRY_RUN" = "true" ] ; then
echo -e "Publish with dry mode for project: $PROJECT\n"
echo -e "npm publish --dry-run --tag $TAG_NPM \n"
npm publish --dry-run --tag $TAG_NPM
else
echo -e "======== Publishing project: $PROJECT ========\n"
echo -e "npm publish --tag $TAG_NPM\n"
echo 'strict-ssl=true' >> .npmrc
echo 'registry=https://${NPM_REGISTRY_ADDRESS}' >> .npmrc
echo '//${NPM_REGISTRY_ADDRESS}/:_authToken="${NPM_REGISTRY_TOKEN}"' >> .npmrc
npm publish --tag $TAG_NPM
fi
done
-22
View File
@@ -1,22 +0,0 @@
# Note no #!/bin/sh as this should not spawn
# an extra shell, since this partial shell script
# is supposed to be invoked as part of another.
# ---------------------------------------------------------------
# ADF linking
# ---------------------------------------------------------------
if [[ $COMMIT_MESSAGE == *"[link-adf:"* ]]; then
export BUILD_OPTS="--configuration=adfprod,e2e"
export TEST_OPTS="--configuration=adfprod"
export E2E_PROTRACTOR_OPTS="--with-local-adf"
export E2E_TSCONFIG="tsconfig.e2e.adf.json"
BRANCH=`echo $COMMIT_MESSAGE | grep -o "\[link-adf\:[^]]*\]" | sed -e 's#\[link-adf:##g' | sed -e 's#\]##g'`
echo "Checking out ADF's branch: ${BRANCH}" && \
git clone https://github.com/Alfresco/alfresco-ng2-components.git --depth=1 --branch ${BRANCH} ../alfresco-ng2-components
# ADF theming needs it the styling
CWD=`pwd`
cd ../alfresco-ng2-components
npm install @angular/material
cd $CWD
else
echo -e "\e[32mUsing ADF from installed node_modules.\e[0m"
fi ;
-31
View File
@@ -1,31 +0,0 @@
#!/usr/bin/env bash
show_help() {
echo "Usage: artifact-from-s3.sh <options>"
echo ""
echo "-a or --artifact [mandatory]: path to the s3 artifact (tar.bz2) to download and extract"
echo "-o or --output [mandatory]: directory to extract the archive to"
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-a|--artifact) ARTIFACT=$2; shift 2;;
-o|--output) OUTPUT=$2; shift 2;;
-*) shift;;
esac
done
if [ "${ARTIFACT}" == "" ] || [ "${OUTPUT}" == "" ]
then
show_help;
exit 1
fi
test ! -d $OUTPUT && mkdir -p $OUTPUT
aws s3 cp $ARTIFACT ./s3-artifact.tmp
echo 'artifact download done'
tar -xvf ./s3-artifact.tmp -C $OUTPUT >&/dev/null
echo 'tar the artifact done'
rm ./s3-artifact.tmp
echo 'remove tmp file'
-27
View File
@@ -1,27 +0,0 @@
#!/usr/bin/env bash
show_help() {
echo "Usage: artifact-to-s3.sh <options>"
echo ""
echo "-a or --artifact [mandatory]: path to the artifact to archieve (tar.bz2) and upload (like ./dist)"
echo "-o or --output [mandatory]: the S3 object to copy it to, like: s3://bucket-name/folder/whatever.tar.bz2"
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-a|--artifact) ARTIFACT=$2; shift 2;;
-o|--output) OUTPUT=$2; shift 2;;
-*) shift;;
esac
done
if [ "${ARTIFACT}" == "" ] || [ "${OUTPUT}" == "" ]
then
show_help;
exit 1
fi
tar cvfj ./s3-artifact.tmp -C $ARTIFACT `ls $ARTIFACT`
aws s3 cp ./s3-artifact.tmp $OUTPUT
rm ./s3-artifact.tmp