-
Notifications
You must be signed in to change notification settings - Fork 198
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
Showing
14 changed files
with
1,054 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,45 @@ | ||
/target/ | ||
/bin/ | ||
/.settings/ | ||
*# | ||
*.iml | ||
*.ipr | ||
*.iws | ||
*.jar | ||
*.sw? | ||
*~ | ||
.#* | ||
.*.md.html | ||
.DS_Store | ||
.classpath | ||
.factorypath | ||
.gradle | ||
.idea | ||
.metadata | ||
.project | ||
.recommenders | ||
.settings | ||
.springBeans | ||
/build | ||
/code | ||
MANIFEST.MF | ||
_site/ | ||
activemq-data | ||
bin | ||
build | ||
build.log | ||
dependency-reduced-pom.xml | ||
dump.rdb | ||
interpolated*.xml | ||
lib/ | ||
manifest.yml | ||
overridedb.* | ||
settings.xml | ||
target | ||
transaction-logs | ||
.flattened-pom.xml | ||
secrets.yml | ||
.gradletasknamecache | ||
.sts4-cache | ||
node_modules | ||
.dist/ |
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 @@ | ||
FROM openjdk:8u212-jdk-alpine | ||
COPY target/*SNAPSHOT.jar app.jar | ||
EXPOSE 8080 | ||
ENTRYPOINT ["java","-Xmx400M","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar","--spring.profiles.active=docker"] |
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,88 @@ | ||
steps: | ||
### Test | ||
# - id: 'test' | ||
# name: 'gcr.io/cloud-builders/mvn' | ||
# args: [ | ||
# 'test', | ||
# '-Dspring.profiles.active=test' | ||
# ] | ||
### Build | ||
- id: 'build' | ||
name: 'gcr.io/cloud-builders/mvn' | ||
args: [ | ||
'clean', | ||
'package', | ||
'-Dmaven.test.skip=true' | ||
] | ||
# waitFor: ['test'] | ||
### docker Build | ||
- id: 'docker build' | ||
name: 'gcr.io/cloud-builders/docker' | ||
args: | ||
- 'build' | ||
- '--tag=gcr.io/$PROJECT_ID/$_PROJECT_NAME:$COMMIT_SHA' | ||
- '.' | ||
### Publish | ||
- id: 'publish' | ||
name: 'gcr.io/cloud-builders/docker' | ||
entrypoint: 'bash' | ||
args: | ||
- '-c' | ||
- | | ||
docker push gcr.io/$PROJECT_ID/$_PROJECT_NAME:$COMMIT_SHA | ||
### deploy | ||
- id: 'deploy' | ||
name: 'gcr.io/cloud-builders/gcloud' | ||
entrypoint: 'bash' | ||
args: | ||
- '-c' | ||
- | | ||
PROJECT=$$(gcloud config get-value core/project) | ||
gcloud container clusters get-credentials "$${CLOUDSDK_CONTAINER_CLUSTER}" \ | ||
--project "$${PROJECT}" \ | ||
--zone "$${CLOUDSDK_COMPUTE_ZONE}" | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: $_PROJECT_NAME | ||
labels: | ||
app: $_PROJECT_NAME | ||
spec: | ||
ports: | ||
- port: 8080 | ||
targetPort: 8080 | ||
selector: | ||
app: $_PROJECT_NAME | ||
EOF | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: $_PROJECT_NAME | ||
labels: | ||
app: $_PROJECT_NAME | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: $_PROJECT_NAME | ||
template: | ||
metadata: | ||
labels: | ||
app: $_PROJECT_NAME | ||
spec: | ||
containers: | ||
- name: $_PROJECT_NAME | ||
image: gcr.io/$PROJECT_ID/$_PROJECT_NAME:$COMMIT_SHA | ||
ports: | ||
- containerPort: 8080 | ||
EOF | ||
options: | ||
env: | ||
# # location/name of GKE cluster (used by all kubectl commands) | ||
- CLOUDSDK_COMPUTE_ZONE=asia-northeast1-a | ||
- CLOUDSDK_CONTAINER_CLUSTER=uplus-poc-dev |
Oops, something went wrong.