-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
45 lines (40 loc) · 1.3 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
image: wg-runner/php7
before_script:
- cd application
- export PROJECT_NAME=$(bin/composer project-name)
- export NEXT_VERSION_SHORT=$(bin/composer version git v)
- export NEXT_VERSION=$(bin/composer version git)-$(git rev-parse --short HEAD)
- export REVISION_TAG=v${NEXT_VERSION_SHORT}
stages:
- package
- release
package:
stage: package
except:
- tags
script:
- bin/composer install -o --no-dev --ignore-platform-reqs --no-scripts --no-suggest
- bin/composer run build-bootstrap
- bin/composer init-example
- bin/composer "build" "tar.gz" "${PROJECT_NAME}" "${NEXT_VERSION}"
- bin/composer "build" "zip" "${PROJECT_NAME}" "${NEXT_VERSION}"
artifacts:
name: "$(git describe --tags HEAD)"
paths:
- "${CI_PROJECT_DIR}/dist/*.tar.gz"
- "${CI_PROJECT_DIR}/dist/*.zip"
expire_in: 1 week
release:
stage: release
except:
# If you want to auto-tag your project repository, comment / remove the next line
# This is no longer desirable default behaviour for the main Mapbender project
- /./
- tags
- /^feature\/.*$/
- /^(fix|hotfix)\/.*$/
script:
- git tag ${REVISION_TAG}
- git remote set-url --push origin "$(echo $CI_REPOSITORY_URL | perl -pe 's#.*@(.+?(\:\d+)?)/#git@\1:#')"
- git remote -v
- git push origin --tags