Cloud Build custom docker image

This commit is contained in:
James Daniels
2019-10-09 17:25:34 +01:00
parent 70ef0ac69e
commit 8af7cc06c0
2 changed files with 30 additions and 5 deletions

16
Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM debian:latest
# Installing Java (and curl)
RUN apt-get update && apt-get install -y curl default-jre default-jdk
RUN apt-get install -y build-essential
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
RUN nvm install .
RUN nvm use .
RUN npm install -g yarn firebase-tools
RUN firebase setup:emulators:firestore
COPY . /
CMD yarn

View File

@@ -4,15 +4,21 @@
# @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/yarn'
- name: 'gcr.io/cloud-builders/docker'
args: ['pull', 'gcr.io/reactfire/docker']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/reactfire/docker', '--cache-from', 'gcr.io/reactfire/docker']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/reactfire/firebase']
- name: 'gcr.io/reactfire/docker'
args: ['install', '--frozen-lockfile']
- name: 'gcr.io/cloud-builders/yarn'
- name: 'gcr.io/reactfire/docker'
dir: 'reactfire'
args: ['build']
- name: 'gcr.io/cloud-builders/yarn'
- name: 'gcr.io/reactfire/docker'
dir: 'reactfire'
args: ['test']
- name: 'gcr.io/cloud-builders/npm'
- name: 'gcr.io/reactfire/docker'
dir: 'reactfire/pub/reactfire'
entrypoint: 'bash'
env:
@@ -24,4 +30,7 @@ steps:
secrets:
- kmsKeyName: projects/reactfire/locations/global/keyRings/cloud-build/cryptoKeys/cloud-build
secretEnv:
NPM_TOKEN: CiQADamFn5XzbeNQgzTGST9r3Tp5skWlDbBiWaZljffgEm0yIxYSTQC1QbtmDtScXx1BPE+d3CP9rXvOY+n5J0XRuLTTqN7RaqyipCEqTi7+z1kI6mKyBo2ilsMtOtngNzbOZ8kZeUDA80ISLWrNs0hF8k78
NPM_TOKEN: CiQADamFn5XzbeNQgzTGST9r3Tp5skWlDbBiWaZljffgEm0yIxYSTQC1QbtmDtScXx1BPE+d3CP9rXvOY+n5J0XRuLTTqN7RaqyipCEqTi7+z1kI6mKyBo2ilsMtOtngNzbOZ8kZeUDA80ISLWrNs0hF8k78
images:
- gcr.io/reactfire/docker