Skip to content

Commit

Permalink
Revert "Fix assignee"
Browse files Browse the repository at this point in the history
  • Loading branch information
sidpremkumar committed Feb 19, 2021
1 parent 7ff61b1 commit 9696cc5
Show file tree
Hide file tree
Showing 76 changed files with 9,393 additions and 295 deletions.
10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]
branch = True
source = sync2jira/

[report]
omit =
sync2jira/mailer.py
continuous-deployment/continuous_deployment.py

fail_under = 70
33 changes: 33 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Run Tox

# yamllint disable rule:truthy
on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run Tox tests
id: test
uses: fedora-python/tox-github-action@master
with:
tox_env: py39,lint
# Same list of packages in Dockerfile
dnf_install: >-
--repo fedora --repo updates
python3-requests
python3-jira
python3-fedmsg-core
python3-pygithub
python3-jinja2
python3-pypandoc
python3-requests-kerberos
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM fedora:latest
LABEL \
name="sync2jira" \
description="sync2jira application" \
vendor="sync2jira developers" \
license="GPLv2+" \
build-date=""

# Installing sync2jira dependencies
RUN dnf -y install \
git \
python3-pip \
python3-requests \
python3-jira \
python3-fedmsg-core \
python3-pygithub \
python3-jinja2 \
python3-pypandoc \
python3-requests-kerberos \
&& dnf -y clean all

ARG SYNC2JIRA_GIT_REPO=https://github.com/release-engineering/Sync2Jira.git
ARG SYNC2JIRA_GIT_REF=master
ARG SYNC2JIRA_CACERT_URL=
ARG SYNC2JIRA_VERSION=
ENV SYNC2JIRA_VERSION=$SYNC2JIRA_VERSION
ENV SYNC2JIRA_CACERT_URL=$SYNC2JIRA_CACERT_URL

USER root

# Create Sync2Jira folder
RUN mkdir -p /usr/local/src/sync2jira

# Copy over our repo
COPY . /usr/local/src/sync2jira

# Install Sync2Jira
RUN pip3 install --no-deps -v /usr/local/src/sync2jira

# To deal with JIRA issues (i.e. SSL errors)
RUN chmod g+w /etc/pki/tls/certs/ca-bundle.crt
RUN chmod 777 /usr/local/src/sync2jira/openshift/docker-entrypoint.sh

USER 1001

ENTRYPOINT ["/usr/local/src/sync2jira/openshift/docker-entrypoint.sh"]

CMD ["/usr/local/bin/sync2jira"]
62 changes: 62 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM fedora:latest
LABEL \
name="sync2jira" \
description="sync2jira application" \
vendor="sync2jira developers" \
license="GPLv2+" \
build-date=""

# Installing sync2jira dependencies
RUN dnf -y install \
git \
python3-pip \
python3-requests \
python3-jira \
python3-fedmsg-core \
python3-pygithub \
python3-jinja2 \
python3-pypandoc \
python3-requests-kerberos \
&& dnf -y clean all

ARG SYNC2JIRA_GIT_REPO=https://github.com/release-engineering/Sync2Jira.git
ARG SYNC2JIRA_GIT_REF=master
ARG SYNC2JIRA_CACERT_URL=
ARG SYNC2JIRA_VERSION=
ENV SYNC2JIRA_VERSION=$SYNC2JIRA_VERSION
ENV SYNC2JIRA_CACERT_URL=$SYNC2JIRA_CACERT_URL

USER root

# Create Sync2Jira folder
RUN mkdir -p /usr/local/src/sync2jira

# Copy over our repo
COPY . /usr/local/src/sync2jira

# To deal with JIRA issues (i.e. SSL errors)
RUN chmod g+w /etc/pki/tls/certs/ca-bundle.crt
RUN chmod 777 /usr/local/src/sync2jira/openshift/docker-entrypoint.sh


USER 1001

ENTRYPOINT ["/usr/local/src/sync2jira/openshift/docker-entrypoint.sh"]

# OpenShift-Build Related
USER root
RUN chmod 777 /usr/local/src/sync2jira/openshift-build
RUN dnf -y install nodejs
RUN npm --prefix /usr/local/src/sync2jira/openshift-build/ install

# Install Sync2Jira once
RUN mkdir -p /usr/local/src/sync2jira/openshift-build/temp \
&& git clone ${SYNC2JIRA_GIT_REPO} /usr/local/src/sync2jira/openshift-build/temp \
&& cd usr/local/src/sync2jira/openshift-build/temp \
&& python3 setup.py develop \
&& mkdir -p /usr/local/src/sync2jira/openshift-build/temp \
&& chgrp -R 0 /usr/local/src/sync2jira/openshift-build/temp \
&& chmod -R 777 /usr/local/src/sync2jira/openshift-build/temp

USER 1001
CMD ["npm", "--prefix", "/usr/local/src/sync2jira/openshift-build/", "start"]
53 changes: 53 additions & 0 deletions Dockerfile.deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM fedora:latest
LABEL \
name="sync2jira" \
description="sync2jira application" \
vendor="sync2jira developers" \
license="GPLv2+" \
build-date=""

# Installing sync2jira dependencies
RUN dnf -y install \
git \
python3-pip \
python3-requests \
python3-jira \
python3-fedmsg-core \
python3-pygithub \
python3-jinja2 \
python3-pypandoc \
&& dnf -y clean all

ARG SYNC2JIRA_GIT_REPO=https://github.com/release-engineering/Sync2Jira.git
ARG SYNC2JIRA_GIT_REF=master
ARG SYNC2JIRA_CACERT_URL=
ARG SYNC2JIRA_VERSION=
ENV SYNC2JIRA_VERSION=$SYNC2JIRA_VERSION
ENV SYNC2JIRA_CACERT_URL=$SYNC2JIRA_CACERT_URL

USER root

# Create Sync2Jira folder
RUN mkdir -p /usr/local/src/sync2jira

# Copy over our repo
COPY . /usr/local/src/sync2jira

# We also need to install requests_kerberos
RUN dnf -y install python3-requests-kerberos

# Install Sync2Jira
RUN pip3 install --no-deps -v /usr/local/src/sync2jira

# To deal with JIRA issues (i.e. SSL errors)
RUN chmod g+w /etc/pki/tls/certs/ca-bundle.crt
RUN chmod 777 /usr/local/src/sync2jira/openshift/docker-entrypoint.sh

# Continuous Deployment Info
ARG RCM_TOOLS_REPO
RUN chmod 777 /usr/local/src/sync2jira/continuous-deployment/install_rhmsg.sh
RUN ./usr/local/src/sync2jira/continuous-deployment/install_rhmsg.sh $RCM_TOOLS_REPO

USER 1001
ENTRYPOINT ["/usr/local/src/sync2jira/openshift/docker-entrypoint.sh"]
CMD ["python3", "/usr/local/src/sync2jira/continuous-deployment/continuous_deployment.py"]
49 changes: 49 additions & 0 deletions Dockerfile.sync-page
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM fedora:latest
LABEL \
name="sync2jira" \
description="sync2jira application" \
vendor="sync2jira developers" \
license="GPLv2+" \
build-date=""

# Installing sync2jira dependencies
RUN dnf -y install \
git \
python3-pip \
python3-requests \
python3-jira \
python3-fedmsg-core \
python3-pygithub \
python3-jinja2 \
python3-pypandoc \
python3-requests-kerberos \
python3-flask \
&& dnf -y clean all

ARG SYNC2JIRA_GIT_REPO=https://github.com/release-engineering/Sync2Jira.git
ARG SYNC2JIRA_GIT_REF=master
ARG SYNC2JIRA_CACERT_URL=
ARG SYNC2JIRA_VERSION=
ENV SYNC2JIRA_VERSION=$SYNC2JIRA_VERSION
ENV SYNC2JIRA_CACERT_URL=$SYNC2JIRA_CACERT_URL

USER root

# Create Sync2Jira folder
RUN mkdir -p /usr/local/src/sync2jira

# Copy over our repo
COPY . /usr/local/src/sync2jira

# Install Sync2Jira
RUN pip3 install --no-deps -v /usr/local/src/sync2jira

# To deal with JIRA issues (i.e. SSL errors)
RUN chmod g+w /etc/pki/tls/certs/ca-bundle.crt
RUN chmod 777 /usr/local/src/sync2jira/openshift/docker-entrypoint.sh

USER 1001

ENTRYPOINT ["/usr/local/src/sync2jira/openshift/docker-entrypoint.sh"]

CMD ["python3", "/usr/local/src/sync2jira/sync-page/event-handler.py"]
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include LICENSE
include README.md
include fedmsg.d/sync2jira.py
include requirements.txt
include test-requirements.txt
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Webhook Sync2Jira
# Sync2Jira

This is a fork of [this](https://github.com/release-engineering/Sync2Jira/tree/master/sync2jira) version of Sync2Jira that aims to use GitHub webhook instead of relying on the Fed Message Bus. This was created as the original Sync2Jira did not support private repos, which was something that we needed for our application.
[![Documentation Status](https://readthedocs.org/projects/sync2jira/badge/?version=master)](https://sync2jira.readthedocs.io/en/master/?badge=master)
[![Docker Repository on Quay](https://quay.io/repository/redhat-aqe/sync2jira/status "Docker Repository on Quay")](https://quay.io/repository/redhat-aqe/sync2jira)
[![Build Status](https://travis-ci.org/release-engineering/Sync2Jira.svg?branch=master)](https://travis-ci.org/release-engineering/Sync2Jira)
[![Coverage Status](https://coveralls.io/repos/github/release-engineering/Sync2Jira/badge.svg?branch=master)](https://coveralls.io/github/release-engineering/Sync2Jira?branch=master)
![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)
## What is Sync2Jira?
This is a process that listens to activity on upstream repos on pagure and
github via fedmsg, and syncs new issues there to a Jira instance elsewhere.

Similar documentation can be found [here](https://sync2jira.readthedocs.io/en/master/quickstart.html).

## Documentation
Documentation is hosted on ReadTheDocs.io and can be found [here](https://sync2jira.readthedocs.io/en/latest/)

## Configuration

We have set up a quick-start [here](https://sync2jira.readthedocs.io/en/master/quickstart.html)

Configuration is in `fedmsg.d/`.

You can maintain a mapping there that allows you to match one upstream repo (say, 'pungi' on pagure) to a downstream project/component pair in Jira (say, 'COMPOSE', and 'Pungi').

On startup, if the initialize option is set to True in the fedmsg.d/ config, then all open issues from all upstream repos will be scraped and added to Jira if they are absent.

If the testing option is set to True, then the script will perform a "dry run" and not actually add any new issues to Jira.

Please look at our documentation [here](https://sync2jira.readthedocs.io/en/master/config-file.html) for a full list of what can be synced and how to set it up.

## Branches

We will maintain three branches

1. `master` - This will be where our main code and most up to date code lives
1. `stage` - This will be our staging configuration. PR's will merge through stage to master
1. `openshift-build` - This branch will maintain OpenShift-Build related information
37 changes: 0 additions & 37 deletions config/config.json

This file was deleted.

8 changes: 8 additions & 0 deletions continuous-deployment/continuous-deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Continuous Deployment

## TLDR
We use a message bus configured to listen to a topic pushed by [RepoTracker](https://github.com/release-engineering/repotracker). Once we find a message that indicates a change in any of the branches we're watching, we tag the new image in OpenShift which triggers a new deployment.


## Where can I learn more?
You can check our documentation [here](https://sync2jira.readthedocs.io/en/latest/continuous_deployment.html) to learn more about how to configure this feature in your project.
Loading

0 comments on commit 9696cc5

Please sign in to comment.