diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d0afee4b2910aceeb5e10206516629ecb0341bd2..ea7d9581f8905b1d26b2a084c6dcbec854cd0dac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,25 +78,32 @@ docker:ci: when: on_failure allow_failure: true script: - # Prepare the Dockerfile + # Create the target directory + - mkdir -p dist/ci + - cd dist/ci + # Create the Dockerfile - echo 'FROM node:12' > Dockerfile - echo 'WORKDIR /tmp/.build-cache' >> Dockerfile - echo 'COPY ./ ./' >> Dockerfile # Store disk usage (before install) - - echo 'RUN du -s `find /tmp/.cache/yarn -maxdepth 1 | egrep -v "^\.$"` > before.txt' >> Dockerfile - - echo 'RUN du -s `find node_modules -maxdepth 1 | egrep -v "^\.$"` >> before.txt' >> Dockerfile + - echo 'RUN du -s `find . -maxdepth 1 | egrep -v "^\.$"` > /tmp/before.txt' >> Dockerfile + - echo 'RUN du -s `find /tmp/.cache/yarn -maxdepth 1 | egrep -v "^\.$"` >> /tmp/before.txt' >> Dockerfile # Install dependencies - - echo 'RUN npm install -g yarn @ionic/cli' >> Dockerfile - - echo 'RUN yarn install' >> Dockerfile + #- echo 'RUN yarn global add gulp web-ext @ionic/cli' >> Dockerfile + - echo 'RUN yarn' >> Dockerfile # Store disk usage (after install) - - echo 'RUN du -s `find /tmp/.cache/yarn -maxdepth 1 | egrep -v "^\.$"` > after.txt' >> Dockerfile - - echo 'RUN du -s `find node_modules -maxdepth 1 | egrep -v "^\.$"` >> after.txt' >> Dockerfile + - echo 'RUN du -s `find . -maxdepth 1 | egrep -v "^\.$"` > /tmp/after.txt' >> Dockerfile + - echo 'RUN du -s `find /tmp/.cache/yarn -maxdepth 1 | egrep -v "^\.$"` >> /tmp/after.txt' >> Dockerfile # Force docker to detect any changes - - echo "RUN diff before.txt after.txt || true" >> Dockerfile + - echo "RUN diff /tmp/before.txt /tmp/after.txt || true" >> Dockerfile - echo 'WORKDIR /build' >> Dockerfile - # Build image + # Build and push the CI image - docker build --no-cache -t ${CI_BUILD_IMAGE} . - docker push ${CI_BUILD_IMAGE} + artifacts: + paths: + - dist/ci/Dockerfile + expire_in: 60 minutes # --------------------------------------------------------------- # Deploy jobs