Closed StefanAgus closed 7 years ago
@StefanAgus to cache your own image, you will need to build on your own dedicated node. On the free plan, nodes gets dynamically assigned which prevents caching.
Please look here for more information - http://docs.shippable.com/getting-started/byon-overview/#advantages-of-byon.
I've been using custom docker image to speed up the build time for around a week. But instead of making it faster, it become way slower because of the time it needs to pull the custom image. Is there any way to cache the custom docker image? here is our .shippable.yml ` build_environment: Ubuntu 14.04 language: node_js node_js:
mongodb # on port 27017 by default env: global:
encrypted ROBOT_PASSWORD
encrypted SLACK_URL
encrypted S3 access_key_id
encrypted S3 secret_access_key
encrypted PRODUCTION_MONGO_URI
ci:
Manual nvm Setup
Starting redis server
Starting mongo server
if there's string 'SKIPTEST' inside the commit message then skip integration test
git log --format=%s -n 1 $COMMIT | grep -q SKIPTEST ; echo $?
if there's string 'SKIPTEST' then SKIP_TEST will be 0 otherwise 1
git log --format=email -n 1 | grep -q 'Shippable Build' ; echo $?
if the committer is Shippable Build then SKIP_REVERT will be 0 otherwise 1
echo $SKIP_REVERT
if [[ "$SKIP_TEST" == 1 && "$SKIP_REVERT" == 1 ]]; then export SHOULD_REVERT_IF_FAIL=1; else export SHOULD_REVERT_IF_FAIL=0; fi
echo $SHOULD_REVERT_IF_FAIL
Already done in the docker image
Dependencies to install yarn
curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
Already done in the docker image
install dependencies for node package
canvas
for Image Quality Assessorreference: https://github.com/Automattic/node-canvas
sudo apt-get update
sudo apt-get install -y libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
Explicitly set NODE_ENV=development to force npm to install all dependencies
Run the scripts to do yarn install and package installation
Explicitly append NODE_ENV with current branch because .env.shippable does not set NODE_ENV
Explicitly append API_URL based on current branch
Explicitly append BASE_URL based on current branch
Explicitly append OLX_ADIRA_PRODUCT_ID, OLX_ADIRA_SHARIA_PRODUCT_ID, OLX_ADIRA_USED_CAR_LOAN_PRODUCT_ID based on current branch
Explicitly append OLX_CIMB_MORTGAGE_PRODUCT_ID based on current branch
Explicitly append Gatekeeper secret key and partner on current branch
Explicitly append OLX_DANAMON_MORTGAGE_PRODUCT_ID based on current branch
if [[ "$BRANCH" == "staging" ]]; then echo "OLX_DANAMON_MORTGAGE_PRODUCT_ID=5865d37b4abbed72768a411d" >> .env; fi
if [[ "$BRANCH" == "production" ]]; then echo "OLX_DANAMON_MORTGAGE_PRODUCT_ID=5865d54709b490843c8a923f" >> .env; fi
if [ "$BRANCH" != "master" ]; then ./node_modules/.bin/gulp build.production; fi
if [ "$BRANCH" = "master" ]; then ./node_modules/.bin/gulp build.development; fi
./node_modules/.bin/gulp --gulpfile partnershipPage/olx-adira/gulpfile.js
./node_modules/.bin/gulp --gulpfile partnershipPage/olx-cimb-mortgage/gulpfile.js
./node_modules/.bin/gulp --gulpfile partnershipPage/cimb/mortgage/gulpfile.js
./node_modules/.bin/gulp --gulpfile partnershipPage/olx/mortgage/danamon/gulpfile.js
./node_modules/.bin/gulp --gulpfile partnershipPage/olx/used-car-loan/adira/gulpfile.js
copy shippable env to test env
Use node version v5.7.1 because jsdom (in
test-react
script) needs node version > 4.xinstall Node Version Manager
on_success:
pwd
Create new release if not Master
install s3cmd tool for upload build artifact to s3
clean up
on_failure:
clean up
cache: true cache_dir_list: