forked from FirebaseExtended/emberfire
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a CI/CD process using Cloud Build
- Loading branch information
1 parent
10995e5
commit 1978ae9
Showing
6 changed files
with
79 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# See go/emberfire-releasing for details on the EmberFire release process. | ||
# If you need to trigger a release manually, be sure to use substitutions like so: | ||
# @canary `gcloud builds submit --substitutions=SHORT_SHA="9b0a0b0"` | ||
# @next `gcloud builds submit --substitutions=TAG_NAME="v1.2.3-rc.1"` | ||
# @latest `gcloud builds submit --substitutions=TAG_NAME="v1.2.3"` | ||
steps: | ||
- name: 'gcr.io/cloud-builders/npm' | ||
entrypoint: 'bash' | ||
args: ["./tools/build.sh"] | ||
env: | ||
- 'TAG_NAME=$TAG_NAME' | ||
- 'SHORT_SHA=$SHORT_SHA' | ||
|
||
- name: 'gcr.io/cloud-builders/npm' | ||
entrypoint: 'bash' | ||
args: ["./tools/test.sh"] | ||
|
||
- name: 'gcr.io/cloud-builders/npm' | ||
entrypoint: 'bash' | ||
env: ['TAG_NAME=$TAG_NAME'] | ||
args: ["./tools/publish.sh"] | ||
secretEnv: ['NPM_TOKEN'] | ||
|
||
secrets: | ||
- kmsKeyName: projects/emberfire/locations/global/keyRings/cloud-build/cryptoKeys/cloud-build | ||
secretEnv: | ||
NPM_TOKEN: CiQAxlQk+PxG1u0O1jMNoRKrxzNe3cSVlQy3gaqsjD41F2m4OVsSTQDyeLEmlpwbxLfuaD0/PrvQ/BYQcwosux7TsMiIMX6PAAD61VfBV6teM5fkIgmWG7rPdRmFvzavH0j2excXsS1k8KR4lLh6+gsT3JUk |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# TODO remove when no longer publishing to emberfire-exp | ||
export EMBER_CLI_IGNORE_ADDON_NAME_MISMATCH=true | ||
|
||
if test $TAG_NAME; then | ||
npm version $(echo $TAG_NAME | sed 's/^v\(.*\)$/\1/') | ||
else | ||
npm version $(npm version | head -n 1 | sed "s/^.*: '\([^']*\).*/\1/")-canary.$SHORT_SHA | ||
fi | ||
|
||
npm install | ||
npm run build | ||
npm run reference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc | ||
|
||
LATEST_TEST="^v[^-]*$" | ||
|
||
if test $TAG_NAME; then | ||
if [[ ! $TAG_NAME =~ $LATEST_TEST ]]; then | ||
npm publish . --tag next | ||
else | ||
npm publish . | ||
fi | ||
else | ||
npm publish . --tag canary | ||
fi | ||
|
||
# TODO put this in a shell trap | ||
rm -f .npmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# TODO remove when no longer publishing to emberfire-exp | ||
export EMBER_CLI_IGNORE_ADDON_NAME_MISMATCH=true | ||
|
||
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - | ||
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list | ||
|
||
apt-get -y update | ||
apt-get -y install google-chrome-stable | ||
|
||
# Already built, don't need to do that again | ||
npx ember test |