forked from GenisysPro/GenisysPro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodefresh.yml
60 lines (60 loc) · 2.18 KB
/
codefresh.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
version: '1.0'
steps:
fetch_submodules:
title: Fetching submodules
image: codefreshio/git-image:latest
commands:
- git submodule update --init --recursive
build_testing_image:
title: Building image for testing
type: build
image_name: genisys-ci-test
working_directory: ${{main_clone}}/ci/test
test_and_package:
title: Lint and package
image: ${{build_testing_image}}
commands:
- sed -i "s/const VERSION \?= \?\"\(.*\)\"/const VERSION = \"\1$([ ${{CF_BRANCH}} != master ] && echo unsupported-)${{CF_SHORT_REVISION}}\"/" src/pocketmine/PocketMine.php
- sed -i "/GIT_COMMIT/s/0000000000000000000000000000000000000000/${{CF_REVISION}}/" src/pocketmine/PocketMine.php
- ./ci/run.sh
- mv plugins/DevTools/Genisys*.phar ci/prod/Genisys.phar
build_production_image:
title: Building Docker container for production
type: build
image_name: itxtech/genisys
working_directory: ${{main_clone}}/ci/prod
push_production_image:
title: Pushing image to quay.io
type: push
candidate: ${{build_production_image}}
registry: quay.io
tag: ${{CF_BRANCH_TAG_NORMALIZED}}
credentials:
username: itxtech+genisys
password: ${{QUAY_ROBOT_TOKEN}}
doxygen:
title: Generating docs
image: kalledk/doxygen
commands:
- doxygen
when:
branch:
only:
- master
deploy:
title: Deploying to Google Cloud Storage
image: quay.io/ishitatsuyuki/cloud-sdk
commands:
- echo "${{GCP_SERVICE_ACCOUNT}}" | base64 --decode --ignore-garbage > gcp-service-account.json
- gcloud auth activate-service-account --key-file=gcp-service-account.json
- gsutil -q -m -h "Cache-Control:public, max-age=21600" rsync -a public-read -c -d -r -x ".*\\.md5$|.*\\.map$" html "gs://itx-technologies-141911.appspot.com/genisys/docs"
- gsutil -q -m -h "Cache-Control:public, max-age=21600" cp -a public-read "ci/prod/Genisys.phar" "gs://itx-technologies-141911.appspot.com/genisys/Genisys-latest.phar"
when:
branch:
only:
- master
cleanup:
title: Cleaning up working directory
image: codefreshio/git-image:latest
commands:
- git clean -xfd