Files
Privado-iOS/.gitlab-ci.yml
Juraldinio 08cfe1652d Fix build
2022-03-10 17:03:41 +03:00

144 lines
2.2 KiB
YAML

# Execute always
before_script:
- 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:
- mac
stage: lint
when: always
allow_failure: false
script:
- chmod +x ./BuildTools/linting.sh
- ./BuildTools/linting.sh
Lint:
<<: *linting
only:
- master
- develop
- tags
- /^bugfix/
- /^feature/
- merge_requests
# Testing stage
Tests:
stage: test
when: on_success
tags:
- mac
only:
- develop
- merge_requests
script:
- chmod +x ./BuildTools/testing.sh
- ./BuildTools/testing.sh
# Build IPA
.BuildIPA: &BuildIPA
tags:
- mac
stage: build
when: on_success
allow_failure: false
script:
- rm -rf ./PrivadoIPA
- chmod +x ./BuildTools/build_iOS.sh
- ./BuildTools/build_iOS.sh PRODUCTION
- ./BuildTools/build_iOS.sh BETA
# Build stage
build:
stage: build
<<: *BuildIPA
only:
- master
- develop
- tags
- /^bugfix/
- /^feature/
artifacts:
paths:
- ./PrivadoIPA
expire_in: 3 days
# Deploy stage
deploy:
when: on_success
allow_failure: false
dependencies:
- build
variables:
IPA_DEPLOY_TARGET: "TESTFLIGHT"
IPA_PATH: ./PrivadoIPA
stage: deploy
only:
- master
- develop
- tags
when: manual
script:
- chmod +x ./BuildTools/deploy_iOS.sh
- ./BuildTools/deploy_iOS.sh ${IPA_DEPLOY_TARGET} ${IPA_PATH}
tags:
- mac
# Slack notification
.slacknotification: &slacknotification
tags:
- mac
stage: notification
allow_failure: false
script:
- chmod +x ./BuildTools/slack_notification.sh
- ./BuildTools/slack_notification.sh ${BUILD_RESULT}
FailureNotification:
variables:
BUILD_RESULT: "FAILURE"
when: on_failure
only:
- master
- develop
- tags
<<: *slacknotification
SuccessNotification:
variables:
BUILD_RESULT: "SUCCESS"
when: on_success
only:
- master
- develop
- tags
<<: *slacknotification
# Merge checks
# validate_lint:
# <<: *linting
# only:
# - merge_requests
# validate_build:
# <<: *BuildIPA
# only:
# - merge_requests