mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
Fix the scss import and save the build on S3 (#1382)
* Fix the scss import and save the build on S3 * Run unit test without builing again * Move success after build * Build with config e2e
This commit is contained in:
27
scripts/ci/job_hooks/before_install.sh
Executable file
27
scripts/ci/job_hooks/before_install.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
pip install --user awscli
|
||||
|
||||
export NODE_OPTIONS="--max_old_space_size=30000"
|
||||
export GIT_HASH=`git rev-parse HEAD`
|
||||
S3_DBP_PATH="s3://alfresco-travis-builds/dbp"
|
||||
export BASE_HASH="$(git describe --tags `git rev-list --tags --max-count=1`)"
|
||||
export HEAD_HASH="HEAD"
|
||||
|
||||
if [ "${TRAVIS_EVENT_TYPE}" == "push" ]; then
|
||||
export S3_DBP_FOLDER="$S3_DBP_PATH/$TRAVIS_BRANCH/$TRAVIS_BUILD_ID"
|
||||
elif [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
|
||||
export S3_DBP_FOLDER="$S3_DBP_PATH/$TRAVIS_PULL_REQUEST/$TRAVIS_BUILD_ID"
|
||||
export BASE_HASH="origin/$TRAVIS_BRANCH"
|
||||
elif [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
|
||||
export S3_DBP_FOLDER="$S3_DBP_PATH/cron/$TRAVIS_BUILD_ID"
|
||||
else
|
||||
export S3_DBP_FOLDER="$S3_DBP_PATH/api/$TRAVIS_BUILD_ID"
|
||||
fi
|
||||
|
||||
echo "BASE_HASH: $BASE_HASH"
|
||||
echo "S3 DBP destination: $S3_DBP_FOLDER"
|
||||
|
||||
export DISPLAY=:99.0
|
||||
sh -e /etc/init.d/xvfb start
|
||||
sleep 3 # give xvfb some time to start
|
28
scripts/ci/utils/artifact-from-s3.sh
Executable file
28
scripts/ci/utils/artifact-from-s3.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/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
|
||||
tar -xvf ./s3-artifact.tmp -C $OUTPUT
|
||||
rm ./s3-artifact.tmp
|
27
scripts/ci/utils/artifact-to-s3.sh
Executable file
27
scripts/ci/utils/artifact-to-s3.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/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
|
Reference in New Issue
Block a user