Skip to content

Commit

Permalink
Merge pull request #2 from sridharkondeti/main
Browse files Browse the repository at this point in the history
Create github workflow to automatically build/test/release package.
  • Loading branch information
anand-desai authored Sep 26, 2023
2 parents 35728af + dc475b6 commit 4d5976d
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 8 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
permissions: write-all
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Install Strongswan For Testing IPSec Service In Unit Tests
run: sudo apt install charon-systemd

- name: Run Unit Tests
run: sudo make test

- name: Build Debian/rpm Packages For Development Environment
run: make dev

- name: Development Environment Latest Version
id: dev-release
uses: softprops/action-gh-release@v1
with:
files: /home/runner/work/vpc-file-storage-mount-helper/vpc-file-storage-mount-helper/mount.ibmshare-latest.tar.gz,/home/runner/work/vpc-file-storage-mount-helper/vpc-file-storage-mount-helper/mount.ibmshare-latest.tar.gz.sha256
tag_name: dev-pre-ga
name: Development Version
body: Mount Helper For Development Teams-GA

- name: Build Debian/rpm Packages For Production Environment
run: make prod

- name: Latest Tag Release
id: latest-tag
uses: softprops/action-gh-release@v1
with:
files: /home/runner/work/vpc-file-storage-mount-helper/vpc-file-storage-mount-helper/mount.ibmshare-latest.tar.gz, /home/runner/work/vpc-file-storage-mount-helper/vpc-file-storage-mount-helper/mount.ibmshare-latest.tar.gz.sha256
tag_name: latest
name: Latest
body: The latest release tag provides static link for package download. This has the same artificats as in the versioned latest version.

- name: Latest Version
id: release
uses: softprops/action-gh-release@v1
with:
files: /home/runner/work/vpc-file-storage-mount-helper/vpc-file-storage-mount-helper/mount.ibmshare-latest.tar.gz,/home/runner/work/vpc-file-storage-mount-helper/vpc-file-storage-mount-helper/mount.ibmshare-latest.tar.gz.sha256
tag_name: 0.0.2
name: 0.0.2
body: CSR generated with SHA1 is not supported to get certs using Metadata.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile to build deb and rpm packages to install mount.ibmshare on target Linux machines.

NAME := mount.ibmshare
APP_VERSION := 0.0.1
APP_VERSION := 0.0.2
MAINTAINER := "Genctl Share"
DESCRIPTION := "IBM Mount Share helper"
LICENSE := "IBM"
Expand Down Expand Up @@ -85,6 +85,7 @@ local:

test:
cd test && ./run_test.sh
rm -rf ./src/__pycache__ ./test/__pycache__

pyenv-test:
cd test && ./run_pyenv_test.sh
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ This project is licensed under the MIT License, see LICENSE file in the root dir
Mount helper is an open source automation tool that helps to establish secure IPsec connection between customer virtual server instance (VSI) and storage server. The mount helper ensures that the communication between the customer VSI and the file share is encrypted in transit.

For more information, see the [IBM Cloud File Share Mount Helper utility](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-eit&interface=ui#fs-mount-helper-utility) topic in the IBM Cloud Docs.

## Contributing Guidelines
If you have a new feature ready to merge, update github workflow (.github/workflows/release.yml) to create a new release. Do not change the latest tag release, this is to provide static link to the downloadable package.
8 changes: 1 addition & 7 deletions src/certificate_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,7 @@ def validate_csr(self, csr_txt):
return out is not None

def get_digest(self):
# bit of a hack for checking sha to
version = get_app_version("/usr/bin/openssl", "openssl", vcmd="version")
if version:
self.LogDebug("OpenSSL version:"+version)
if version_compare(version, "1.1") >= 0:
return "-sha256"
return "-sha1"
return "-sha256"

def generate_csr(self, private_key):
# openssl req -out server.csr -key server.key -new
Expand Down
2 changes: 2 additions & 0 deletions test/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export PYTHONPATH=../src:$PYTHONPATH
rm -f -r ../src./__pycache__
rm -f -r __pycache__

mkdir -p /opt/ibm/mount-ibmshare

if [[ "$1" == "" ]]; then
python3 -m unittest discover -f -v -s . -p '*_test.py'
else
Expand Down

0 comments on commit 4d5976d

Please sign in to comment.