From 382479bc7fbb8083c42372e04bdd2333a121726f Mon Sep 17 00:00:00 2001 From: Tatsuya Sato Date: Thu, 28 Sep 2023 05:34:07 +0000 Subject: [PATCH] Move publishing of REST sample Image from AZP to GHA This patch moves publishing of REST sample image from AZP to GHA. This was the last job running on AZP. Also, this patch will fix an error encounterd during the image build. Publishing of REST sample image is now only executed when pushing to main. Signed-off-by: Tatsuya Sato --- .github/workflows/rest-sample.yaml | 11 +++++ .../rest-api-typescript/dammy.txt | 0 ci/azure-pipelines.yml | 46 ------------------- 3 files changed, 11 insertions(+), 46 deletions(-) create mode 100644 asset-transfer-basic/rest-api-typescript/dammy.txt delete mode 100644 ci/azure-pipelines.yml diff --git a/.github/workflows/rest-sample.yaml b/.github/workflows/rest-sample.yaml index 71f768375e..fab668b7f9 100644 --- a/.github/workflows/rest-sample.yaml +++ b/.github/workflows/rest-sample.yaml @@ -45,3 +45,14 @@ jobs: - name: Test REST Sample Application run: npm test working-directory: asset-transfer-basic/rest-api-typescript + + - name: Build REST Sample Docker Image + run: docker build -t ghcr.io/hyperledger/fabric-rest-sample . + working-directory: asset-transfer-basic/rest-api-typescript + + - name: Publish REST Sample Docker Image + if: github.event_name == 'push' && (github.ref == 'refs/heads/main') + run: | + echo ${{ secrets.GITHUB_PAT }} | docker login ghcr.io -u ${{ secrets.GITHUB_USER }} --password-stdin + docker push ghcr.io/hyperledger/fabric-rest-sample:latest + working-directory: asset-transfer-basic/rest-api-typescript diff --git a/asset-transfer-basic/rest-api-typescript/dammy.txt b/asset-transfer-basic/rest-api-typescript/dammy.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml deleted file mode 100644 index 0752b33d95..0000000000 --- a/ci/azure-pipelines.yml +++ /dev/null @@ -1,46 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -trigger: - - main - - release-1.4 - - release-2.2 - -variables: - - name: NODE_VER - value: 16.x - - group: credentials - -jobs: - - job: REST_Sample - displayName: REST Server Sample - pool: - vmImage: ubuntu-20.04 - 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: | - docker build -t ghcr.io/hyperledger/fabric-rest-sample . - workingDirectory: asset-transfer-basic/rest-api-typescript - displayName: Build REST Sample Docker Image - - script: | - echo ${GITHUB_PAT} | docker login ghcr.io -u ${GITHUB_USER} --password-stdin - docker push ghcr.io/hyperledger/fabric-rest-sample:latest - condition: and(succeeded(),eq(variables['Build.Reason'], 'IndividualCI')) - workingDirectory: asset-transfer-basic/rest-api-typescript - displayName: Publish REST Sample Docker Image - env: - GITHUB_USER: $(GITHUB_USER) - GITHUB_PAT: $(GITHUB_PAT) \ No newline at end of file