Skip to content

Commit 67cecfc

Browse files
committed
CCS-3957: Update deployment pipeline. Creating new repos for uploader and service.
0 parents  commit 67cecfc

File tree

7 files changed

+823
-0
lines changed

7 files changed

+823
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Uploader
2+
Uploader is a Python package that can be used to upload repositories to Pantheon 2.
3+
## Setting up for uploading from local machine
4+
1. Make setup_uploader.sh executable.
5+
`chmod +x install.sh`
6+
2. Run setup_uploader.sh
7+
`./install.sh`
8+
9+
3. Follow the instructions, if any.

install.sh

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/bash
2+
3+
# Variables
4+
UPLOADER_HOME=~/.pantheon
5+
PANTHEON_BIN=~/bin/pantheon
6+
7+
# Create UPLOADER_HOME directory if not exists
8+
if [ ! -d "$UPLOADER_HOME" ]; then
9+
echo "Creating UPLOADER_HOME directory: $UPLOADER_HOME"
10+
mkdir -p $UPLOADER_HOME
11+
fi
12+
13+
# Download the uploader script to $UPLOADER_HOME
14+
echo "Downloading the uploader script to $UPLOADER_HOME"
15+
curl -o ${UPLOADER_HOME}/pantheon.py https://raw.githubusercontent.com/redhataccess/uploader/master/uploader/pantheon.py
16+
curl -o ${UPLOADER_HOME}/requirements.txt https://raw.githubusercontent.com/redhataccess/uploader/master/requirements.txt
17+
18+
pip3 install --user -r ${UPLOADER_HOME}/requirements.txt
19+
20+
# Ensure file is executable
21+
echo "Ensure uploader script is executable"
22+
chmod +x ${UPLOADER_HOME}/pantheon.py
23+
24+
#Creating ~/bin directory if not exists
25+
if [ ! -d ~/bin ]; then
26+
echo "Creating ~/bin directory"
27+
mkdir -p ~/bin
28+
fi
29+
30+
# Create a symlink to ~/bin/pantheon if not exists
31+
if [ ! -h "$PANTHEON_BIN" ]; then
32+
echo "Creating a symlink to $PANTHEON_BIN"
33+
ln -s ${UPLOADER_HOME}/pantheon.py $PANTHEON_BIN
34+
fi
35+
36+
# Show full path for pantheon command
37+
echo
38+
echo "UPLOADER_HOME: $UPLOADER_HOME"
39+
echo "Pantheon command path: "
40+
which pantheon
41+
42+
if [[ $(which pantheon) = $PANTHEON_BIN ]]; then
43+
echo "Set up completed!"
44+
fi
45+
echo

requirements.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
setuptools~=49.2.0
2+
argparse~=1.4.0
3+
requests~=2.22.0
4+
PyYAML~=5.3.1
5+
redis~=3.5.3

setup.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from setuptools import setup, find_packages
2+
3+
entry_points = {
4+
'console_scripts': [
5+
'pantheon1 = uploader.pantheon:main'
6+
]
7+
}
8+
9+
if __name__ == "__main__":
10+
setup(
11+
name='uploader',
12+
version='0.2',
13+
packages=find_packages(),
14+
url='',
15+
license='',
16+
author='Red Hat, Inc.',
17+
author_email='',
18+
description='Uploads modular documents to Pantheon',
19+
install_requires=[
20+
'argparse',
21+
'requests',
22+
'PyYAML',
23+
'redis'
24+
],
25+
entry_points=entry_points
26+
)

uploader/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)