Skip to content

Commit

Permalink
Merge pull request #38 from splunk/develop
Browse files Browse the repository at this point in the history
Release 4.0.8
  • Loading branch information
Ryan Faircloth authored Oct 6, 2020
2 parents 2651dc8 + ce53df8 commit 6c26a0a
Show file tree
Hide file tree
Showing 50 changed files with 1,041 additions and 5,857 deletions.
157 changes: 150 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- checkout
- restore_cache:
keys:
- poetry-{{ checksum "poetry.lock" }}
- poetry-cache-{{ checksum "poetry.lock" }}
- restore_cache:
keys:
- npm-deps-{{ checksum "splunk_add_on_ucc_framework/UCC-UI-lib/package-lock.json" }}
Expand All @@ -32,9 +32,9 @@ jobs:
poetry run build-ucc
poetry build
- save_cache:
key: poetry-{{ checksum "poetry.lock" }}
key: poetry-cache-{{ checksum "poetry.lock" }}
paths:
- ~/.poetry
- ~/.cache/poetry
- save_cache:
paths:
- ~/.npm-global # location depends on npm version
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- checkout
- restore_cache:
keys:
- poetry-{{ checksum "poetry.lock" }}
- poetry-cache-{{ checksum "poetry.lock" }}
- restore_cache:
keys:
- npm-deps-{{ checksum "splunk_add_on_ucc_framework/UCC-UI-lib/package-lock.json" }}
Expand All @@ -92,7 +92,7 @@ jobs:
poetry run build-ucc
poetry publish --build -u $TWINE_USERNAME -p $TWINE_PASSWORD
- save_cache:
key: poetry-{{ checksum "poetry.lock" }}
key: poetry-cache-{{ checksum "poetry.lock" }}
paths:
- ~/.poetry
- save_cache:
Expand All @@ -111,6 +111,44 @@ jobs:
paths:
- dist
- output
tag:
parameters:
semtag:
type: string
docker:
- image: circleci/python:3.7
environment:
SEMTAG: "<< parameters.semtag >>"
steps:
- checkout
- add_ssh_keys:
fingerprints:
- "14:2e:73:04:b0:3d:21:7d:bb:c5:79:51:f9:52:b2:22"
- checkout
- run:
name: TAG
command: |
./semtag ${SEMTAG} -f
merge-beta-to-master:
docker:
- image: circleci/python:3.7
steps:
- checkout
- add_ssh_keys:
fingerprints:
- "7c:e9:cc:8d:8e:4d:9c:17:1d:e3:96:23:ce:bd:a4:c3"
- checkout
- run:
name: Merge
command: |
git config --global user.email "[email protected]"
git config --global user.name "Add on release service"
git pull origin master
git merge master -m "Merge from master"
git checkout master
git merge << pipeline.git.revision >>
git push
workflows:
version: 2
build_test:
Expand All @@ -119,11 +157,116 @@ workflows:
- test:
requires:
- build
build_release:
- approval-tag-alpha:
requires:
- test
type: approval
filters:
branches:
only: develop
- tag:
name: tag-alpha
requires:
- approval-tag-alpha
semtag: a
release:
jobs:
- publish:
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*/
only: /^v\d*\.\d*\.\d*.*$/
- approval-tag-beta:
requires:
- publish
type: approval
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*-a\..*$/
- tag:
name: tag-beta
semtag: b
requires:
- approval-tag-beta
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*-a\..*$/
- approval-merge-beta-to-master:
requires:
- publish
type: approval
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*-b\..*$/
- merge-beta-to-master:
requires:
- approval-merge-beta-to-master
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*-b\..*$/
- approval-tag-final-major:
type: approval
requires:
- merge-beta-to-master
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*-b\..*$/
- tag:
name: tag-final-major
semtag: "final -s major"
requires:
- approval-tag-final-major
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*-b\..*$/
- approval-tag-final-minor:
type: approval
requires:
- merge-beta-to-master
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*-b\..*$/
- tag:
name: tag-final-minor
semtag: "final -s minor"
requires:
- approval-tag-final-minor
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*-b\..*$/
- approval-tag-final-patch:
type: approval
requires:
- merge-beta-to-master
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*-b\..*$/
- tag:
name: tag-final-patch
semtag: "final -s patch"
requires:
- approval-tag-final-patch
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*-b\..*$/
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
##
## SPDX-FileCopyrightText: 2020 Splunk, Inc. <[email protected]>
## SPDX-License-Identifier: LicenseRef-Splunk-1-2020
##
##
version: 2
updates:
# Keep package.json (& lockfiles) up to date as soon as
# new versions are published to the npm registry
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
# Keep Dockerfile up to date, batching pull requests weekly
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
27 changes: 0 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,7 @@ dist/*
*.egg-info
output
splunk_add_on_ucc_framework/UCC-UI-lib/bower_components/SplunkWebCore/npm-shrinkwrap.json
splunk_add_on_ucc_framework/package/appserver/static/css/bootstrap-enterprise.css
splunk_add_on_ucc_framework/package/appserver/static/css/bootstrap-lite.css
splunk_add_on_ucc_framework/package/appserver/static/css/common.css
splunk_add_on_ucc_framework/package/appserver/static/css/configuration.css
splunk_add_on_ucc_framework/package/appserver/static/css/createInput.css
splunk_add_on_ucc_framework/package/appserver/static/css/inputs.css
splunk_add_on_ucc_framework/package/appserver/static/css/switchButton.css
splunk_add_on_ucc_framework/package/appserver/static/js/build/1.1.js
splunk_add_on_ucc_framework/package/appserver/static/js/build/2.2.js
splunk_add_on_ucc_framework/package/appserver/static/js/build/3.3.js
splunk_add_on_ucc_framework/package/appserver/static/js/build/4.4.js
splunk_add_on_ucc_framework/package/appserver/static/js/build/5.5.js
splunk_add_on_ucc_framework/package/appserver/static/js/build/common.js
splunk_add_on_ucc_framework/package/appserver/static/js/build/entry_page.js
splunk_add_on_ucc_framework/package/appserver/static/js/build/redirect_page.js
splunk_add_on_ucc_framework/package/appserver/static/styles/bootstrap.pcss
splunk_add_on_ucc_framework/package/appserver/templates/base.html
splunk_add_on_ucc_framework/package/appserver/templates/redirect.html
splunk_add_on_ucc_framework/package/default/data/ui/nav/default.xml
splunk_add_on_ucc_framework/package/default/data/ui/views/configuration.xml
splunk_add_on_ucc_framework/package/default/data/ui/views/inputs.xml
splunk_add_on_ucc_framework/package/default/data/ui/views/redirect.xml
splunk_add_on_ucc_framework/package/locale/messages.pot
splunk_add_on_ucc_framework/package/locale/zh_CN/LC_MESSAGES/messages.mo
splunk_add_on_ucc_framework/package/locale/zh_CN/LC_MESSAGES/messages.po
splunk_add_on_ucc_framework/UCC-UI-lib/bower_components/SplunkWebCore/npm-shrinkwrap.json
tests/.DS_Store
splunk_add_on_ucc_framework/UCC-UI-lib/bower_components/SplunkWebCore/npm-shrinkwrap.json
pip-wheel-metadata/UNKNOWN.dist-info/top_level.txt
pip-wheel-metadata/UNKNOWN.dist-info/METADATA
.vscode/settings.json
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.7.8
3.7.4
2.7.18
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# splunk-add-on-ucc-framework

![PyPI](https://img.shields.io/pypi/v/splunk-add-on-ucc-framework)
![Python](https://img.shields.io/pypi/pyversions/splunk-add-on-ucc-framework.svg)

A framework to generate Splunk Add-ons. It includes UI, Rest handler, Modular input, Oauth, Alert action templates.

## What is UCC?

UCC is Universal Configuration Console. It is a service for Generating Splunk Add-ons which is easily customizable and flexible.
It is helpful to control the activity by using hooks and other functionalities. UCC provides basic UI template for creating Addon's UI.


## Features

- Generate ucc based addons for your Splunk Technology Add-ons


## Requirements

- Addon package and globalConfig.json file

> Note: You may refer the globalConfig.json file [here](tests/data/globalConfig.json)

## Installation

You can install "splunk-add-on-ucc-framework" via `pip` from `PyPI`:

```bash
$ pip3 install splunk-add-on-ucc-framework
```


## How to use

To build the ucc based addon follow the below steps:

1. Install the `splunk-add-on-ucc-framework` via `pip3`
2. Run the `ucc-gen` command
3. Make sure that `package` directory and `globalConfig.json` file present in the directory
4. The final addon package will be generated, at `output` directory.


## Workflow

By the running the `ucc-gen` command, the following steps came in action:
1. Cleaning out the `output` directory
2. Retrieve the package ID of addon
3. Copy UCC template directory under `output/<package_ID>` directory
4. Copy `globalConfig.json` file to `output/<package_ID>/appserver/static/js/build` directory
5. Collect and install Addon's Requirements into `output/<package_ID>/lib` directory of addon's package
6. For the addon's requirements, packages were installed according to following table.

| File Name | Description | Output directory in ucc build |
|----------------------|-------------------------------------|-------------------------------|
| requirements.txt | Python2/python3 compatible packages | output/<package_ID>/lib |
| requirements_py2.txt | Only Python2 compatible packages | output/<package_ID>/lib/py2 |
| requirements_py3.txt | Only python3 compatible packages | output/<package_ID>/lib/py3 |

7. Replace tokens in views
8. Copy addon's `package/*` to `output/<package_ID>/*` directory


## Params

splunk-add-on-ucc-framework supports the following params:
| Name | Description |
|------------|----------------------------------------------------------------------------------------------------------|
| source | Folder containing the app.manifest and app source |
| config | Path to the configuration file, Defaults to GlobalConfig.json in the parent directory of source provided |
| ta-version | Current version of TA, Default version is version specified in globalConfig.json |
Empty file removed README.rst
Empty file.
Loading

0 comments on commit 6c26a0a

Please sign in to comment.