Skip to content

Commit 4744a9c

Browse files
authored
Merge pull request #14836 from jdaugherty/grails-forge-merge
Merge grails-forge into grails-core
2 parents 7f8eb1c + b02edf8 commit 4744a9c

586 files changed

Lines changed: 39313 additions & 462 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Ž.asf.yamlβ€Ž

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: "Next GCP Deploy"
17+
on:
18+
workflow_dispatch:
19+
jobs:
20+
build:
21+
name: "Build project"
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- name: "πŸ“₯ Checkout repository"
25+
uses: actions/checkout@v4
26+
- name: "β˜•οΈ Setup JDK"
27+
uses: actions/setup-java@v4
28+
with:
29+
distribution: 'liberica'
30+
java-version: '17'
31+
- name: "🐘 Setup Gradle"
32+
uses: gradle/actions/setup-gradle@v4
33+
with:
34+
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
35+
- name: "πŸ”¨ Build"
36+
run: ./gradlew build
37+
deploy:
38+
name: "Deploy to Google Cloud Run"
39+
runs-on: ubuntu-24.04
40+
needs: build
41+
env:
42+
IMAGE_NAME: us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_APP_NAME }}/${{ secrets.GCP_APP_NAME }}:next
43+
steps:
44+
- name: "πŸ”‘ Login to Google Cloud"
45+
uses: google-github-actions/setup-gcloud@20c93dacc1d70ddbce76c63ab32c35595345bdd1
46+
with:
47+
project_id: ${{ secrets.GCP_PROJECT_ID }}
48+
service_account_email: ${{ secrets.GCP_EMAIL }}
49+
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
50+
- name: Set up Cloud SDK
51+
uses: google-github-actions/setup-gcloud@v2
52+
with:
53+
project_id: ${{ secrets.GCP_PROJECT_ID }}
54+
- name: "πŸ‹ Configure Docker for Artifact Registry"
55+
run: gcloud auth configure-docker us-docker.pkg.dev --quiet
56+
- name: "πŸ“₯ Checkout repository"
57+
uses: actions/checkout@v4
58+
- name: "β˜•οΈ Setup JDK"
59+
uses: actions/setup-java@v4
60+
with:
61+
distribution: 'liberica'
62+
java-version: '17'
63+
- name: "🐘 Setup Gradle"
64+
uses: gradle/actions/setup-gradle@v4
65+
with:
66+
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
67+
- name: "πŸƒ Run tests"
68+
run: >
69+
./gradlew
70+
grails-forge-api:test
71+
grails-forge-web-netty:test
72+
- name: "πŸ”¨ Build Docker image"
73+
# To deploy native executables built with GraalVM, replace dockerBuild with dockerBuildNative and dockerPush
74+
# with dockerPushNative. First, try that it works locally.
75+
run: >
76+
./gradlew
77+
grails-forge-web-netty:dockerBuildNative
78+
-PdockerImageName=${{ env.IMAGE_NAME }}
79+
- name: "πŸ“€ Push Container to Google Cloud Artifact Registry"
80+
run: |
81+
docker push ${{ env.IMAGE_NAME }}
82+
- name: "πŸš€ Deploy Docker image"
83+
run: >
84+
gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-next
85+
--image $IMAGE_NAME
86+
--region us-central1
87+
--update-env-vars=HOSTNAME="next.grails.org",CORS_ALLOWED_ORIGIN="https://start.grails.org",GITHUB_OAUTH_APP_CLIENT_ID=${{ secrets.GH_OAUTH_SNAPSHOT_CLIENT_ID }},GITHUB_OAUTH_APP_CLIENT_SECRET=${{ secrets.GH_OAUTH_SNAPSHOT_CLIENT_SECRET }},GITHUB_USER_AGENT=${{ secrets.GH_USER_AGENT }},GITHUB_REDIRECT_URL=${{ secrets.GH_REDIRECT_URL }}
88+
--platform managed
89+
--allow-unauthenticated
90+
--service-account=${{ secrets.GCLOUD_EMAIL }}
91+
deployAnalytics:
92+
name: "Deploy analytics to Google Cloud Run"
93+
runs-on: ubuntu-24.04
94+
needs: build
95+
env:
96+
IMAGE_NAME: us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_APP_NAME }}/${{ secrets.GCP_APP_NAME }}-analytics:next
97+
steps:
98+
- name: "πŸ”‘ Login to Google Cloud"
99+
uses: google-github-actions/setup-gcloud@20c93dacc1d70ddbce76c63ab32c35595345bdd1
100+
with:
101+
project_id: ${{ secrets.GCP_PROJECT_ID }}
102+
service_account_email: ${{ secrets.GCP_EMAIL }}
103+
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
104+
- name: Set up Cloud SDK
105+
uses: google-github-actions/setup-gcloud@v2
106+
with:
107+
project_id: ${{ secrets.GCP_PROJECT_ID }}
108+
- name: "πŸ‹ Configure Docker for Artifact Registry"
109+
run: gcloud auth configure-docker us-docker.pkg.dev --quiet
110+
- name: "πŸ“₯ Checkout repository"
111+
uses: actions/checkout@v4
112+
- name: "β˜•οΈ Setup JDK"
113+
uses: actions/setup-java@v4
114+
with:
115+
distribution: 'liberica'
116+
java-version: '17'
117+
- name: "🐘 Setup Gradle"
118+
uses: gradle/actions/setup-gradle@v4
119+
with:
120+
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
121+
- name: "πŸƒ Run tests"
122+
run: ./gradlew grails-forge-analytics-postgres:test
123+
- name: "πŸ”¨ Build Docker image"
124+
# To deploy native executables built with GraalVM, replace dockerBuild with dockerBuildNative and dockerPush
125+
# with dockerPushNative. First, try that it works locally.
126+
run: >
127+
./gradlew
128+
grails-forge-analytics-postgres:dockerBuildNative
129+
-PdockerImageName=${{ env.IMAGE_NAME }}
130+
- name: "πŸ“€ Push Container to Google Cloud Artifact Registry"
131+
run: |
132+
docker push ${{ env.IMAGE_NAME }}
133+
- name: "πŸš€ Deploy Docker image"
134+
run: |
135+
gcloud components install beta --quiet
136+
gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-analytics-next --image $IMAGE_NAME --region us-central1 --platform managed --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }}
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: "Prev Snapshot GCP Deploy"
17+
on:
18+
workflow_dispatch:
19+
jobs:
20+
build:
21+
name: "Build project"
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- name: "πŸ“₯ Checkout repository"
25+
uses: actions/checkout@v4
26+
- name: "β˜•οΈ Setup JDK"
27+
uses: actions/setup-java@v4
28+
with:
29+
distribution: 'liberica'
30+
java-version: '17'
31+
- name: "🐘 Setup Gradle"
32+
uses: gradle/actions/setup-gradle@v4
33+
with:
34+
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
35+
- name: "πŸ”¨ Build"
36+
run: ./gradlew build
37+
deploy:
38+
name: "Deploy to Google Cloud Run"
39+
runs-on: ubuntu-24.04
40+
needs: build
41+
env:
42+
IMAGE_NAME: us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_APP_NAME }}/${{ secrets.GCP_APP_NAME }}:prev-snapshot
43+
steps:
44+
- name: "πŸ”‘ Login to Google Cloud"
45+
uses: google-github-actions/setup-gcloud@20c93dacc1d70ddbce76c63ab32c35595345bdd1
46+
with:
47+
project_id: ${{ secrets.GCP_PROJECT_ID }}
48+
service_account_email: ${{ secrets.GCP_EMAIL }}
49+
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
50+
- name: Set up Cloud SDK
51+
uses: google-github-actions/setup-gcloud@v2
52+
with:
53+
project_id: ${{ secrets.GCP_PROJECT_ID }}
54+
- name: "πŸ‹ Configure Docker for Artifact Registry"
55+
run: gcloud auth configure-docker us-docker.pkg.dev --quiet
56+
- name: "πŸ“₯ Checkout repository"
57+
uses: actions/checkout@v4
58+
- name: "β˜•οΈ Setup JDK"
59+
uses: actions/setup-java@v4
60+
with:
61+
distribution: 'liberica'
62+
java-version: '17'
63+
- name: "🐘 Setup Gradle"
64+
uses: gradle/actions/setup-gradle@v4
65+
with:
66+
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
67+
- name: "πŸƒ Run tests"
68+
run: >
69+
./gradlew
70+
grails-forge-api:test
71+
grails-forge-web-netty:test
72+
- name: "πŸ”¨ Build Docker image"
73+
# To deploy native executables built with GraalVM, replace dockerBuild with dockerBuildNative and dockerPush
74+
# with dockerPushNative. First, try that it works locally.
75+
run: >
76+
./gradlew
77+
grails-forge-web-netty:dockerBuildNative
78+
-PdockerImageName=${{ env.IMAGE_NAME }}
79+
- name: "πŸ“€ Push Container to Google Cloud Artifact Registry"
80+
run: |
81+
docker push ${{ env.IMAGE_NAME }}
82+
- name: "πŸš€ Deploy Docker image"
83+
run: >
84+
gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-prev-snapshot
85+
--image $IMAGE_NAME
86+
--region us-central1
87+
--update-env-vars=HOSTNAME="prev-snapshot.grails.org",CORS_ALLOWED_ORIGIN="https://start.grails.org",GITHUB_OAUTH_APP_CLIENT_ID=${{ secrets.GH_OAUTH_SNAPSHOT_CLIENT_ID }},GITHUB_OAUTH_APP_CLIENT_SECRET=${{ secrets.GH_OAUTH_SNAPSHOT_CLIENT_SECRET }},GITHUB_USER_AGENT=${{ secrets.GH_USER_AGENT }},GITHUB_REDIRECT_URL=${{ secrets.GH_REDIRECT_URL }}
88+
--platform managed
89+
--allow-unauthenticated
90+
--service-account=${{ secrets.GCLOUD_EMAIL }}
91+
deployAnalytics:
92+
name: "Deploy analytics to Google Cloud Run"
93+
runs-on: ubuntu-24.04
94+
needs: build
95+
env:
96+
IMAGE_NAME: us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_APP_NAME }}/${{ secrets.GCP_APP_NAME }}-analytics:prev-snapshot
97+
steps:
98+
- name: "πŸ”‘ Login to Google Cloud"
99+
uses: google-github-actions/setup-gcloud@20c93dacc1d70ddbce76c63ab32c35595345bdd1
100+
with:
101+
project_id: ${{ secrets.GCP_PROJECT_ID }}
102+
service_account_email: ${{ secrets.GCP_EMAIL }}
103+
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
104+
- name: Set up Cloud SDK
105+
uses: google-github-actions/setup-gcloud@v2
106+
with:
107+
project_id: ${{ secrets.GCP_PROJECT_ID }}
108+
- name: "πŸ‹ Configure Docker for Artifact Registry"
109+
run: gcloud auth configure-docker us-docker.pkg.dev --quiet
110+
- name: "πŸ“₯ Checkout repository"
111+
uses: actions/checkout@v4
112+
- name: "β˜•οΈ Setup JDK"
113+
uses: actions/setup-java@v4
114+
with:
115+
distribution: 'liberica'
116+
java-version: '17'
117+
- name: "🐘 Setup Gradle"
118+
uses: gradle/actions/setup-gradle@v4
119+
with:
120+
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
121+
- name: "πŸƒ Run tests"
122+
run: ./gradlew grails-forge-analytics-postgres:test
123+
- name: "πŸ”¨ Build Docker image"
124+
# To deploy native executables built with GraalVM, replace dockerBuild with dockerBuildNative and dockerPush
125+
# with dockerPushNative. First, try that it works locally.
126+
run: >
127+
./gradlew
128+
grails-forge-analytics-postgres:dockerBuildNative
129+
-PdockerImageName=${{ env.IMAGE_NAME }}
130+
- name: "πŸ“€ Push Container to Google Cloud Artifact Registry"
131+
run: |
132+
docker push ${{ env.IMAGE_NAME }}
133+
- name: "πŸš€ Deploy Docker image"
134+
run: |
135+
gcloud components install beta --quiet
136+
gcloud run deploy ${{ secrets.GCP_PROJECT_ID }}-analytics-prev-snapshot --image $IMAGE_NAME --region us-central1 --platform managed --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }}

0 commit comments

Comments
Β (0)