-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
NIS-PK409
authored and
NIS-PK409
committed
Dec 16, 2021
1 parent
ab86d02
commit 34c64b2
Showing
6 changed files
with
206 additions
and
1 deletion.
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
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,61 @@ | ||
#!/bin/sh | ||
|
||
|
||
|
||
echo "Done with upload-dgl-extension.sh" | ||
if [ "$1" == "" ] ; then | ||
echo "ERROR! Missing JAR name to be deployed." | ||
echo "Usage: ./deploy-dgl-extension.sh <JAR_NAME>" | ||
exit 0 | ||
fi | ||
|
||
JAR_NAME=$1 | ||
|
||
PREFIX=${JAR_NAME%-*} | ||
|
||
echo "Starting deploy of DGL extension ($JAR_NAME)..." | ||
echo "" | ||
|
||
cd /tmp | ||
|
||
echo "Cleaning previous versions..." | ||
echo "mv /home/stibosw/$PREFIX* /home/stibosw/old_recipes" | ||
echo "" | ||
|
||
OLD_RECIPE_LIST=`sudo -u stibosw ls /home/stibosw/ | grep $PREFIX` | ||
echo $OLD_RECIPE_LIST | ||
for old_recipe in $OLD_RECIPE_LIST | ||
do | ||
sudo -u stibosw mv /home/stibosw/$old_recipe /home/stibosw/old_recipes | ||
done | ||
|
||
echo "Copying jar to home folder..." | ||
echo "sudo -u stibosw cp /tmp/$JAR_NAME /home/stibosw" | ||
echo "" | ||
|
||
sudo -u stibosw cp /tmp/$JAR_NAME /home/stibosw | ||
|
||
echo "" | ||
echo "" | ||
|
||
VERSION_INDEX=${JAR_NAME%.*} | ||
VERSION=${VERSION_INDEX##*-} | ||
|
||
echo "Creating recipe for $PREFIX, version $VERSION..." | ||
echo "sudo -u stibosw /opt/stibo/step/spot --package=/home/stibosw --target=$PREFIX,$VERSION --insecure=E9950549758E0E50" | ||
echo "" | ||
|
||
sudo -u shussain /opt/stibo/step/spot --package=/home/stibosw --target=$PREFIX,$VERSION --insecure=E9950549758E0E50 | ||
|
||
echo "" | ||
echo "" | ||
|
||
echo "Applying recipe..." | ||
echo "sudo -u stibosw /opt/stibo/step/spot --apply=$PREFIX-$VERSION.spr --insecure=E9950549758E0E50" | ||
|
||
sudo -u stibosw /opt/stibo/step/spot --apply=$PREFIX-$VERSION.spr --insecure=E9950549758E0E50 | ||
|
||
echo "" | ||
echo "" | ||
|
||
echo "deploy-dgl-extension.sh is done" |
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,99 @@ | ||
|
||
|
||
def commonDeploySwitches = '-Papp_name=${APP_NAME} -Papp_memory=${APP_MEMORY} -Ptarget_env=${TARGET_ENVIRONMENT} -Partifact_id=${artifact_id} -PconfigServergitrepo=https://github.gapinc.com/GLV/glv-config.git' | ||
|
||
def deploymentJobs = [ | ||
[ | ||
'title' : 'deploy-to-local-lfw', | ||
'envs' : ['development', 'integration','configuration'], | ||
'env_desc' : 'Deploy to TDEV PCF Space', | ||
'artifactory_url': 'https://localhost:8082/artifactory/scmd-lfw', | ||
|
||
] | ||
|
||
] | ||
|
||
for (deploymentJob in deploymentJobs) { | ||
def deployJob = job(deploymentJob['title']) { | ||
wrappers { | ||
credentialsBinding { | ||
|
||
usernamePassword('GITHUB_USERNAME', 'GITHUB_PASSWORD', '85766806-3cb8-474e-966b-9e6d00f27764') | ||
|
||
usernamePassword('ARTIFACTORY_USERNAME', 'ARTIFACTORY_PASSWORD', 'jfrog-creds') | ||
|
||
|
||
|
||
} | ||
} | ||
parameters { | ||
textParam('artifact_id', '', 'Input valid artifactId for the service') | ||
choiceParam('TARGET_ENVIRONMENT', deploymentJob['envs'], deploymentJob['env_desc']) | ||
choiceParam('APP_MEMORY', [ | ||
'1024', | ||
'512', | ||
'2048', | ||
'4096', | ||
'8192' | ||
], 'Select the Amount of Memory Needed for your Application') | ||
choiceParam('APP_NAME', | ||
[ | ||
'glv-lfw-listener', | ||
|
||
], | ||
'Select the Application') | ||
} | ||
|
||
scm { | ||
git { | ||
remote { | ||
url('https://github.com/imran-ishaq/SCMD.git') | ||
credentials('85766806-3cb8-474e-966b-9e6d00f27764') | ||
} | ||
branch("main") | ||
} | ||
} | ||
steps { | ||
gradle { | ||
useWrapper(true) | ||
makeExecutable(true) | ||
tasks('deploy') | ||
fromRootBuildScriptDir(true) | ||
switches(deploymentJob['deploy_switches']) | ||
} | ||
sh './upload-war.sh' ${buildDir/libs} | ||
} | ||
|
||
logRotator { | ||
numToKeep(10) | ||
artifactNumToKeep(1) | ||
} | ||
} | ||
|
||
} | ||
|
||
listView('Preprod Deploy Job') { | ||
columns { | ||
status() | ||
weather() | ||
name() | ||
lastSuccess() | ||
lastFailure() | ||
lastDuration() | ||
buildButton() | ||
} | ||
jobs { name('deploy-to-pre-prod') } | ||
|
||
listView('PROD Deploy Job') { | ||
columns { | ||
status() | ||
weather() | ||
name() | ||
lastSuccess() | ||
lastFailure() | ||
lastDuration() | ||
buildButton() | ||
} | ||
jobs { name('deploy-to-prod') } | ||
} | ||
} |
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,4 @@ | ||
#!/bin/sh | ||
|
||
sshpass -p "l@s)-(@R!12345" ssh [email protected] ./deploy-war.sh $JAR_NAME | ||
echo "Exiting..." |