image: python:2.7-jessie
stages:
- build
- build_tag
before_script:
- mv project ${CI_PROJECT_NAME/./_}
build-after-commit:
stage: build
script:
- mv build/${CI_PROJECT_NAME/./_}.zip build/${CI_PROJECT_NAME/./_}_${CI_COMMIT_TAG:-0.0.0}.zip
except:
- tags
artifacts:
expire_in: 1 day
when: on_success
name: ${CI_PROJECT_NAME/./_}
paths:
- build/*.zip
我有这个gitlab ci文件,该文件现在对我有用。但是,如您所见,我一直使用${CI_PROJECT_NAME/./_}
,因为我的项目名称是my.project
,我需要将其更改为my_project
。有更好的方法吗?还是我可以做这样的事情?
image: python:2.7-jessie
NEW_NAME: ${CI_PROJECT_NAME/./_}
stages:
- build
- build_tag
before_script:
- mv project ${NEW_NAME}
build-after-commit:
stage: build
script:
- mv build/${NEW_NAME}.zip build/${NEW_NAME}_${CI_COMMIT_TAG:-0.0.0}.zip
except:
- tags
artifacts:
expire_in: 1 day
when: on_success
name: ${NEW_NAME}
paths:
- build/*.zip