forked from jhipster/jhipster-online
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change deployment to using Google App Engine flexible (jhipster…
…#174) This changes the deployment from CloudRun to GAE Flexible Related to jhipster#172
- Loading branch information
1 parent
e5d24d6
commit 9b73b37
Showing
8 changed files
with
183 additions
and
21 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,4 @@ | ||
.github | ||
.git | ||
Dockerfile | ||
app.yaml |
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,78 @@ | ||
# | ||
# Copyright 2013-2020 the original author or authors from the JHipster project. | ||
# | ||
# This file is part of the JHipster project, see https://www.jhipster.tech/ | ||
# for more information. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: Deploy JHipster Online | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
pipeline: | ||
name: jhipster-online deployment | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 40 | ||
|
||
steps: | ||
# Checkout with all submodules | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: 'true' | ||
|
||
# Substitutes the variables/secrets | ||
- uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: '${{ github.workspace }}/app.yaml' | ||
env: | ||
env_variables.DATABASE_NAME: ${{ secrets.DATABASE_NAME }} | ||
env_variables.INSTANCE_CONNECTION_NAME: ${{ secrets.INSTANCE_CONNECTION_NAME }} | ||
env_variables.GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | ||
env_variables.GCP_REGION: ${{ secrets.GCP_REGION }} | ||
env_variables.SQL_INSTANCE_ID: ${{ secrets.SQL_INSTANCE_ID }} | ||
env_variables.DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }} | ||
env_variables.DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} | ||
env_variables.MAIL_HOST: ${{ secrets.MAIL_HOST }} | ||
env_variables.MAIL_PORT: ${{ secrets.MAIL_PORT }} | ||
env_variables.MAIL_USERNAME: ${{ secrets.MAIL_USERNAME }} | ||
env_variables.MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }} | ||
env_variables.BASE64_SECRET: ${{ secrets.BASE64_SECRET }} | ||
env_variables.CLIENT_ID_GITHUB: ${{ secrets.CLIENT_ID_GITHUB }} | ||
env_variables.CLIENT_SECRET_GITHUB: ${{ secrets.CLIENT_SECRET_GITHUB }} | ||
env_variables.JHIPSTER_BOT_OAUTH_TOKEN: ${{ secrets.JHIPSTER_BOT_OAUTH_TOKEN }} | ||
env_variables.GITLAB_CLIENT_ID: ${{ secrets.GITLAB_CLIENT_ID }} | ||
env_variables.GITLAB_CLIENT_SECRET: ${{ secrets.GITLAB_CLIENT_SECRET }} | ||
env_variables.GITLAB_REDIRECT_URI: ${{ secrets.GITLAB_REDIRECT_URI }} | ||
|
||
# Setup gcloud CLI | ||
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master | ||
with: | ||
version: '290.0.1' | ||
service_account_key: ${{ secrets.GCP_SA_KEY }} | ||
project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
|
||
# Build and push docker image to GCR | ||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: _json_key | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
registry: eu.gcr.io | ||
repository: jhipster-online/appengine | ||
tag_with_sha: true | ||
|
||
# Deploy to App Engine Flexible | ||
- name: Deploy | ||
run: VERSION_TAG=${GITHUB_REF:10} && gcloud app deploy --image-url eu.gcr.io/jhipster-online/appengine:sha-${GITHUB_SHA::7} --version ${VERSION_TAG//./-} |
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
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,29 @@ | ||
runtime: custom | ||
env: flex | ||
resources: | ||
cpu: 1 | ||
memory_gb: 3.0 | ||
disk_size_gb: 10 | ||
manual_scaling: | ||
instances: 1 | ||
env_variables: | ||
DATABASE_NAME: | ||
INSTANCE_CONNECTION_NAME: | ||
GCP_PROJECT_ID: | ||
GCP_REGION: | ||
SQL_INSTANCE_ID: | ||
DATABASE_USERNAME: | ||
DATABASE_PASSWORD: | ||
MAIL_HOST: | ||
MAIL_PORT: | ||
MAIL_USERNAME: | ||
MAIL_PASSWORD: | ||
BASE64_SECRET: | ||
CLIENT_ID_GITHUB: | ||
CLIENT_SECRET_GITHUB: | ||
JHIPSTER_BOT_OAUTH_TOKEN: | ||
GITLAB_CLIENT_ID: | ||
GITLAB_CLIENT_SECRET: | ||
GITLAB_REDIRECT_URI: | ||
|
||
|
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,54 @@ | ||
# =================================================================== | ||
# Spring Boot configuration for the "gcp" profile. | ||
# | ||
# This configuration overrides the application.yml file. | ||
# | ||
# More information on profiles: https://www.jhipster.tech/profiles/ | ||
# More information on configuration properties: https://www.jhipster.tech/common-application-properties/ | ||
# =================================================================== | ||
|
||
# =================================================================== | ||
# Standard Spring Boot properties. | ||
# Full reference is available at: | ||
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html | ||
# =================================================================== | ||
|
||
spring: | ||
cloud: | ||
gcp: | ||
sql: | ||
enabled: true | ||
database-name: ${DATABASE_NAME} | ||
instance-connection-name: ${INSTANCE_CONNECTION_NAME} | ||
datasource: | ||
hikari: | ||
data-source-properties: | ||
socketFactory: com.google.cloud.sql.mysql.SocketFactory | ||
cloudSqlInstance: ${GCP_PROJECT_ID}:${GCP_REGION}:${SQL_INSTANCE_ID} | ||
jdbcUrl: jdbc:mysql://google/${DATABASE_NAME} | ||
username: ${DATABASE_USERNAME} | ||
password: ${DATABASE_PASSWORD} | ||
mail: | ||
host: ${MAIL_HOST} | ||
port: ${MAIL_PORT} | ||
username: ${MAIL_USERNAME} | ||
password: ${MAIL_PASSWORD} | ||
server: | ||
port: ${PORT} | ||
jhipster: | ||
mail: # specific JHipster mail property, for standard properties see MailProperties | ||
enabled: true | ||
base-url: https://start.jhipster.tech | ||
security: | ||
authentication: | ||
jwt: | ||
base64-secret: ${BASE64_SECRET} | ||
application: | ||
github: | ||
client-id: ${CLIENT_ID_GITHUB} | ||
client-secret: ${CLIENT_SECRET_GITHUB} | ||
jhipster-bot-oauth-token: ${JHIPSTER_BOT_OAUTH_TOKEN} | ||
gitlab: | ||
client-id: ${GITLAB_CLIENT_ID} | ||
client-secret: ${GITLAB_CLIENT_SECRET} | ||
redirect-uri: ${GITLAB_REDIRECT_URI} |
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