This repository has been archived by the owner on May 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from marusinm/github-app
release-bot as a GitHub Application
- Loading branch information
Showing
29 changed files
with
460 additions
and
623 deletions.
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 |
---|---|---|
|
@@ -15,4 +15,8 @@ __pycache__/ | |
# Editors and IDEs | ||
.idea/ | ||
.vscode/ | ||
.DS_Store | ||
|
||
dump.rdb | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
FROM registry.fedoraproject.org/fedora:30 | ||
|
||
ENV LANG=en_US.UTF-8 | ||
# nicer output from the playbook run | ||
ENV ANSIBLE_STDOUT_CALLBACK=debug | ||
# Ansible doesn't like /tmp | ||
COPY files/ /src/files/ | ||
|
||
USER 0 | ||
|
||
RUN mkdir /home/release-bot && chmod 0776 /home/release-bot | ||
|
||
# Install packages first and reuse the cache as much as possible | ||
RUN dnf install -y ansible \ | ||
&& cd /src/ \ | ||
&& ansible-playbook -vv -c local -i localhost, files/install-rpm-packages.yaml \ | ||
&& dnf clean all | ||
|
||
COPY setup.py setup.cfg files/recipe.yaml /src/ | ||
# setuptools-scm | ||
COPY .git /src/.git | ||
COPY release_bot/ /src/release_bot/ | ||
|
||
RUN cd /src/ \ | ||
&& ansible-playbook -vv -c local -i localhost, files/recipe.yaml | ||
|
||
|
||
USER 1001 | ||
ENV USER=release-bot | ||
ENV HOME=/home/release-bot | ||
|
||
CMD ["release-bot -c /home/release-bot/.config/conf.yaml"] |
This file was deleted.
Oops, something went wrong.
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
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
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,5 @@ | ||
[user] | ||
name = Release Bot | ||
email = [email protected] | ||
[push] | ||
default = current |
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,26 @@ | ||
--- | ||
- name: Install dependencies for release-bot | ||
hosts: all | ||
tasks: | ||
- name: Install all RPM packages needed to run release-bot. | ||
dnf: | ||
name: | ||
- python3-flask | ||
- python3-ipdb # for easy debugging | ||
- python3-jsonschema | ||
- python3-ogr | ||
- python3-pip | ||
- python3-pyyaml | ||
- python3-requests | ||
- python3-setuptools | ||
- python3-setuptools_scm | ||
- python3-setuptools_scm_git_archive | ||
- python3-wheel # for bdist_wheel | ||
- python3-celery | ||
- python3-cryptography | ||
- python3-jwt | ||
- python3-pystache | ||
- python3-redis | ||
- python3-semantic_version | ||
- twine | ||
state: present |
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,55 @@ | ||
--- | ||
- name: This is a recipe for how to cook with release-bot | ||
hosts: all | ||
vars: | ||
home_path: "{{ lookup('env', 'HOME') }}" | ||
ansible_bender: | ||
base_image: FROM registry.fedoraproject.org/fedora:30 | ||
#base_image: fedora:29 | ||
target_image: | ||
name: docker.io/usercont/release-bot | ||
environment: | ||
FLASK_APP: releasebot.service.web_hook | ||
cmd: flask-3 run -h 0.0.0.0 | ||
working_container: | ||
volumes: | ||
- '{{ playbook_dir }}:/src:Z' | ||
tasks: | ||
- name: Create some home dirs | ||
file: | ||
state: directory | ||
path: '{{ home_path }}/{{ item }}' | ||
mode: 0700 | ||
with_items: | ||
- .ssh | ||
- .config | ||
- name: Create /secrets | ||
file: | ||
state: directory | ||
path: /secrets | ||
mode: 0777 | ||
- name: Copy gitconfig | ||
copy: | ||
src: gitconfig | ||
dest: '{{ home_path }}/.gitconfig' | ||
- name: stat /src | ||
stat: | ||
path: /src | ||
tags: | ||
- no-cache | ||
register: src_path | ||
- name: Let's make sure /src is present | ||
assert: | ||
that: | ||
- 'src_path.stat.isdir' | ||
- name: Copy run.sh | ||
copy: | ||
src: run.sh | ||
dest: /usr/bin/run.sh | ||
mode: 0777 | ||
- name: Install release-bot from /src | ||
pip: | ||
name: /src | ||
executable: pip3 | ||
- name: Clean all the cache files (especially pip) | ||
shell: rm -rf ~/.cache/* |
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,6 @@ | ||
#!/usr/bin/bash | ||
|
||
export RELEASE_BOT_HOME=/home/release-bot | ||
|
||
exec release-bot -c /home/release-bot/.config/conf.yaml & | ||
exec celery -A release_bot.celery_task worker -l info |
Oops, something went wrong.