175 lines
2.7 KiB
YAML
175 lines
2.7 KiB
YAML
# Execute always
|
|
before_script:
|
|
- echo $CI_PIPELINE_IID
|
|
- echo $GITLAB_USER_ID
|
|
- echo ${CI_COMMIT_REF_SLUG}
|
|
- id
|
|
|
|
variables:
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
|
|
|
stages:
|
|
- lint
|
|
- test
|
|
- build
|
|
- deploy
|
|
- notification
|
|
|
|
# Linting stage
|
|
.linting: &linting
|
|
tags:
|
|
- malinka
|
|
stage: lint
|
|
when: always
|
|
allow_failure: false
|
|
script:
|
|
- chmod +x ./toolchain/linting.sh
|
|
- ./toolchain/linting.sh
|
|
|
|
Lint:
|
|
<<: *linting
|
|
only:
|
|
- develop
|
|
- /^bugfix/
|
|
- /^feature/
|
|
- merge_requests
|
|
|
|
# Testing stage
|
|
.testing: &testing
|
|
tags:
|
|
- malinka
|
|
stage: test
|
|
when: always
|
|
allow_failure: false
|
|
script:
|
|
- chmod +x ./toolchain/testing.sh
|
|
- ./toolchain/testing.sh
|
|
|
|
Test:
|
|
<<: *testing
|
|
only:
|
|
- develop
|
|
- /^bugfix/
|
|
- /^feature/
|
|
- merge_requests
|
|
|
|
# Build IPA
|
|
.BuildIPA: &BuildIPA
|
|
tags:
|
|
- malinka
|
|
stage: build
|
|
when: on_success
|
|
allow_failure: false
|
|
script:
|
|
- rm -rf ./ResultIPA
|
|
- chmod +x ./toolchain/build_iOS.sh
|
|
- ./toolchain/build_iOS.sh ${APPLICATION_DEPLOY_TYPE} ${APPLICATION_NAME} ${APPLICATION_SCHEME_NAME}
|
|
|
|
# Build stage
|
|
|
|
build:
|
|
stage: build
|
|
<<: *BuildIPA
|
|
only:
|
|
- tags
|
|
- develop
|
|
artifacts:
|
|
paths:
|
|
- ./ResultIPA
|
|
expire_in: 2 days
|
|
|
|
buildLeaf:
|
|
stage: build
|
|
<<: *BuildIPA
|
|
when: manual
|
|
only:
|
|
- /^bugfix/
|
|
- /^feature/
|
|
artifacts:
|
|
paths:
|
|
- ./ResultIPA
|
|
expire_in: 3 days
|
|
|
|
# Deploy stage
|
|
|
|
.DeployIPA: &DeployIPA
|
|
tags:
|
|
- malinka
|
|
allow_failure: false
|
|
variables:
|
|
IPA_DEPLOY_TARGET: "TESTFLIGHT"
|
|
IPA_PATH: ./ResultIPA
|
|
script:
|
|
- chmod +x ./toolchain/deploy_iOS.sh
|
|
- ./toolchain/deploy_iOS.sh ${IPA_DEPLOY_TARGET} ${IPA_PATH} ${APPLICATION_SCHEME_NAME}
|
|
needs:
|
|
- job: build
|
|
artifacts: true
|
|
|
|
deploy:
|
|
stage: deploy
|
|
<<: *DeployIPA
|
|
when: on_success
|
|
only:
|
|
- tags
|
|
- develop
|
|
needs:
|
|
- job: build
|
|
artifacts: true
|
|
|
|
deployLeaf:
|
|
stage: deploy
|
|
<<: *DeployIPA
|
|
when: manual
|
|
only:
|
|
- /^bugfix/
|
|
- /^feature/
|
|
needs:
|
|
- job: buildLeaf
|
|
artifacts: true
|
|
|
|
# Slack notification
|
|
.slacknotification: &slacknotification
|
|
tags:
|
|
- malinka
|
|
stage: notification
|
|
allow_failure: false
|
|
script:
|
|
- chmod +x ./toolchain/slack_notification.sh
|
|
- ./toolchain/slack_notification.sh ${BUILD_RESULT}
|
|
|
|
# Develop
|
|
FailureNotification:
|
|
variables:
|
|
BUILD_RESULT: "FAILURE"
|
|
when: on_failure
|
|
only:
|
|
- tags
|
|
- develop
|
|
<<: *slacknotification
|
|
needs:
|
|
- job: deploy
|
|
|
|
SuccessNotification:
|
|
variables:
|
|
BUILD_RESULT: "SUCCESS"
|
|
when: on_success
|
|
only:
|
|
- tags
|
|
- develop
|
|
<<: *slacknotification
|
|
needs:
|
|
- job: deploy
|
|
|
|
# Merge checks
|
|
|
|
# validate_lint:
|
|
# <<: *linting
|
|
# only:
|
|
# - merge_requests
|
|
|
|
# validate_build:
|
|
# <<: *BuildIPA
|
|
# only:
|
|
# - merge_requests
|