Skip to content

Commit

Permalink
Merge branch 'main' into best_practices
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuelhaine authored Jul 16, 2024
2 parents 226b8cf + 76e70d6 commit de35f31
Show file tree
Hide file tree
Showing 102 changed files with 3,945 additions and 601 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/enable_disabled_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Enable disabled workflow'

on:
schedule:
# minute hour dom month dow (UTC)
- cron: '00 00 2 * *'
# enable manual trigger of version updates
workflow_dispatch:

jobs:
multi-gitter:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@main
- uses: ./actions/multi-gitter-action

- name: Print version
run: multi-gitter version

- name: Enable disabled bump workflows in ZOSOpenTools org
run: multi-gitter --config ./cicd/multi-gitter-config run ./bulk-utils/enable_disabled_workflow.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/enable_disabled_workflow.yml.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Enable disabled workflow'

on:
schedule:
# minute hour dom month dow (UTC)
- cron: '00 00 2 * *'
# enable manual trigger of version updates
workflow_dispatch:

jobs:
multi-gitter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: ./actions/multi-gitter-action

- name: Print version
run: multi-gitter version

- name: Enable disabled bump workflows in ZOSOpenTools org
run: multi-gitter --config ./cicd/multi-gitter-config run ./bulk-utils/enable_disabled_workflow.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .github/workflows/jenkins-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
- created
pull_request_target:
types: [opened, synchronize, reopened]
paths-ignore:
- 'cicd*.groovy'
- '**/LICENSE'
- 'docs/**'
- 'README.md'
workflow_dispatch:

jobs:
Expand Down
55 changes: 15 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
# UPDATE: New zopen framework is now available!

Get the new zopen framework [here](https://github.com/ZOSOpenTools/meta/releases).

**Note:** The new zopen package manager is not compatible with previous versions of zopen. Migration involves creating a new directory structure for zopen tools. This is accomplished via the `zopen init` command, documented below.

## Before you migrate

* Identify the tools you have already installed. Use `zopen install --list`.
* If you plan to reuse the existing zopen root directory for installing the new tools, then make sure to back it up to a different directory.
* Follow the steps below and install each of the tools again via `zopen install`

---

# Meta - Introducing the zopen package manager

Meta adds package management facilities to z/OS, via `zopen`. It is similar to utilities like apt, dpkg, yum, yast2, and emerge. It is written as a pure shell script to remove any prerequisites (like python/perl/bash etc).
This package manager is designed for everyday usage of the z/OS Open Tools ports within the z/OS UNIX environment or for those who wish to download the tools.

**Download** the latest zopen package manager [here](https://github.com/ZOSOpenTools/metaport/releases).

## Pre-config

It is advised to have the following set on the system to ensure correct operation:
Expand All @@ -31,32 +19,9 @@ export _TAG_REDIR_OUT=txt

Make sure the character device `/dev/tty` is untagged or you may experience unexpected behaviour. Run `chtag -r /dev/tty` to remove any tags.

## Installation

* Download the meta pax to a suitable location (for example /tmp).
* Expand the pax using the command `pax -rvf <filename>.pax`. This will expand the pax to the current directory, listing the various included files as it does so.
* From the `meta-<ver>` directory run the following command, answering the questions appropriately:

```bash
. ./.env
zopen init
```

You can now safely remove `meta-<version>.pax.Z` and the extracted `meta-<version>` directory
## Installation and sample usage

## Sample usage

```bash
. ./.env # Source the .env from meta
zopen init
. <zopen_root_path>/etc/zopen-config
zopen list --installed
zopen install which
zopen list --installed
which which
zopen upgrade
zopen install git vim # install both git and vim
```
Start with [quick start guide](https://zosopentools.org/#/Guides/QuickStart?id=getting-the-zopen-package-manager).

## Important usage notes

Expand Down Expand Up @@ -127,7 +92,7 @@ zopen list [--installed]
With no parameters, will list the available packages against the currently installed versions; more usefully, using the `--installed` parameter lists the actually locally-installed packages rather than all potential packages

```bash
zopen search <package>
zopen query --remote-search <package>
```

Searches the remote repository for the specified package, returning appropriate meta-data about the package if found.
Expand All @@ -138,6 +103,16 @@ zopen query <option>

Queries the local z/OS Open Tools system. See `---help` for more details.

## Migrating from zopen version <0.8.0
**Note:** The new zopen package manager is not compatible with previous versions of zopen. Migration involves creating a new directory structure for zopen tools. This is accomplished via the `zopen init` command, documented below.

### Before you migrate

* Identify the tools you have already installed. Use `zopen install --list`.
* If you plan to reuse the existing zopen root directory for installing the new tools, then make sure to back it up to a different directory.
* Follow the steps below and install each of the tools again via `zopen install`


### Useful resources

* View the z/OS Open Tools project home: https://github.com/ZOSOpenTools
Expand Down
37 changes: 37 additions & 0 deletions actions/multi-gitter-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Setup multi-gitter"
author: Yevhen Fabizhevskyi
description: "This action installs multi-gitter CLI tool."
branding:
icon: terminal
color: gray-dark
inputs:
version:
description: "multi-gitter version."
required: false
default: "latest"
runs:
using: "composite"
steps:
- name: Collect info
id: info
run: |
MULTI_GITTER_INSTALLED=$(if command -v multi-gitter >/dev/null 2>&1; then echo true; else echo false; fi)
echo "MULTI_GITTER_INSTALLED=${MULTI_GITTER_INSTALLED}" >> "$GITHUB_OUTPUT"
multi_gitter_path="${GITHUB_WORKSPACE}/multi-gitter"
mkdir -p "${multi_gitter_path}"
echo "MULTI_GITTER_PATH=${multi_gitter_path}" >> "$GITHUB_OUTPUT"
shell: sh

- name: Install multi-gitter
if: ${{ steps.info.outputs.MULTI_GITTER_INSTALLED == 'false' }}
env:
BINDIR: "${{ steps.info.outputs.MULTI_GITTER_PATH }}"
MULTI_GITTER_VERSION: "${{ inputs.version}}"
run: |
if [ "${MULTI_GITTER_VERSION}" = "latest" ]; then
curl -s https://raw.githubusercontent.com/lindell/multi-gitter/master/install.sh | sh
else
curl -s https://raw.githubusercontent.com/lindell/multi-gitter/master/install.sh | sh -s -- -d "v${MULTI_GITTER_VERSION}"
fi
echo "${{ steps.info.outputs.MULTI_GITTER_PATH }}" >> $GITHUB_PATH
shell: sh
45 changes: 26 additions & 19 deletions bin/zopen
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,38 @@ ${ME} is a utility for managing a z/OS Open Tools environment.
Usage: ${ME} [COMMAND] [OPTION] [PARAMETERS]...
Command:
alt manage alternate versions of z/OS Open Tools packages.
build builds the enclosing z/OS Open Tools git-cloned package.
clean cleans up your zopen environment.
generate generates a new zopen project.
init initializes a zopen environment at the specified location.
install installs one or more z/OS Open Tools packages.
list lists information about z/OS Open Tools packages.
query list local or remote info about z/OS Open Tools packages.
remove removes installed z/OS Open Tools packages.
update-cacert update the cacert.pem file used by z/OS Open Tools.
upgrade upgrades existing z/OS Open Tools packages.
alt manage alternate versions of z/OS Open Tools packages
audit (beta) reports known vulnerabilities for the installed packages
build builds the enclosing z/OS Open Tools git-cloned package
clean cleans up your zopen environment
config change zopen runtime environment settings
generate generates a new zopen project
init initializes a zopen environment at the specified location
install installs one or more z/OS Open Tools packages
list lists information about z/OS Open Tools packages
query list local or remote info about z/OS Open Tools packages
remove removes installed z/OS Open Tools packages
update-cacert update the cacert.pem file used by z/OS Open Tools
upgrade upgrades existing z/OS Open Tools packages
Options:
-h, --help, -? display this help and exit.
-v, --verbose run in verbose mode.
-h, --help, -? display this help and exit
-v, --verbose run in verbose mode
Examples:
zopen --help displays zopen help.
zopen --version displays the installed zopen version.
zopen install git install the latest z/OS Open Tools git package.
zopen --help displays zopen help
zopen --version displays the installed zopen version
zopen install git install the latest version of the 'git' package
zopen upgrade -y upgrade all installed packages to the latest release,
without prompting.
zopen alt bash list installed alternative bash z/OS Open Tools packages.
without prompting
zopen alt bash list installed alternative bash packages
SEE ALSO:
zopen-alt(1)
zopen-audit(1)
zopen-build(1)
zopen-clean(1)
zopen-config-helper(1)
zopen-generate(1)
zopen-init(1)
zopen-install(1)
Expand All @@ -79,7 +83,7 @@ version=false

for arg in $*; do
case "${arg}" in
"alt"|"build"|"clean"|"generate"|"init"|"install"|\
"alt"|"audit"|"build"|"clean"|"generate"|"init"|"install"|\
"query"|"remove"|"update-cacert")
subcmd="zopen-${arg}"
;;
Expand All @@ -91,6 +95,9 @@ for arg in $*; do
subcmd='zopen-install'
subopts="${subopts} -u"
;;
"config")
subcmd="zopen-${arg}-helper"
;;
"--version")
version=true
;;
Expand Down
Loading

0 comments on commit de35f31

Please sign in to comment.