mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
AAE-11918A - remove travis env var (#8312)
* AAE-11918 - travis_branch env removal * AAE-11918 - travis_branch env removal * event_type and travis_pull_request_branch env removal * e travis_build_dir, travis_build_number, travis_commit env removal * rename scripts path * remove .travis file * remove .travis file * remove .travis file * just a commit * trying to fix e2e test * fix e2e issue * remove action load travis env * with action travis env var load * remove action travis load env vars * remove action travis load env vars * remove action travis load env vars * last check * test release flow in dry-run * final check for review * fix env variables * fix env variables * fix env variables * remove devel flag * revert renaming action facade * git mv commit * git mv commit
This commit is contained in:
@@ -14,21 +14,22 @@ export GIT_HASH=$(git rev-parse HEAD)
|
||||
|
||||
|
||||
# Settings for Nx ---------------------------------------------------------------------
|
||||
export BASE_HASH="$(git merge-base origin/"$TRAVIS_BRANCH" HEAD)"
|
||||
export BASE_HASH="$(git merge-base origin/"$GITHUB_BASE_REF" HEAD)"
|
||||
export HEAD_HASH="HEAD"
|
||||
export HEAD_COMMIT_HASH=${TRAVIS_PULL_REQUEST_SHA:-${TRAVIS_COMMIT}}
|
||||
export HEAD_COMMIT_HASH=${GH_COMMIT}
|
||||
export COMMIT_MESSAGE=$(git log --format=%B -n 1 "$HEAD_COMMIT_HASH")
|
||||
|
||||
#########################################################################################
|
||||
# Settings based of Travis event type
|
||||
# Settings based of Github event type
|
||||
#########################################################################################
|
||||
if [ "${TRAVIS_EVENT_TYPE}" == "push" ]; then
|
||||
if [ "${GITHUB_EVENT_NAME}" == "push" ]; then
|
||||
# Settings for merges ---------------------------------------------------------------
|
||||
if [[ "$TRAVIS_BRANCH" =~ ^master(-patch.*)?$ ]]; then
|
||||
BRANCH=${GITHUB_REF##*/}
|
||||
if [[ "$BRANCH" =~ ^master(-patch.*)?$ ]]; then
|
||||
# into master(-patch*)
|
||||
export NX_CALCULATION_FLAGS="--all"
|
||||
export BUILD_OPTS="--configuration production"
|
||||
elif [[ "$TRAVIS_BRANCH" =~ ^develop-patch.*$ ]]; then
|
||||
elif [[ "$BRANCH" =~ ^develop-patch.*$ ]]; then
|
||||
# into develop-patch*
|
||||
echo -e "\e[32mSetting up CI jobs for patch version creation.\e[0m"
|
||||
export NX_CALCULATION_FLAGS="--all"
|
||||
@@ -38,11 +39,11 @@ if [ "${TRAVIS_EVENT_TYPE}" == "push" ]; then
|
||||
export NX_CALCULATION_FLAGS="--base=$(git describe --tags $(git rev-list --tags --max-count=1)) --head=$HEAD_HASH"
|
||||
export BUILD_OPTS="--configuration production"
|
||||
fi
|
||||
elif [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
|
||||
elif [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
|
||||
# Settings for PRs ------------------------------------------------------------------
|
||||
export NX_CALCULATION_FLAGS="--base=origin/$TRAVIS_BRANCH --head=$HEAD_HASH"
|
||||
export NX_CALCULATION_FLAGS="--base=origin/$GITHUB_BASE_REF --head=$HEAD_HASH"
|
||||
export BUILD_OPTS="--configuration production"
|
||||
elif [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
|
||||
elif [ "${GITHUB_EVENT_NAME}" == "schedule" ]; then
|
||||
# Settings for Cron -----------------------------------------------------------------
|
||||
export NX_CALCULATION_FLAGS="--all"
|
||||
export BUILD_OPTS="--configuration production"
|
||||
@@ -50,20 +51,18 @@ else
|
||||
# Settings for API ------------------------------------------------------------------
|
||||
export NX_CALCULATION_FLAGS="--all"
|
||||
export BUILD_OPTS="--configuration production"
|
||||
# In case of manual Travis run use the commit message from travis and not the one from git
|
||||
COMMIT_MESSAGE=$TRAVIS_COMMIT_MESSAGE
|
||||
fi
|
||||
|
||||
# Settings for S3 caching -------------------------------------------------------------
|
||||
pip install --user awscli
|
||||
|
||||
if [ "${TRAVIS_EVENT_TYPE}" == "push" ]; then
|
||||
if [ "${GITHUB_EVENT_NAME}" == "push" ]; then
|
||||
echo "push"
|
||||
elif [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
|
||||
elif [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
|
||||
echo "pull_request"
|
||||
export BASE_HASH="origin/$TRAVIS_BRANCH"
|
||||
export BASE_HASH="origin/$GITHUB_BASE_REF"
|
||||
source "$PARENT_DIR/partials/_ci-flags-parser.sh"
|
||||
elif [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
|
||||
elif [ "${GITHUB_EVENT_NAME}" == "schedule" ]; then
|
||||
echo "cron"
|
||||
else
|
||||
echo "api"
|
||||
|
@@ -7,7 +7,7 @@ npm ci
|
||||
# The adf-cli is not installed through NPM for this reason it needs to be built
|
||||
# in addition the dist folder needs to be moved as part of the node modules
|
||||
# in this way every check like check-cs check-ps can use the adf cli
|
||||
# the bundle is saved under node_modules also to use the same cache of travis
|
||||
# the bundle is saved under node_modules also to use the same cache of github
|
||||
nx run cli:bundle
|
||||
# The adf-testing is not installed through NPM for this reason it needs to be built
|
||||
# in addition the dist folder needs to be moved as part of the node modules
|
||||
|
@@ -4,7 +4,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
verifyLib=$1;
|
||||
cd $DIR/../../
|
||||
|
||||
if [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
|
||||
if [ "${GITHUB_EVENT_NAME}" == "schedule" ]; then
|
||||
#echo "Affected not check in case of cron"
|
||||
echo true
|
||||
exit 0
|
@@ -3,8 +3,8 @@
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/../../../
|
||||
|
||||
if [[ $TRAVIS_BRANCH =~ ^develop(-patch.*)?$ ]]
|
||||
BRANCH=${GITHUB_REF##*/}
|
||||
if [[ $BRANCH =~ ^develop(-patch.*)?$ ]]
|
||||
then
|
||||
echo "Replace NPM version with new Alpha tag"
|
||||
NEXT_VERSION=-nextalpha
|
@@ -7,6 +7,7 @@ cd $DIR/../../../
|
||||
|
||||
BASE_DIRECTORY=$(echo "$FOLDER" | cut -d "/" -f1)
|
||||
verifyLib=$1;
|
||||
REGEX="(repository|workflow)_dispatch"
|
||||
|
||||
# set test-e2e params
|
||||
if [ -n "$2" ]; then
|
||||
@@ -17,31 +18,31 @@ fi
|
||||
|
||||
echo "Step1 - Verify if affected libs contains $verifyLib"
|
||||
|
||||
AFFECTED_LIB=$(./scripts/travis/affected-contains.sh $verifyLib )
|
||||
AFFECTED_LIB=$(./scripts/github/affected-contains.sh $verifyLib )
|
||||
|
||||
if [ ${AFFECTED_LIB} == true ]; then
|
||||
echo "Step2 - $verifyLib affected... will execute e2e"
|
||||
|
||||
if [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
|
||||
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
|
||||
echo "Calculate affected e2e $BASE_HASH $HEAD_HASH"
|
||||
echo "nx affected:libs --base=$BASE_HASH --head=$HEAD_HASH --plain"
|
||||
AFFECTED_LIBS="$(nx affected:libs --base=$BASE_HASH --head=$HEAD_HASH --plain || exit 1)"
|
||||
echo "Affected libs ${AFFECTED_LIBS}"
|
||||
AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$FOLDER")";
|
||||
AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $GITHUB_BASE_REF -f "e2e/$FOLDER")";
|
||||
echo "Affected e2e ${AFFECTED_E2E}"
|
||||
fi;
|
||||
|
||||
if [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
|
||||
if [ "${GITHUB_EVENT_NAME}" == "schedule" ]; then
|
||||
echo "CRON running everything "
|
||||
fi;
|
||||
|
||||
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$BASE_DIRECTORY" || "${TRAVIS_EVENT_TYPE}" == "push" || "${TRAVIS_EVENT_TYPE}" == "api" || "${TRAVIS_EVENT_TYPE}" == "cron" ]]; then
|
||||
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$BASE_DIRECTORY" || "${GITHUB_EVENT_NAME}" == "push" || "${GITHUB_EVENT_NAME}" == "$REGEX" || "${GITHUB_EVENT_NAME}" == "schedule" ]]; then
|
||||
echo "Run all e2e $FOLDER"
|
||||
./scripts/test-e2e-lib.sh --use-dist $e2eParams
|
||||
else if [[ $AFFECTED_E2E == "e2e/$FOLDER" ]]; then
|
||||
echo "Run affected e2e"
|
||||
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$TRAVIS_BRANCH HEAD)"
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$GITHUB_HEAD_REF HEAD)"
|
||||
LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$FOLDER" | paste -sd , -)"
|
||||
|
||||
echo "Run $FOLDER e2e based on the sha $HEAD_SHA_BRANCH with the specs: "$LIST_SPECS
|
@@ -2,15 +2,15 @@
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd $DIR/../../../
|
||||
|
||||
if [[ $TRAVIS_BRANCH =~ ^master(-patch.*)?$ ]]; then
|
||||
BRANCH=${GITHUB_REF##*/}
|
||||
if [[ $BRANCH =~ ^master(-patch.*)?$ ]]; then
|
||||
export TAGS=$(grep -m1 version package.json | awk '{ print $2 }' | sed 's/[", ]//g')
|
||||
else
|
||||
if [[ "${TRAVIS_PULL_REQUEST_BRANCH}" != "" ]];
|
||||
if [[ "${GITHUB_BASE_REF}" != "" ]];
|
||||
then
|
||||
export TAGS="$TRAVIS_PULL_REQUEST_BRANCH-$TRAVIS_BUILD_NUMBER"
|
||||
export TAGS="${GITHUB_BASE_REF}-$GH_BUILD_NUMBER"
|
||||
else
|
||||
export TAGS="$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER,$TRAVIS_BRANCH"
|
||||
export TAGS="$GITHUB_BASE_REF-$GH_BUILD_NUMBER,$GITHUB_BASE_REF"
|
||||
fi;
|
||||
fi;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $TRAVIS_BRANCH == "master" ]]; then
|
||||
if [[ $BRANCH == "master" ]]; then
|
||||
VERSION=$(grep -m1 version package.json | awk '{ print $2 }' | sed 's/[", ]//g')
|
||||
else
|
||||
VERSION=$(npm view @alfresco/adf-core@beta version)
|
@@ -5,8 +5,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd $DIR/../../../
|
||||
|
||||
VERSION_IN_PACKAGE_JSON=`node -p "require('./package.json')".version;`;
|
||||
|
||||
if [[ $TRAVIS_BRANCH =~ ^master(-patch.*)?$ ]]
|
||||
BRANCH=${GITHUB_REF##*/}
|
||||
if [[ $BRANCH =~ ^master(-patch.*)?$ ]]
|
||||
then
|
||||
# Pre-release versions
|
||||
if [[ $VERSION_IN_PACKAGE_JSON =~ ^[0-9]*\.[0-9]*\.[0-9]*-A\.[0-9]*$ ]];
|
||||
@@ -18,7 +18,7 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $TRAVIS_BRANCH =~ ^develop(-patch.*)?$ ]]
|
||||
if [[ $BRANCH =~ ^develop(-patch.*)?$ ]]
|
||||
then
|
||||
TAG_NPM=alpha
|
||||
fi
|
Reference in New Issue
Block a user