-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
script for linux installation #63
Open
Levi-Leah
wants to merge
4
commits into
main
Choose a base branch
from
installation-script-for-linux
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
Pantheon CMD is a Python-based command-line tool that allows you to generate a rendered preview of modular documentation using the new HAML templates. | ||
|
||
Installing Pantheon CMD using RPM allows you to perform actions using the predefined aliases such as: | ||
Installing Pantheon CMD using RPM allows you to perform actions using the predefined aliases such as: | ||
* `pcmd validate` | ||
* `pcmd build` | ||
* `pcmd preview` | ||
|
@@ -24,58 +24,23 @@ A script used to package the script as an RPM-based package that can be installe | |
**PantheonCMD** | ||
A directory containing the source files for the script, and the man page file. | ||
|
||
## Updating the Script | ||
All additions and updates to the script are welcome. | ||
|
||
## Packaging the Script | ||
## Packaging and Installing Pantheon CMD on RHEL and Fedora | ||
After you update Pantheon CMD and test the changes, build an RPM-based package for the script to be installed on systems that use *yum* or *dnf*. | ||
|
||
* Prerequisites: | ||
* A user has registered their SSH keys with GitHub. | ||
|
||
1. Install the `svn` and `rpmbuild` packages on your system: | ||
```shell | ||
# on RHEL | ||
$ sudo yum install subversion | ||
$ sudo yum install rpm-build | ||
|
||
# on Fedora | ||
$ sudo dnf install subversion | ||
$ sudo dnf install rpm-build | ||
``` | ||
2. Clone this repository. | ||
1. Clone this repository. | ||
```shell | ||
$ git clone [email protected]:redhataccess/pantheon-cmd.git | ||
``` | ||
3. Open *./build/pantheon-cmd.spec*. | ||
4. Increment the value of the *Release* number. | ||
As an example, `Release: 1%{?dist}` increments the version of the build to `1.0.1`, where `{?dist}` identifies of your Linux distribution. | ||
5. Run the build script: | ||
```shell | ||
$ sh make.sh 1.0 | ||
``` | ||
As a result, the `build/pantheon-cmd-1.0-X.<your-distribution-and-version>.noarch.rpm` file is generated in the root of the repository. This file will be used in the following step. | ||
|
||
## Installing Pantheon CMD | ||
|
||
Install Pantheon CMD on a local system. | ||
|
||
## Installing Pantheon CMD on RHEL and Fedora | ||
|
||
Install the RPM and all Ruby gem dependencies. | ||
|
||
1. Install the RPM: | ||
```shell | ||
$ sudo dnf localinstall build/pantheon-cmd-1.0-X.el8.noarch.rpm | ||
``` | ||
Note that your `rpm` filename might differ based on your Linux distribution. | ||
* Example: | ||
* `el8` for RHEL 8 | ||
* `fc34` for Fedora 34 | ||
|
||
2. Install Ruby gem dependencies: | ||
2. Navigate to the `pantheon-cmd` directory: | ||
```shell | ||
$ cd pantheon-cmd | ||
``` | ||
3. Run the `linux-cmd-intallation.sh` packaging and installation script: | ||
```shell | ||
$ sudo gem install asciidoctor concurrent-ruby haml tilt | ||
$ sh linux-cmd-intallation.sh | ||
``` | ||
|
||
The script is installed on your local machine. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# Error handling | ||
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG | ||
terminate() | ||
{ | ||
echo >&2 ' | ||
*** terminated *** | ||
' | ||
echo "\"$last_command\" command failed with exit code $?." | ||
exit 1 | ||
} | ||
|
||
trap 'terminate' 0 | ||
|
||
set -e | ||
|
||
# clone repo | ||
|
||
# install required packages | ||
sudo dnf install subversion | ||
sudo dnf install rpm-build | ||
|
||
|
||
if [[ $(basename "$PWD") = "pantheon-cmd" ]]; then | ||
release_number=$(grep -o -P '(?<=Release: ).*(?=%{)' build/pantheon-cmd.spec) | ||
incremented_release_number=$((release_number+1)) | ||
else | ||
echo "Navigate to the pantheon-cmd directory." | ||
exit 2 | ||
fi | ||
|
||
sh make.sh $incremented_release_number | ||
|
||
# install dependencies | ||
sudo gem install asciidoctor concurrent-ruby haml tilt | ||
|
||
sudo dnf install build/pantheon-cmd-*.noarch.rpm | ||
|
||
trap : 0 | ||
|
||
echo >&2 ' | ||
*** DONE *** | ||
' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a one-liner, perhaps?
E.g. sudo dnf install subversion rpm-build