This build step invokes the ng
command provided by the Angular CLI distributed in Google Cloud Build.
Arguments passed to this builder will be passed to the ng
command directly,
allowing callers to run any ng
command.
For convenience, we have included different versions of the Angular CLI:
gcr.io/$PROJECT_ID/ng:v1
: provides thev1.*
legacy branchgcr.io/$PROJECT_ID/ng:v6
: provides thev6.*
branchgcr.io/$PROJECT_ID/ng:v7
: provides thev7.*
branchgcr.io/$PROJECT_ID/ng:v8
: provides thev8.*
branchgcr.io/$PROJECT_ID/ng:latest
: provides the latest stable branchgcr.io/$PROJECT_ID/ng
: same asng:latest
gcr.io/$PROJECT_ID/ng:next
: provides the next unstable branch
In order to use call one of these builder, simply invoke the builder (and version), for instance:
steps:
- name: 'gcr.io/$PROJECT_ID/ng'
args: ['build', '--prod']
Or, if you are maintaining a legacy Angular project:
steps:
- name: 'gcr.io/$PROJECT_ID/ng:v1'
args: ['test', '--sourcemap=false']
See the examples
folder for a complete example.
To build these builders, run the following command in this directory:
$ gcloud builds submit . --config=cloudbuild.yaml