diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml new file mode 100644 index 0000000000..9c57962fcf --- /dev/null +++ b/ci/azure-pipelines.yml @@ -0,0 +1,51 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# + +trigger: + - master + - release-1.4 + +jobs: + - job: fabcar_go + displayName: FabCar (Go) + pool: + vmImage: ubuntu-18.04 + dependsOn: [] + timeoutInMinutes: 60 + steps: + - template: install-deps.yml + - template: install-fabric.yml + - template: fabcar-go.yml + - job: fabcar_java + displayName: FabCar (Java) + pool: + vmImage: ubuntu-18.04 + dependsOn: [] + timeoutInMinutes: 60 + steps: + - template: install-deps.yml + - template: install-fabric.yml + - template: fabcar-java.yml + - job: fabcar_javascript + displayName: FabCar (JavaScript) + pool: + vmImage: ubuntu-18.04 + dependsOn: [] + timeoutInMinutes: 60 + steps: + - template: install-deps.yml + - template: install-fabric.yml + - template: fabcar-javascript.yml + - job: fabcar_typescript + displayName: FabCar (TypeScript) + pool: + vmImage: ubuntu-18.04 + dependsOn: [] + timeoutInMinutes: 60 + steps: + - template: install-deps.yml + - template: install-fabric.yml + - template: fabcar-typescript.yml + + diff --git a/ci/fabcar-go.yml b/ci/fabcar-go.yml new file mode 100644 index 0000000000..d8c472b9ed --- /dev/null +++ b/ci/fabcar-go.yml @@ -0,0 +1,8 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# + +steps: + - script: bash startFabric.sh go + workingDirectory: fabcar + displayName: Start Fabric diff --git a/ci/fabcar-java.yml b/ci/fabcar-java.yml new file mode 100644 index 0000000000..9597bd54d9 --- /dev/null +++ b/ci/fabcar-java.yml @@ -0,0 +1,14 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# + +steps: + - script: bash startFabric.sh java + workingDirectory: fabcar + displayName: Start Fabric + - script: retry -- mvn dependency:go-offline + workingDirectory: fabcar/java + displayName: Install FabCar application dependencies + - script: mvn test + workingDirectory: fabcar/java + displayName: Run FabCar application diff --git a/ci/fabcar-javascript.yml b/ci/fabcar-javascript.yml new file mode 100644 index 0000000000..3f9107470e --- /dev/null +++ b/ci/fabcar-javascript.yml @@ -0,0 +1,19 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# + +steps: + - script: bash startFabric.sh javascript + workingDirectory: fabcar + displayName: Start Fabric + - script: retry -- npm install + workingDirectory: fabcar/javascript + displayName: Install FabCar application dependencies + - script: | + set -ex + node enrollAdmin + node registerUser + node invoke + node query + workingDirectory: fabcar/javascript + displayName: Run FabCar application diff --git a/ci/fabcar-typescript.yml b/ci/fabcar-typescript.yml new file mode 100644 index 0000000000..8bbe48bba4 --- /dev/null +++ b/ci/fabcar-typescript.yml @@ -0,0 +1,22 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# + +steps: + - script: bash startFabric.sh typescript + workingDirectory: fabcar + displayName: Start Fabric + - script: retry -- npm install + workingDirectory: fabcar/typescript + displayName: Install FabCar application dependencies + - script: npm run build + workingDirectory: fabcar/typescript + displayName: Build FabCar application + - script: | + set -ex + node dist/enrollAdmin + node dist/registerUser + node dist/invoke + node dist/query + workingDirectory: fabcar/typescript + displayName: Run FabCar application diff --git a/ci/install-deps.yml b/ci/install-deps.yml new file mode 100644 index 0000000000..a414861fd3 --- /dev/null +++ b/ci/install-deps.yml @@ -0,0 +1,7 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# + +steps: + - script: sudo sh -c "curl https://raw.githubusercontent.com/kadwanev/retry/master/retry -o /usr/local/bin/retry && chmod +x /usr/local/bin/retry" + displayName: Install retry CLI \ No newline at end of file diff --git a/ci/install-fabric.yml b/ci/install-fabric.yml new file mode 100644 index 0000000000..9b699961a1 --- /dev/null +++ b/ci/install-fabric.yml @@ -0,0 +1,29 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# + +steps: + - script: | + set -ex + mvn dependency:get -DremoteRepositories=https://nexus.hyperledger.org/content/repositories/snapshots -Dartifact=org.hyperledger.fabric:hyperledger-fabric-latest:linux-amd64.latest-SNAPSHOT:tar.gz + mvn dependency:copy -Dartifact=org.hyperledger.fabric:hyperledger-fabric-latest:linux-amd64.latest-SNAPSHOT:tar.gz -DoutputDirectory=/tmp + cd /usr/local + sudo tar xzvf /tmp/hyperledger-fabric-latest-linux-amd64.latest-SNAPSHOT.tar.gz + displayName: Download Fabric CLI + - script: | + set -ex + mvn dependency:get -DremoteRepositories=https://nexus.hyperledger.org/content/repositories/snapshots -Dartifact=org.hyperledger.fabric-ca:hyperledger-fabric-ca-latest:linux-amd64.latest-SNAPSHOT:tar.gz + mvn dependency:copy -Dartifact=org.hyperledger.fabric-ca:hyperledger-fabric-ca-latest:linux-amd64.latest-SNAPSHOT:tar.gz -DoutputDirectory=/tmp + cd /usr/local + sudo tar xzvf /tmp/hyperledger-fabric-ca-latest-linux-amd64.latest-SNAPSHOT.tar.gz + displayName: Download Fabric CA CLI + - script: | + set -ex + for i in baseos ca ccenv javaenv nodeenv peer orderer tools; do + docker pull nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-2.0.0-stable + docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-2.0.0-stable hyperledger/fabric-$i:amd64-2.0.0-stable + docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-2.0.0-stable hyperledger/fabric-$i:amd64-2.0.0 + docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-2.0.0-stable hyperledger/fabric-$i:2.0.0 + docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-2.0.0-stable hyperledger/fabric-$i:latest + done + displayName: Pull Fabric Docker images