Skip to content

Commit

Permalink
Add Release Pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Brett Logan <lindluni@github.com>
  • Loading branch information
lindluni authored and denyeart committed Mar 9, 2021
1 parent b8bb426 commit c239845
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 1 deletion.
89 changes: 89 additions & 0 deletions ci/azure-pipelines-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Copyright the Hyperledger Fabric cont ributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

name: RELEASE-$(Date:yyyyMMdd)$(Rev:.rrr)
trigger: none
pr: none

variables:
- group: credentials
- name: GOPATH
value: $(Agent.BuildDirectory)/go
- name: GOVER
value: 1.15.7

stages:
- stage: BuildBinaries
dependsOn: []
displayName: "Build Fabric CA Binaries"
jobs:
- job: Build
pool:
vmImage: ubuntu-16.04
container: golang:$(GOVER)
strategy:
matrix:
Linux-amd64:
TARGET: linux-amd64
MacOS-amd64:
TARGET: darwin-amd64
Windows-amd64:
TARGET: windows-amd64
steps:
- checkout: self
path: 'go/src/github.com/hyperledger/fabric-ca'
displayName: Checkout Fabric CA Code
- script: make dist/$(TARGET)
displayName: Compile Binary and Create Tarball
- publish: release/$(TARGET)/hyperledger-fabric-ca-$(TARGET)-$(RELEASE).tar.gz
artifact: hyperledger-fabric-ca-$(TARGET)-$(RELEASE).tar.gz
displayName: Publish Release Artifact

- stage: BuildAndPushDockerImages
dependsOn: []
displayName: "Build and Push Fabric CA Docker Images"
jobs:
- job: Docker
pool:
vmImage: ubuntu-16.04
steps:
- template: install_deps.yml
- checkout: self
path: 'go/src/github.com/hyperledger/fabric-ca'
displayName: Checkout Fabric CA Code
- script: ./ci/scripts/publish_docker.sh
env:
DOCKER_PASSWORD: $(DockerHub-Password)
DOCKER_USERNAME: $(DockerHub-Username)
displayName: Publish Docker Images

- stage: DraftRelease
displayName: "Draft GitHub Release"
dependsOn:
- BuildBinaries
- BuildAndPushDockerImages
jobs:
- job: Release
pool:
vmImage: ubuntu-16.04
steps:
- download: current
patterns: '*.tar.gz'
displayName: Download Artifacts
- checkout: self
- task: GitHubRelease@0
inputs:
action: create
addChangeLog: true
assets: $(Pipeline.Workspace)/*amd64*/*
compareWith: lastFullRelease
gitHubConnection: fabric-ca-release
isDraft: true
releaseNotesFile: release_notes/v$(RELEASE).md
repositoryName: $(Build.Repository.Name)
releaseNotesSource: file
tag: v$(RELEASE)
tagSource: manual
title: v$(RELEASE)
displayName: Draft Release of Fabric CA
2 changes: 1 addition & 1 deletion ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pr:
variables:
GOPATH: $(Agent.BuildDirectory)/go
PATH: $(Agent.BuildDirectory)/go/bin:$(Agent.BuildDirectory)/go/src/github.com/hyperledger/fabric-ca/build/tools:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
GOVER: 1.15.5
GOVER: 1.15.7

jobs:
- job: VerifyBuild
Expand Down
21 changes: 21 additions & 0 deletions ci/scripts/publish_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail

make docker

docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}"

docker tag "hyperledger/fabric-ca" "hyperledger/fabric-ca:amd64-${RELEASE}"
docker push "hyperledger/fabric-ca:amd64-${RELEASE}"

docker tag "hyperledger/fabric-ca" "hyperledger/fabric-ca:${RELEASE}"
docker push "hyperledger/fabric-ca:${RELEASE}"

docker tag "hyperledger/fabric-ca" "hyperledger/fabric-ca:amd64-${TWO_DIGIT_RELEASE}"
docker push "hyperledger/fabric-ca:amd64-${TWO_DIGIT_RELEASE}"

docker tag "hyperledger/fabric-ca" "hyperledger/fabric-ca:${TWO_DIGIT_RELEASE}"
docker push "hyperledger/fabric-ca:${TWO_DIGIT_RELEASE}"

0 comments on commit c239845

Please sign in to comment.