Compare commits

...

3 Commits

Author SHA1 Message Date
Filipe Silva
8d5ab908fc ci: add a change 2019-01-06 15:00:11 +00:00
Filipe Silva
1dd11c99cc ci: add linux buildkite tests 2019-01-06 14:53:27 +00:00
Filipe Silva
784453cf9d ci: use image based cache 2019-01-05 22:17:41 +00:00
10 changed files with 158 additions and 7 deletions

View File

@ -0,0 +1,14 @@
version: '3'
services:
windows-env:
build:
context: ../../
dockerfile: ./.buildkite/dockerfiles/windows-env.Dockerfile
windows-test:
build:
context: ../../
dockerfile: ./.buildkite/dockerfiles/windows-test.Dockerfile
linux-test:
build:
context: ../../
dockerfile: ./.buildkite/dockerfiles/linux-test.Dockerfile

View File

@ -0,0 +1,21 @@
FROM node:10.12
# Bazel Ubuntu pre-requisites.
# https://docs.bazel.build/versions/master/install-ubuntu.html
RUN apt-get update;
RUN apt-get -y install pkg-config zip g++ zlib1g-dev unzip python
# Chrome prerequisites.
# Based on https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker
RUN apt-get install -y wget --no-install-recommends \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge --auto-remove -y curl \
&& rm -rf /src/*.deb
# Work back from https://github.com/CircleCI-Public/circleci-dockerfiles/blob/master/node/images/10.12.0-jessie/Dockerfile to get Chrome working properly

View File

@ -0,0 +1,32 @@
FROM gcr.io/internal-200822/angular-linux:latest
USER root
# TODO: Delete the above once the bootstrap image is available.
WORKDIR /src
# Copy package.json and yarn.lock before the other files.
# This allows docker to cache these steps even if source files change.
COPY ./package.json /src/package.json
COPY ./yarn.lock /src/yarn.lock
COPY ./tools/yarn/check-yarn.js /src/tools/yarn/check-yarn.js
COPY ./tools/postinstall-patches.js /src/tools/postinstall-patches.js
RUN yarn install --frozen-lockfile --non-interactive --network-timeout 100000
# Setup files.
COPY ./ /src
COPY .circleci/bazel.rc /etc/bazel.bazelrc
# Workaround symlink when building image on Windows.
RUN rm /src/packages/upgrade/static/src
RUN ln -s ../src /src/packages/upgrade/static/src
# Run tests.
RUN yarn bazel test //tools/ts-api-guardian:all --noshow_progress
# RUN yarn bazel build //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only,-local
# RUN yarn bazel build --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot //...
# RUN yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only,-local
# RUN yarn test-ivy-aot //...
# docker build -t angular:latest .
# docker build . --build-arg target=angular:latest

View File

@ -0,0 +1,21 @@
# Use the a previous image as source, or bootstrap to the default image.
ARG target=filipesilva/node-bazel-windows:0.0.2
FROM $target
WORKDIR /src
# Copy package.json and yarn.lock before the other files.
# This allows docker to cache these steps even if source files change.
COPY ./package.json /src/package.json
COPY ./yarn.lock /src/yarn.lock
RUN yarn install --frozen-lockfile --non-interactive --network-timeout 100000
# Copy files.
COPY ./ /src
# Setup.
COPY .circleci/bazel.rc /etc/bazel.bazelrc
RUN del packages\upgrade\static\src
RUN mklink /d packages\upgrade\static\src ..\src
# Run tests.
RUN yarn bazel test //tools/ts-api-guardian:all --noshow_progress

View File

@ -1,10 +1,36 @@
steps:
- label: windows-test
commands:
- "yarn install --frozen-lockfile --non-interactive --network-timeout 100000"
- "yarn bazel test //tools/ts-api-guardian:all --noshow_progress"
plugins:
- docker#v2.1.0:
image: "filipesilva/node-bazel-windows:0.0.2"
- docker-compose#v2.6.0:
build: windows-test
config: .buildkite/dockerfiles/docker-compose.yml
args:
- target=gcr.io/internal-200822/angular-windows:master
agents:
windows: true
- label: linux-test
plugins:
- docker-compose#v2.6.0:
build: linux-test
config: .buildkite/dockerfiles/docker-compose.yml
# args:
# - target=gcr.io/internal-200822/angular-linux:master
agents:
linux: true
- wait
# - label: windows-update-image
# branches: master
# plugins:
# - docker-compose#v2.6.0:
# push: windows-test:gcr.io/internal-200822/angular-windows:master
# config: .buildkite/dockerfiles/docker-compose.yml
# agents:
# windows: true
# - label: linux-update-image
# # branches: master
# plugins:
# - docker-compose#v2.6.0:
# push: linux-test:gcr.io/internal-200822/angular-linux:master
# config: .buildkite/dockerfiles/docker-compose.yml
# agents:
# linux: true

View File

@ -0,0 +1,26 @@
Follow https://buildkite.com/docs/agent/v3/gcloud#running-the-agent-on-google-container-engine
but :
on the cluster creation chose n1-highcpu-16 instances, and give "read write" permissions to Storage
on the "Create a deployment to start an agent:" step use change
```
env:
- name: BUILDKITE_AGENT_TOKEN
valueFrom: {secretKeyRef: {name: buildkite-agent, key: token}}
```
to
```
env:
- name: BUILDKITE_AGENT_TOKEN
valueFrom: {secretKeyRef: {name: buildkite-agent, key: token}}
- name: BUILDKITE_AGENT_TAGS
value: "linux=true"
- name: BUILDKITE_TIMESTAMP_LINES
value: "true"
```
config kubernetes to access container registry
maybe just give write access to storage https://medium.com/google-cloud/updating-google-container-engine-vm-scopes-with-zero-downtime-50bff87e5f80
https://cloud.google.com/container-registry/docs/using-with-google-cloud-platform
https://container-solutions.com/using-google-container-registry-with-kubernetes/

View File

@ -8,6 +8,8 @@
# We recommend machine type n1-highcpu-16 (16 vCPUs, 14.4 GB memory).
# Use a windows boot disk with container support such as
# "Windows Server version 1803 Datacenter Core for Containers".
# Give it push access to the Container Registry by clicking "Set access for each API" and
# setting "Storage" to "Read Write".
# Give it a name, then click "Create".
# VM setup:
@ -56,6 +58,15 @@ Invoke-WebRequest -Uri https://github.com/git-for-windows/git/releases/download/
Add-Path "C:\git\bin"
Remove-Item git.exe
# Install Docker Compose 1.23.2
# https://docs.docker.com/compose/install/#install-compose
Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\docker\docker-compose.exe
# Add the gcloud Docker credential helper to the local system account (used by NSSM)
# https://cloud.google.com/container-registry/docs/advanced-authentication
gcloud auth configure-docker --quiet
Copy-Item C:\Users\angular\.docker -Destination C:\Windows\System32\config\systemprofile\ -Recurse
# Download NSSM (https://nssm.cc/) to run the BuildKite agent as a service.
Write-Host "Downloading NSSM."
Invoke-WebRequest -Uri https://nssm.cc/ci/nssm-2.24-101-g897c7ad.zip -OutFile nssm.zip

View File

@ -112,7 +112,7 @@ class ResolvedDeclarationEmitter {
emit(): string {
const sourceFile = this.program.getSourceFiles().find(sf => sf.fileName === this.fileName);
if (!sourceFile) {
throw new Error(`Source file "${this.fileName}" not found`);
throw new Error(`Source file "${this.fileName}" not found `);
}
let output: string[] = [];
@ -441,4 +441,4 @@ function applyDefaultTagOptions(tagOptions: JsDocTagOptions | undefined): JsDocT
function getName(node: any) {
return '`' + (node.name && node.name.text ? node.name.text : node.getText()) + '`';
}
}