.gitlab-ci.yml 718 Bytes
Newer Older
Pietro Saccardi's avatar
Pietro Saccardi committed
1 2 3 4 5
stages:
  - build

build:less:
  stage: build
6
  image: node:8.0.0-alpine
Pietro Saccardi's avatar
Pietro Saccardi committed
7 8 9 10
  variables:
    PLUGIN_NAME: MittelTheme
    LESS_SRC: Template/css/app.less
    LESS_OUTPUT: Template/css/main.css
11 12 13
  before_script:
    - yarn global add less
    - yarn global add less-plugin-clean-css
Pietro Saccardi's avatar
Pietro Saccardi committed
14
    - apk add --update --no-cache git zip unzip
Pietro Saccardi's avatar
Pietro Saccardi committed
15 16
  script:
    - /usr/local/bin/lessc "${LESS_SRC}" > "${LESS_OUTPUT}"
Pietro Saccardi's avatar
Pietro Saccardi committed
17
  after_script:
Pietro Saccardi's avatar
Pietro Saccardi committed
18
    - git archive HEAD --prefix="${PLUGIN_NAME}/" --format=zip -o "${PLUGIN_NAME}.zip"
Pietro Saccardi's avatar
Pietro Saccardi committed
19 20
    - unzip "${PLUGIN_NAME}.zip"
    - rm "${PLUGIN_NAME}/${LESS_SRC}"
21
    - rm "${PLUGIN_NAME}/.gitlab-ci.yml"
Pietro Saccardi's avatar
Pietro Saccardi committed
22
    - cp "${LESS_OUTPUT}" "${PLUGIN_NAME}/${LESS_OUTPUT}"
Pietro Saccardi's avatar
Pietro Saccardi committed
23 24
  artifacts:
    paths:
Pietro Saccardi's avatar
Pietro Saccardi committed
25
      - "${PLUGIN_NAME}"