Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b54d647

Browse files
committed
ci(*): cloudbuild
1 parent 0d0baa6 commit b54d647

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

‎README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<th>License</th>
44
<th>Gitlab CI</th>
55
<th>Github Action</th>
6+
<th>GCP Cloud Build</th>
67
</tr>
78
<tr>
89
<td>
@@ -17,6 +18,11 @@
1718
<a href="https://github.com/bwnyasse/flutter-testing-tutorial/actions?query=workflow%3A%22Flutter+Testing+Tutorial+CI+On+push%22" target="_blank">
1819
<img src="https://github.com/bwnyasse/flutter-testing-tutorial/workflows/Flutter%20Testing%20Tutorial%20CI%20On%20push/badge.svg"/>
1920
</a>
21+
</td>
22+
<td>
23+
<a>
24+
<img src="https://storage.googleapis.com/model-zoo-260810-badges/builds/flutter-testing-tutorial/branches/master.svg"/>
25+
</a>
2026
</td>
2127
</tr>
2228
</table>

‎cloudbuild.sh‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!#/bin/bash
2+
3+
cd /workspace/1ドル
4+
HEAD_SHA=$(git rev-parse --verify HEAD)
5+
VERSION_CODE=$(git rev-list --count master)
6+
#TODO: We can add flutter test
7+
flutter build apk --build-name=$HEAD_SHA --build-number=$VERSION_CODE

‎cloudbuild.yaml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Basic flutter build
2+
3+
# In this directory, run the following command to build this builder.
4+
# $ gcloud builds submit . --config=cloudbuild.yaml
5+
6+
steps:
7+
8+
# clone the latest source codes
9+
- name: 'gcr.io/cloud-builders/git'
10+
args: ['clone', 'https://github.com/bwnyasse/flutter-testing-tutorial.git']
11+
dir: '/workspace'
12+
13+
# INTEGRATION : To run flutter build apk, one must need to be at the root of the project,
14+
# the script simply cd to the root before running the build command
15+
#-------------------------------------------------------------------------------------------
16+
- name: 'gcr.io/$PROJECT_ID/flutter'
17+
entrypoint: '/bin/bash'
18+
args: ['cloudbuild.sh', 'flutter-testing-tutorial']
19+
20+
# DEPLOYMENT: apk artifacts can be pushed to a GCS bucket like this
21+
#------------------------------------------------------------------
22+
#- name: 'gcr.io/cloud-builders/gsutil'
23+
# args: ['cp', '/workspace/flutter/examples/hello_world/build/app/outputs/apk/release/app-release.apk', 'gs://$MY_BUCKET/hello_world.apk']
24+
25+
# DELIVERY : upload apk to google play store with Fastlane
26+
#-----------------------------------------------------------
27+
#- name: 'gcr.io/$PROJECT_ID/fastlane'
28+
# args: ['supply', '--package_name','${_ANDROID_PACKAGE_NAME}', '--track', '${_ANDROID_RELEASE_CHANNEL}', '--json_key_data', '${_GOOGLE_PLAY_UPLOAD_KEY_JSON}', '--apk', '/workspace/${_REPO_NAME}/build/app/outputs/apk/release/app-release.apk']
29+
#timeout: 1200s
30+
31+
tags: ['cloud-builders-community']

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /