mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-26 03:25:09 +00:00
test build
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
This commit is contained in:
parent
a0c9169df4
commit
5b6fe3439e
3 changed files with 45 additions and 48 deletions
44
.github/workflows/rest-sample.yaml
vendored
44
.github/workflows/rest-sample.yaml
vendored
|
|
@ -6,8 +6,6 @@ run-name: ${{ github.actor }} is testing the REST Sample
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_VER: 16.x
|
NODE_VER: 16.x
|
||||||
# IMAGE_NAME: ghcr.io/hyperledger/fabric-rest-sample
|
|
||||||
IMAGE_NAME: ghcr.io/hyperledger/fabric-samples/asset-transfer-basic/rest-api-typescript
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
@ -43,45 +41,3 @@ jobs:
|
||||||
- name: Test REST Sample Application
|
- name: Test REST Sample Application
|
||||||
run: npm test
|
run: npm test
|
||||||
working-directory: asset-transfer-basic/rest-api-typescript
|
working-directory: asset-transfer-basic/rest-api-typescript
|
||||||
|
|
||||||
docker-image:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
${{ env.IMAGE_NAME }}
|
|
||||||
# todo: where shall we describe the revision of the sample component(s)?
|
|
||||||
# tags: |
|
|
||||||
# type=semver,pattern={{version}}
|
|
||||||
# type=semver,pattern={{major}}
|
|
||||||
# type=semver,pattern={{major}}.{{minor}}
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Build and push
|
|
||||||
id: push
|
|
||||||
uses: docker/build-push-action@v3
|
|
||||||
with:
|
|
||||||
context: asset-transfer-basic/rest-api-typescript
|
|
||||||
#platforms: linux/amd64,linux/arm64
|
|
||||||
platforms: linux/amd64
|
|
||||||
# todo: this is not right as it may try to publish on any push event
|
|
||||||
# push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
|
|
||||||
# todo: temp hack
|
|
||||||
push: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
31
ci/azure-pipelines.yml
Normal file
31
ci/azure-pipelines.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
- main
|
||||||
|
- release-1.4
|
||||||
|
- release-2.2
|
||||||
|
|
||||||
|
variables:
|
||||||
|
- name: FABRIC_VERSION
|
||||||
|
value: 2.4
|
||||||
|
- name: GOPATH
|
||||||
|
value: $(Build.Repository.LocalPath)
|
||||||
|
- name: GO_BIN
|
||||||
|
value: $(GOPATH)/bin
|
||||||
|
- name: GO_VER
|
||||||
|
value: 1.18.3
|
||||||
|
- name: NODE_VER
|
||||||
|
value: 16.x
|
||||||
|
- name: PATH
|
||||||
|
value: $(GOPATH)/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
|
||||||
|
- group: credentials
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: REST_Sample
|
||||||
|
displayName: REST Server Sample
|
||||||
|
pool:
|
||||||
|
vmImage: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- template: templates/asset-transfer-basic/azure-pipelines-rest.yml
|
||||||
|
|
@ -3,13 +3,23 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- task: NodeTool@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: $(NODE_VER)
|
||||||
|
displayName: Install Node.js
|
||||||
|
- script: npm install
|
||||||
|
workingDirectory: asset-transfer-basic/rest-api-typescript
|
||||||
|
displayName: Install REST Sample Dependencies
|
||||||
|
- script: npm run build
|
||||||
|
workingDirectory: asset-transfer-basic/rest-api-typescript
|
||||||
|
displayName: Build REST Sample Application
|
||||||
|
- script: npm test
|
||||||
|
workingDirectory: asset-transfer-basic/rest-api-typescript
|
||||||
|
displayName: Test REST Sample Application
|
||||||
- script: |
|
- script: |
|
||||||
docker build -t ghcr.io/hyperledger/fabric-rest-sample .
|
docker build -t ghcr.io/hyperledger/fabric-rest-sample .
|
||||||
workingDirectory: asset-transfer-basic/rest-api-typescript
|
workingDirectory: asset-transfer-basic/rest-api-typescript
|
||||||
displayName: Build REST Sample Docker Image
|
displayName: Build REST Sample Docker Image
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
echo ${GITHUB_PAT} | docker login ghcr.io -u ${GITHUB_USER} --password-stdin
|
echo ${GITHUB_PAT} | docker login ghcr.io -u ${GITHUB_USER} --password-stdin
|
||||||
docker push ghcr.io/hyperledger/fabric-rest-sample:latest
|
docker push ghcr.io/hyperledger/fabric-rest-sample:latest
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue