Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Indexer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
System
Indexer
Commits
9f900355
Commit
9f900355
authored
5 years ago
by
Jagan Gottimukkula
Browse files
Options
Downloads
Patches
Plain Diff
added gcp deployment scripts
parent
40398c2d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!6
Trusted ibm
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indexer-service-gcp/src/main/appengine/app.yaml
+1
-1
1 addition, 1 deletion
indexer-service-gcp/src/main/appengine/app.yaml
indexer-service-gcp/src/scripts/deploy.sh
+51
-0
51 additions, 0 deletions
indexer-service-gcp/src/scripts/deploy.sh
with
52 additions
and
1 deletion
indexer-service-gcp/src/main/appengine/app.yaml
+
1
−
1
View file @
9f900355
...
...
@@ -33,4 +33,4 @@ handlers:
script
:
this field is required, but ignored
env_variables
:
GOOGLE_CLOUD_PROJECT
:
"
opendes
"
GOOGLE_CLOUD_PROJECT
:
"
GOOGLE_CLOUD_PROJECT_PLACE_HOLDER
"
This diff is collapsed.
Click to expand it.
indexer-service-gcp/src/scripts/deploy.sh
0 → 100644
+
51
−
0
View file @
9f900355
#!/bin/bash
# Exit as soon as a command fails
set
-e
echo
" Project =
$GCLOUD_PROJECT
"
echo
" Source branch =
$BUILD_SOURCEBRANCHNAME
"
echo
" Build definition =
$BUILD_DEFINITIONNAME
"
echo
" Build number =
$BUILD_BUILDNUMBER
"
echo
"current working directory"
pwd
echo
"working directory contents"
ls
DEPLOY_DIR
=
"deploy_dir"
mkdir
-p
$DEPLOY_DIR
cp
app.yaml
$DEPLOY_DIR
cp
indexer-service-gcp-
*
.jar
$DEPLOY_DIR
# Go to deploy directory
cd
$DEPLOY_DIR
# apply sed to set PROJECT_ID with its value in app.yaml
echo
"Replacing GOOGLE_CLOUD_PROJECT_PLACE_HOLDER with GCLOUD_PROJECT"
sed
-i
"s|GOOGLE_CLOUD_PROJECT_PLACE_HOLDER|
$GCLOUD_PROJECT
|g"
app.yaml
cat
app.yaml
# check the current deployed version of the same service
SERVICE_NAME
=
"os-indexer"
count
=
$(
gcloud app services list
--project
$GCLOUD_PROJECT
|
grep
$SERVICE_NAME
|
wc
-l
)
if
[
$count
-gt
0
]
;
then
CURRENT_VERSION
=
$(
gcloud app services describe
$SERVICE_NAME
--project
$GCLOUD_PROJECT
--format
=
json | jq
--raw-output
'.split.allocations | keys[0]'
)
else
CURRENT_VERSION
=
""
fi
NEW_VERSION
=
$BUILD_BUILDNUMBER
#to keep it unique
NEW_VERSION
=
$(
echo
"
$NEW_VERSION
"
|
tr
_ - |
tr
.
- |
tr
'[:upper:]'
'[:lower:]'
)
echo
"Current version =
$CURRENT_VERSION
"
echo
"Version to be deployed =
$NEW_VERSION
"
if
[
"
$NEW_VERSION
"
!=
"
$CURRENT_VERSION
"
-o
"
$BUILD_FORCE_DEPLOY
"
=
"true"
]
then
gcloud app deploy
--quiet
--version
=
$NEW_VERSION
--project
=
$GCLOUD_PROJECT
app.yaml
else
echo
"Not deploying the application because
$NEW_VERSION
is already deployed and force deploy flag is not set to true"
fi
This diff is collapsed.
Click to expand it.
Gokul Nagare
@gokul_nagare
mentioned in commit
d5255c23
·
4 years ago
mentioned in commit
d5255c23
mentioned in commit d5255c238ba67a6989a5a7dbc26c03b56b0b4f9e
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment