2017-03-13 1 views
0

몇 주 전에 gitlab ci를 사용해 본 경험이 있습니다. 필자는 필자의 최종 섹션에서 Gulp의 출력물을 artifacts zip에 포함되도록했습니다.Gulp로 빌드 한 후 Gitlab CI 산출물에서 특정 폴더를 만듭니다.

그래서 현재 내 빌드 .yml 파일은 다음과 같습니다 : 당신은 짐승의 그 조금을 볼 수 있지만 작동으로

cache: 
    paths: 
    - vendor/ 
    - node_modules/ 
before_script: 
# Install git (the php image doesn't have it) which is required by composer 
- apt-get update -yqq 
- apt-get install git unzip -yqq 
- apt-get install php-pear -yqq 
# Install composer 
- curl -sS https://getcomposer.org/installer | php 
- php composer.phar install 
# Setup PHPCompatibility for php_codesniffer 
- mkdir --parents vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility 
- cp -R vendor/wimg/php-compatibility/* vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility 
stages: 
- compatibility_test 
- coding_standards 
- gulp_build 
- gulp_package 
# Compatibility Test 
PHP 5.2 Compatibility Test: 
    image: php:5.6 
    stage: compatibility_test 
    script: 
    - vendor/bin/phpcs -d date.timezone=GMT --standard=PHPCompatibility --runtime-set testVersion 5.2 src/ --report-full --report-summary --extensions=php 
PHP 5.3 Compatibility Test: 
    image: php:5.6 
    stage: compatibility_test 
    script: 
    - vendor/bin/phpcs -d date.timezone=GMT --standard=PHPCompatibility --runtime-set testVersion 5.3 src/ --report-full --report-summary --extensions=php 
PHP 5.4 Compatibility Test: 
    image: php:5.6 
    stage: compatibility_test 
    script: 
    - vendor/bin/phpcs -d date.timezone=GMT --standard=PHPCompatibility --runtime-set testVersion 5.4 src/ --report-full --report-summary --extensions=php 
PHP 5.5 Compatibility Test: 
    image: php:5.6 
    stage: compatibility_test 
    script: 
    - vendor/bin/phpcs -d date.timezone=GMT --standard=PHPCompatibility --runtime-set testVersion 5.5 src/ --report-full --report-summary --extensions=php 
PHP 5.6 Compatibility Test: 
    image: php:5.6 
    stage: compatibility_test 
    script: 
    - vendor/bin/phpcs -d date.timezone=GMT --standard=PHPCompatibility --runtime-set testVersion 5.6 src/ --report-full --report-summary --extensions=php 
PHP 7.0 Compatibility Test: 
    image: php:5.6 
    stage: compatibility_test 
    script: 
    - vendor/bin/phpcs -d date.timezone=GMT --standard=PHPCompatibility --runtime-set testVersion 7.0 src/ --report-full --report-summary --extensions=php 
PHP 7.1 Compatibility Test: 
    image: php:5.6 
    stage: compatibility_test 
    script: 
    - vendor/bin/phpcs -d date.timezone=GMT --standard=PHPCompatibility --runtime-set testVersion 7.1 src/ --report-full --report-summary --extensions=php 
# # Coding Standards Test 
PHP Coding Standards: 
    image: php:5.6 
    stage: Coding Standards 
    script: 
    - vendor/bin/phpcs -s --standard=ruleset.xml src/ --report-full --report-summary --extensions=php 
JS Coding Standards: 
    image: php:5.6 
    stage: Coding Standards 
    script: 
    - vendor/bin/phpcs -s --standard=ruleset.xml src/js/ --report-full --report-summary --extensions=js 
CSS Coding Standards: 
    image: php:5.6 
    stage: Coding Standards 
    script: 
    - vendor/bin/phpcs -s --standard=ruleset.xml src/css/ --report-full --report-summary --extensions=css 
# Gulp Build 
Gulp: 
    image: node:latest 
    stage: gulp_build 
    script: 
    - npm install -g gulp 
    - npm install 
    - gulp build 
    - gulp zip 
    artifacts: 
    name: "my-build" 
    expire_in: 1 week 
    paths: 
    - "dist/*"  

. 내가 가진 마지막 부분은 꿀꺽 : 유물 파일 이름을 생산 현재

# Gulp Build 
    Gulp: 
     image: node:latest 
     stage: gulp_build 
     script: 
     - npm install -g gulp 
     - npm install 
     - gulp build 
     - gulp zip 
     artifacts: 
     name: "my-build" 
     expire_in: 1 week 
     paths: 
     - "dist/*" 

완벽하다 my-build.zip로 표시합니다. 그러나 그 안에있는 폴더는 dist입니다. dist 폴더를 my-build로 변경하는 방법이 있습니까?

건배,

스투

답변

0

Gitlab Reddit의 도움 후 나는 내 문제를 해결하기 위해 관리.

Gulp: 
    only: 
    - master 
    - merge-requests 
    image: node:latest 
    stage: gulp_build 
    script: 
    - npm install -g gulp 
    - npm install 
    - gulp build 
    - mv -T dist my-build 
    - gulp build --premium 
    - mv -T dist my-build-premium 
    artifacts: 
     name: "my-build" 
     expire_in: 1 week 
     paths: 
     - my-build/ 
     - my-build-premium/ 

가 인스턴스이기 때문에 나는 그것이라고하고 유물에 추가 할 원하는 것을, 나는 폴더를 이름 : 이것은 내가 한 것입니다. 이제 마스터와 병합 요청에서 Gulp 만 사용하여 프리미엄 빌드를 만들 수 있습니다.

관련 문제