Created
March 28, 2017 10:16
-
-
Save jkuchar/b333099640abc2ac66bc9d654c3dd7c8 to your computer and use it in GitHub Desktop.
How to cache npm, yarn, bower and composer into /cache folder in GitLab CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NPM: cache | |
RUN npm config set cache /cache/.npm | |
# bower: cache | |
ENV bower_storage__packages /cache/.bower/packages | |
ENV bower_storage__registry /cache/.bower/registry | |
ENV bower_storage__links /cache/.bower/links | |
# YARN cache | |
RUN yarn config set cache-folder /cache/yarn | |
RUN yarn cache dir | |
# Composer: make global packages available for execution | |
ENV PATH ~/.composer/vendor/bin:${PATH} | |
# Configure Composer | |
ENV COMPOSER_CACHE_DIR /cache/composer | |
ENV COMPOSER_NO_INTERACTION 1 | |
I'm using self-hosted gitlab, and having trouble getting yarn to work with the /cache/yarn
directory. Did you do anything special in gitlab ci to make this work?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can do the same for the most of packaging plaforms by overriding
environment
option in you runner config.