Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move onto Azure DevOps #140

Merged
merged 1 commit into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 37 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,41 @@
trigger:
- master

jobs:
- job: check
displayName: Check code
pool:
vmImage: ubuntu-latest
pool:
vmImage: 'ubuntu-18.04'

variables:
- group: credentials

stages:
- stage: PreCheck
displayName: Check license and documents
jobs:
- job: CheckLicenseAndDocs
steps:
- template: ci/check.yml
condition: and(always(), eq(variables['Build.Reason'], 'PullRequest'))
- template: ci/check-license-and-docs.yml

- stage: ProcessComponents
displayName: ProcessComponents
jobs:
- template: ci/process-components.yml
parameters:
param:
- name: dashandapi
pretest: "dashandapi_pre.yml"
posttest: "dashandapi_post.yml"
images:
- imagename: "hyperledger/cello-api-engine"
dockerfile: "build_image/docker/common/api-engine/Dockerfile.in"
- imagename: "hyperledger/cello-nginx"
dockerfile: "build_image/docker/common/nginx/Dockerfile.in"
- imagename: "hyperledger/cello-dashboard"
dockerfile: "build_image/docker/common/dashboard/Dockerfile.in"
- name: ansibleagent
images:
- imagename: "hyperledger/cello-ansible-agent"
dockerfile: "build_image/docker/agent/ansible/Dockerfile.in"
- name: fabricoperator
images:
- imagename: "hyperledger/cello-fabric-operator"
dockerfile: "build_image/docker/agent/fabric-operator/Dockerfile.in"
4 changes: 2 additions & 2 deletions build_image/docker/agent/ansible/Dockerfile.in
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# @see https://github.com/hyperledger/cello/blob/master/docs/worker_ansible_howto.md
#
FROM _DOCKER_BASE_
MAINTAINER Tong Li <litong01@us.ibm.com>
FROM python:3.6
MAINTAINER Hyperledger Cello Team <github.com/hyperledger/cello>

ARG user=ubuntu
ARG uid=1000
Expand Down
8 changes: 3 additions & 5 deletions build_image/docker/common/dashboard/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ FROM circleci/node:latest-browsers

WORKDIR /usr/src/app/
USER root
COPY src/dashboard/package.json ./
RUN yarn
COPY src/dashboard ./
RUN npm run build
RUN mkdir -p /usr/src/app && cd /usr/src/app
COPY src/dashboard /usr/src/app
RUN yarn --network-timeout 600000 && yarn run build

FROM nginx:1.15.12

COPY --from=0 /usr/src/app/dist /usr/share/nginx/html
COPY build_image/docker/common/dashboard/config-nginx.sh /
RUN chmod +x /config-nginx.sh
Expand Down
10 changes: 10 additions & 0 deletions ci/check-license-and-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# SPDX-License-Identifier: Apache-2.0
#

steps:
- script: |
set -eu -o pipefail
make license
find ./docs -type f -name "*.md" -exec egrep -l " +$$" {} \;
displayName: 'License and document checks'
12 changes: 12 additions & 0 deletions ci/dashandapi_post.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# SPDX-License-Identifier: Apache-2.0
#

steps:
- script: |
MODE=dev make start
sleep 10
make test-api
MODE=dev make stop
make check-dashboard
displayName: 'Run API and Dashboard tests'
5 changes: 3 additions & 2 deletions ci/check.yml → ci/dashandapi_pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ steps:
sudo pip install --upgrade pip
sudo pip install wheel
sudo pip install tox
make check
displayName: 'make check'
cd src/api-engine
tox
displayName: 'Run tox'
23 changes: 23 additions & 0 deletions ci/process-components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
parameters:
param: []

jobs:
- ${{ each component in parameters.param }}:
- job: ${{ component.name }}
steps:
- ${{ if component.pretest }}:
- template: ${{ component.pretest }}
- ${{ each image in component.images }}:
- script: |
docker build -t ${{ image.imagename }} -f ${{ image.dockerfile }} .
displayName: Build ${{ image.imagename }} docker image
- script: docker images
displayName: 'List available images'
- ${{ if component.posttest }}:
- template: ${{ component.posttest }}
- ${{ each image in component.images }}:
- script: |
docker login --username $(DockerHub-Username) --password $(DockerHub-Password)
docker push ${{ image.imagename }}
displayName: Publish docker image ${{ image.imagename }}
condition: eq(variables['Build.Reason'], 'IndividualCI')