Skip to content

Commit

Permalink
[FABG-912] Azure pipeline configuration
Browse files Browse the repository at this point in the history
Change-Id: Ic086ff681726aa2cdb16aa455225955fd7e3535f
Signed-off-by: Troy Ronda <troy@troyronda.com>
  • Loading branch information
troyronda committed Sep 25, 2019
1 parent c13e0cd commit acd1302
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 57 deletions.
10 changes: 1 addition & 9 deletions Makefile
Expand Up @@ -63,8 +63,7 @@ FABRIC_DEV_REGISTRY ?= nexus3.hyperledger.org:10001
FABRIC_DEV_REGISTRY_PRE_CMD ?= docker login -u docker -p docker nexus3.hyperledger.org:10001

# Base image variables for socat and softshm builds
BASE_UBUNTU_VERSION = "xenial"
BASE_GO_VERSION = "1.12.5"
BASE_GO_VERSION = "1.13"

# Upstream fabric patching (overridable)
THIRDPARTY_FABRIC_CA_BRANCH ?= master
Expand Down Expand Up @@ -277,16 +276,9 @@ lint-all: version populate-noforce
.PHONY: build-softhsm2-image
build-softhsm2-image:
@$(DOCKER_CMD) build --no-cache -q -t "fabsdkgo-softhsm2" \
--build-arg BASE_UBUNTU_VERSION=$(BASE_UBUNTU_VERSION) \
--build-arg BASE_GO_VERSION=$(BASE_GO_VERSION) \
-f $(FIXTURE_SOFTHSM2_PATH)/Dockerfile .

.PHONY: build-socat-image
build-socat-image:
@$(DOCKER_CMD) build --no-cache -q -t "fabsdkgo-socat" \
--build-arg BASE_UBUNTU_VERSION=$(BASE_UBUNTU_VERSION) \
-f $(FIXTURE_SOCAT_PATH)/Dockerfile .

.PHONY: unit-test
unit-test: clean-tests depend-noforce populate-noforce license lint-submodules
@TEST_CHANGED_ONLY=$(FABRIC_SDKGO_TEST_CHANGED) TEST_WITH_LINTER=true FABRIC_SDKGO_CODELEVEL_TAG=$(FABRIC_CODELEVEL_UNITTEST_TAG) FABRIC_SDKGO_CODELEVEL_VER=$(FABRIC_CODELEVEL_UNITTEST_VER) \
Expand Down
42 changes: 42 additions & 0 deletions ci/azure-pipelines.yml
@@ -0,0 +1,42 @@
# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:.rrr)
trigger:
- master
pr:
- master

variables:
GOPATH: $(Agent.BuildDirectory)/go
PATH: $(Agent.BuildDirectory)/go/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
GOVER: 1.13

jobs:
- job: UnitTest
pool:
vmImage: ubuntu-16.04
dependsOn: []
timeoutInMinutes: 60
steps:
- template: install_deps.yml
- checkout: self
# TODO: seperate unit-test and checks.
# TODO: resolve dependencies between dependencies.sh and install_deps.yml
- script: make unit-test
displayName: Run checks and unit test

- job: IntegrationTest
pool:
vmImage: ubuntu-16.04
dependsOn: []
timeoutInMinutes: 60
steps:
- template: install_deps.yml
- checkout: self
- script: make integration-test
displayName: Run integration test
env:
# TODO: update this variable name in the Makefile
JENKINS_URL: true
18 changes: 18 additions & 0 deletions ci/install_deps.yml
@@ -0,0 +1,18 @@
# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

steps:
- script: sudo apt-get clean
displayName: Run apt clean
- script: sudo apt-get update
displayName: Run apt update
- script: sudo apt-get install -y gcc haveged libtool make
displayName: Install dependencies
- task: GoTool@0
inputs:
version: $(GOVER)
goPath: $(GOPATH)
displayName: Install Go $(GOVER)
- script: GO111MODULE=off go get -u github.com/myitcv/gobin
displayName: Install gobin
2 changes: 1 addition & 1 deletion golangci.yml
Expand Up @@ -6,7 +6,7 @@

run:
concurrency: 4
deadline: 1m
deadline: 5m
issues-exit-code: 1
tests: true
build-tags: []
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/dockerenv/docker-compose-chaincoded.yaml
Expand Up @@ -23,7 +23,8 @@ services:
# - dockerd.example.com

chaincoded:
image: ${FABRIC_BASE_DOCKER_REGISTRY}${FABRIC_BASEIMAGE_FIXTURE_IMAGE}:${FABRIC_ARCH}${FABRIC_ARCH_SEP}${FABRIC_BASEIMAGE_FIXTURE_TAG}
# TODO: parameterize golang version
image: golang:1.13
environment:
- DOCKER_HOST=http://dockerd.example.com:2375
- CHAINCODED_VERBOSE
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/dockerenv/docker-compose-nopkcs11-test.yaml
Expand Up @@ -8,7 +8,8 @@ version: '2.1'
services:

integration-tests:
image: ${FABRIC_BASE_DOCKER_REGISTRY}${FABRIC_BASEIMAGE_FIXTURE_IMAGE}:${FABRIC_ARCH}${FABRIC_ARCH_SEP}${FABRIC_BASEIMAGE_FIXTURE_TAG}
# TODO: parameterize golang version
image: golang:1.13
environment:
- GO_TAGS
- GO_TESTFLAGS
Expand Down
17 changes: 0 additions & 17 deletions test/fixtures/socat/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions test/fixtures/socat/install-socat.sh

This file was deleted.

12 changes: 1 addition & 11 deletions test/fixtures/softhsm2/Dockerfile
Expand Up @@ -4,19 +4,9 @@
# SPDX-License-Identifier: Apache-2.0
#

ARG BASE_UBUNTU_VERSION

FROM ubuntu:${BASE_UBUNTU_VERSION}

ARG BASE_GO_VERSION

ENV GOPATH=/opt/gopath \
GOROOT=/opt/go \
PATH=$PATH:/opt/go/bin:/opt/gopath/bin \
GOVER="${BASE_GO_VERSION}"

COPY test/fixtures/softhsm2/install_go.sh /tmp
RUN /tmp/install_go.sh
FROM golang:${BASE_GO_VERSION}

COPY test/fixtures/softhsm2/install-softhsm2.sh /tmp
COPY scripts/_go/src/pkcs11helper /opt/workspace/pkcs11helper
Expand Down
1 change: 0 additions & 1 deletion test/integration/go.mod
Expand Up @@ -12,7 +12,6 @@ require (
github.com/hyperledger/fabric-sdk-go v0.0.0-00010101000000-000000000000
github.com/pkg/errors v0.8.1
github.com/stretchr/testify v1.3.0
google.golang.org/appengine v1.4.0 // indirect
google.golang.org/grpc v1.23.0
)

Expand Down

0 comments on commit acd1302

Please sign in to comment.