HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //proc/1526/cwd/tana/frontend/node_modules/concurrently/node_modules/rx/travis.sh
repo="https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG.git"

# If this is a pull request, we dont want to continue
if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then
  echo "Nothing to do on a pull request"
  exit 0
fi

# All Pull requests are to the branch called incoming-pr
# If this is not that branch, the rest of the script is irrelevant
if [ "$TRAVIS_BRANCH" != "incoming-pr" ] ; then
  echo "Nothing to do on the master branch"
  exit 0
fi

git fetch
git branch --all
# This part of the script is run before installing deps or tests
if [ "$1" = "before" ] ; then
	# So this is incoming-pr branch. Need to check if this is exactly same as the master
	# If it is, this branch does not have anything new, so no need to try and build it
	incoming_commit=$(git rev-parse HEAD)
	git checkout --orphan master
	git pull origin master --depth=1
	master_commit=$(git rev-parse HEAD)
	if [ "$incoming_commit" = "$master_commit" ] ; then
		echo "Not required to build this as this is same as the master branch"
		exit 1
	else
		git checkout incoming-pr
		echo "Current branch is - $(git rev-parse HEAD)"
		exit 0
	fi
fi

git checkout incoming-pr
if [ "$1" = "merge" ] ; then
	# If the build was successful, travis after-success will send merge
	echo "Merging incoming-pr to master"
	git checkout master
	git merge incoming-pr --log
	git push $repo master -q 2> /dev/null
else
	# If build failed, travis after-failure will send ./travis.sh revert
	echo "Reverting dev branch to what master was"
	# Save the current changes to a new branch
	echo "Creating a new branch for failed build - incoming-pr-fail-$TRAVIS_BUILD_ID"
	git checkout -b incoming-pr-fail-$TRAVIS_BUILD_ID
	git push $repo incoming-pr-fail-$TRAVIS_BUILD_ID -q 2> /dev/null
	git checkout master
fi

echo "Making incoming-pr same as master"
# Merge or revert is done, so make incoming-pr branch at par with master
# This is done to make it ready for accepting the next pull request
git push $repo --delete incoming-pr -q 2> /dev/null
git branch -D incoming-pr
git branch incoming-pr
git push $repo incoming-pr -q 2> /dev/null