Skip to content

Commit

Permalink
Merge pull request #26 from CoffeeITWorks/develop
Browse files Browse the repository at this point in the history
migrate to github actions, improve tests for dev and stable, new OS support
  • Loading branch information
pablodav authored May 30, 2021
2 parents 4646f19 + dbc0e03 commit eada92f
Show file tree
Hide file tree
Showing 44 changed files with 545 additions and 245 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/galaxy-notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
name: Molecule release
on:
push:
branches:
- "master"
# Sequence of patterns matched against refs/tags
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
molecule:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Better to use one scenario per OS for faster performance and easier debugging
scenario:
# - centos-8
- ubuntu-2004
steps:

- name: Checkout
uses: actions/checkout@v2
with:
path: "${{ github.repository }}"

- name: Molecule converge
uses: gofrolist/molecule-action@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: converge
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: Molecule syntax
uses: gofrolist/molecule-action@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: syntax
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: Molecule idempotence
uses: gofrolist/molecule-action@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: idempotence
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

# https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
# Don't forget to add the secret galaxy_api_key in your repository
release:
runs-on: ubuntu-latest
needs:
- molecule
steps:
- name: galaxy
uses: robertdebock/[email protected]
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
59 changes: 59 additions & 0 deletions .github/workflows/molecule-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Molecule pipeline test

on:
push:
branches-ignore:
- "master"
tags-ignore:
- "*"
pull_request:
pull_request_review:

jobs:
molecule:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Better to use one scenario per OS for faster performance and easier debugging
scenario:
- centos-8
- ubuntu-2004
- stable-ubuntu-1804
steps:

- name: Checkout
uses: actions/checkout@v2
with:
path: "${{ github.repository }}"

- name: Molecule converge
uses: gofrolist/molecule-action@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: converge
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: Molecule syntax
uses: gofrolist/molecule-action@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: syntax
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: Molecule idempotence
uses: gofrolist/molecule-action@v2
with:
molecule_options: --debug --base-config molecule/_shared/base.yml
molecule_command: idempotence
# Always specify scenario and don't use default for better different use cases
molecule_args: --scenario-name ${{ matrix.scenario }}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
26 changes: 16 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Created by .ignore support plugin (hsz.mobi)
### Ansible template
*.retry
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
.idea/dataSources/
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
Expand Down Expand Up @@ -45,13 +45,19 @@ crashlytics.properties
crashlytics-build.properties
fabric.properties

.idea/ansible_burpui_server.iml
.idea/markdown-navigator.xml
.idea/markdown-navigator/
.idea/misc.xml
.idea/modules.xml
# vagrant
.vagrant

.kdev4
# molecule
.molecule

# jetbrains
.idea

# kdevelop
*.kdev4
.kdev4

.molecule
# VSCode
.vscode
.cache
6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ install:
#- ansible-galaxy install -r requirements.yml

script:
- molecule --debug create
- molecule converge
- molecule syntax
- molecule --debug create -s default
- molecule converge -s default
- molecule syntax -s default
#- molecule idempotence

notifications:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2.0.0:
* Remove python2 support
* Update tests to github actions
* support ubuntu 2004
* no more support for old OS versions

1.8.1:
* update to molecule 3 and fix gevent install
1.8.0:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/CoffeeITWorks/ansible_burpui_server.svg?branch=master)](https://travis-ci.org/CoffeeITWorks/ansible_burpui_server)
[![Molecule pipeline test](https://github.com/CoffeeITWorks/ansible_burpui_server/actions/workflows/molecule-test.yml/badge.svg)](https://github.com/CoffeeITWorks/ansible_burpui_server/actions/workflows/molecule-test.yml)

Getting Started
================
Expand Down
22 changes: 0 additions & 22 deletions circle.yml

This file was deleted.

56 changes: 44 additions & 12 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ burpui_use_dev: False

burpui_pip_burpui: "burp-ui"
burpui_version: 0.6.6
python_pip_executable: "pip3" # options pip3 / pip2
python_pip_executable: "pip3" # pip3 only supported option

burpui_pip_packages:
- { name: "{{ burpui_pip_burpui }}", version: "{{ burpui_version }}" }
Expand All @@ -18,22 +18,54 @@ burpui_pip_packages:
- { name: "{{ burpui_pip_burpui }}[celery]", version: "{{ burpui_version }}" }
- { name: "{{ burpui_pip_burpui }}[websocket]", version: "{{ burpui_version }}" }

# https://git.ziirish.me/ziirish/burp-ui/-/blob/master/requirements.txt
burpui_pip_dev_present:
#- "cryptography"
- "redis==3.5.3"
#- "Flask-Migrate"
- "celery>=5.1.0"
- "cffi>=1.14.5"
- "gevent>=21.1.2"
- "ujson>=1.35"
- "urllib3>=1.19" # required to avoid issues with get_url module
# - "ndg-httpsclient>=0.4.2" # required to avoid issues with get_url module
- "pyasn1==0.4.8"
#- "six>=1.10.0" # try to fix error in dependencies with requests[security]
- "requests[security]>=2.12" # required to avoid issues with get_url module
- "Flask-Limiter==1.4"
- trio>=0.18.0
- Flask>=1.1.2
- Flask-Login>=0.5.0
- Flask-Bower>=1.3.0
- Flask-Babel>=2.0.0
- Flask-WTF>=0.14.3
- flask-restx>=0.3.0
- Flask-Caching>=1.10.1
- Flask-Session>=0.3.2
- WTForms>=2.3.3
- arrow>=0.14.2
- pluginbase>=1.0.0
- tzlocal>=2.1
- pyOpenSSL>=20.0.1
- configobj>=5.0.6
- async_generator>=1.10
- Click>=7.1.2

burpui_pip_present:
- "cryptography"
- "redis"
- "Flask-Session"
- "Flask-Migrate"
- "celery>=4.0.2"
- "cffi>=1.7"
- "gevent>=20.0.5"
#- "cryptography"
- "redis==3.5.3"
#- "Flask-Migrate"
- "celery>=5.1.0"
- "cffi>=1.14.5"
- "gevent>=21.1.2"
- "ujson>=1.35"
- "urllib3>=1.19" # required to avoid issues with get_url module
# - "ndg-httpsclient>=0.4.2" # required to avoid issues with get_url module
- "pyasn1"
- "six>=1.10.0" # try to fix error in dependencies with requests[security]
- "pyasn1==0.4.8"
#- "six>=1.10.0" # try to fix error in dependencies with requests[security]
- "requests[security]>=2.12" # required to avoid issues with get_url module
- "flask-limiter"


burpui_nginx_port: "8080"
# This is to check availability and nginx template as reverse proxy
burpui_global_port: "5000"
Expand Down
File renamed without changes.
12 changes: 12 additions & 0 deletions molecule/centos-8/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- name: Converge
hosts: all
vars:
burpui_standalone: True
burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui'
burpui_use_dev: True
roles:
# - role: coffeeitworks.burp2_server
- role: ansible_burpui_server
tags:
- burpui-server
34 changes: 34 additions & 0 deletions molecule/centos-8/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
dependency:
name: galaxy
options:
ignore-certs: True
ignore-errors: True
role-file: dev_requirements.yml # this file is at the root of the git project same place as molecule is executed
driver:
name: docker
platforms:

- name: ansible_burpui_server-04
image: "geerlingguy/docker-centos8-ansible"
command: /sbin/init
privileged: True
pre_build_image: true
capabilities:
- SYS_ADMIN
tmpfs:
- /run
- /tmp
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
groups:
- use_pip_package

provisioner:
name: ansible
config_options:
defaults:
callback_whitelist: profile_tasks
ssh_connection:
pipelining: true
ssh_args: -o ControlMaster=auto -o ControlPersist=60s
9 changes: 9 additions & 0 deletions molecule/centos-8/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.

- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true
16 changes: 0 additions & 16 deletions molecule/default/INSTALL.rst

This file was deleted.

4 changes: 2 additions & 2 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
hosts: all
vars:
burpui_standalone: True
burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@stable#egg=burp-ui'
#burpui_use_dev: True # now in molecule.yml inventory group_vars
burpui_pip_burpui_dev: 'git+https://git.ziirish.me/ziirish/burp-ui.git@master#egg=burp-ui'
burpui_use_dev: True
roles:
- role: coffeeitworks.burp2_server
- role: ansible_burpui_server
Expand Down
Loading

0 comments on commit eada92f

Please sign in to comment.