-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI\CD implementation --------- Co-authored-by: Gangadhar <[email protected]>
- Loading branch information
1 parent
5235118
commit 7e8e97a
Showing
3 changed files
with
84 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
git: | ||
depth: false | ||
quiet: false | ||
language: generic | ||
dist: bionic | ||
sudo: required | ||
branches: | ||
only: | ||
- /dev*/ | ||
- /AO-dev*/ | ||
- /QA*/ | ||
- /QE*/ | ||
- /RC*/ | ||
- /Release-Master*/ | ||
|
||
env: | ||
- SHORT_COMMIT= `git rev-parse --short=7 ${TRAVIS_COMMIT}` | ||
|
||
before_install: | ||
- echo $TRAVIS_BRANCH | ||
- echo $PWD | ||
- echo $TRAVIS_COMMIT | ||
- echo $BUILD_REPO_NAME | ||
jobs: | ||
include: | ||
if: commit_message =~ /(deploy-yes)/ | ||
script: | ||
- chmod u+x publish_package.sh && bash publish_package.sh | ||
notifications: | ||
email: | ||
recipients: | ||
- [email protected] | ||
on_success: always | ||
on_failure: always |
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,45 @@ | ||
|
||
#!/bin/bash | ||
|
||
if [ ${TRAVIS_PULL_REQUEST} != "false" ]; then echo "Not publishing a pull request !!!" && exit 0; fi | ||
|
||
export BRANCH_NAME=`echo "${TRAVIS_BRANCH}" | tr '[:upper:]' '[:lower:]'` | ||
case "${BRANCH_NAME}" in | ||
dev*) echo "Branch ${TRAVIS_BRANCH} is eligible for CI/CD" ;; | ||
ao-dev*)echo "Branch ${TRAVIS_BRANCH} is eligible for CI/CD" ;; | ||
qa*) echo "Branch ${TRAVIS_BRANCH} is eligible for CI/CD" ;; | ||
qe*) echo "Branch ${TRAVIS_BRANCH} is eligible for CI/CD" ;; | ||
rc*) echo "Branch ${TRAVIS_BRANCH} is eligible for CI/CD" ;; | ||
release-master*) echo "Branch ${TRAVIS_BRANCH} is eligible for CI/CD" ;; | ||
ft*) echo "Branch ${TRAVIS_BRANCH} is eligible for CI" ;; | ||
bf*) echo "Branch ${TRAVIS_BRANCH} is eligible for CI" ;; | ||
*) echo "Not a valid branch name for CI/CD" && exit -1;; | ||
esac | ||
|
||
echo $TRAVIS_BRANCH | ||
echo ${DEPLOYMENT_SERVER} | ||
export SHORT_COMMIT=`git rev-parse --short=7 ${TRAVIS_COMMIT}` | ||
echo "short commit $SHORT_COMMIT" | ||
sudo apt-get update && sudo apt-get install -y jq unzip zip | ||
PACKAGE_NAME=`jq '.name' version.json | tr -d '"'` | ||
PACKAGE_VERSION=`jq '.version' version.json | tr -d '"'` | ||
wget --timeout=10 --no-check-certificate --user ${NEXUS_USER} --password ${NEXUS_USER_PWD} https://nexus.tools.froala-infra.com/repository/Froala-npm/${PACKAGE_NAME}/-/${PACKAGE_NAME}-${PACKAGE_VERSION}.tgz | ||
if [ $? -ne 0 ]; then | ||
echo "Error pulling core library from nexus" | ||
exit -1 | ||
fi | ||
tar -xvf ${PACKAGE_NAME}-${PACKAGE_VERSION}.tgz | ||
echo "Copying core library css & js to /webroot/js// & /webroot/css ......" | ||
/bin/cp -fr package/css/* froala_editor/static/froala_editor/css/ | ||
/bin/cp -fr package/js/* froala_editor/static/froala_editor/js/ | ||
echo "Done ..." | ||
rm -rf package/ ${PACKAGE_NAME}-${PACKAGE_VERSION}.tgz | ||
python setup.py sdist | ||
echo "DIST package name: " | ||
ls dist/ | ||
ARCHIVE_NAME="${BUILD_REPO_NAME}-${TRAVIS_BRANCH}-${PACKAGE_VERSION}.tar.gz" | ||
mv dist/*.tar.gz dist/${ARCHIVE_NAME} | ||
echo "new package name: " | ||
ls dist/ | ||
curl -k --user "${NEXUS_USER}:${NEXUS_USER_PWD}" --upload-file dist/${ARCHIVE_NAME} https://nexus.tools.froala-infra.com/repository/Froala-raw-repo/django/${ARCHIVE_NAME} | ||
exit $? |
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 @@ | ||
{ | ||
"comment-1": " Please update this file for any new branch with core libary name - package name and version uploaded to nexus", | ||
"name": "froala-editor-QA241122", | ||
"version": "4.0.16" | ||
} |