Skip to content

Commit

Permalink
Merge branch 'release/0.1.6.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
YukiOnishi1129 committed Jun 10, 2024
2 parents 0357f11 + 2300d39 commit f0cedff
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 68 deletions.
25 changes: 25 additions & 0 deletions batch-service/cmd/article-company-crawler/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM golang:1.22-alpine3.18 AS go-builder

RUN apk update && apk add git

WORKDIR /app

COPY ./batch-service/go.mod ./
COPY ./batch-service/go.sum ./
COPY ./batch-service/cmd/article-company-crawler ./cmd/article-company-crawler
COPY ./batch-service/database/init_db.go ./database/init_db.go
COPY ./batch-service/domain ./domain
COPY ./batch-service/entity ./entity
COPY ./batch-service/infrastructure/api ./infrastructure/api
COPY ./batch-service/infrastructure/rss ./infrastructure/rss
COPY ./batch-service/internal ./internal

RUN go mod download \
&& go build -o main /app/cmd/article-company-crawler/main.go


FROM alpine:3.18
WORKDIR /app
COPY --from=go-builder /app/main .

CMD ["/app/main"]
26 changes: 26 additions & 0 deletions batch-service/cmd/article-company-crawler/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# staging environment
substitutions:
_IMAGE: 'article-company-crawler/latest'
_JOB_NAME: 'article-company-crawler'
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', '$_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE','-f', 'batch-service/cmd/article-company-crawler/Dockerfile', '.']
# Push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', '$_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE']
# Deploy container image to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'jobs'
- 'deploy'
- '$_JOB_NAME'
- '--image'
- '$_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE'
- '--region'
- '$_REGION'
# - '--execute-now'
images:
- $_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE
25 changes: 25 additions & 0 deletions batch-service/cmd/article-site-and-summary-crawler/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM golang:1.22-alpine3.18 AS go-builder

RUN apk update && apk add git

WORKDIR /app

COPY ./batch-service/go.mod ./
COPY ./batch-service/go.sum ./
COPY ./batch-service/cmd/article-site-and-summary-crawler ./cmd/article-site-and-summary-crawler
COPY ./batch-service/database/init_db.go ./database/init_db.go
COPY ./batch-service/domain ./domain
COPY ./batch-service/entity ./entity
COPY ./batch-service/infrastructure/api ./infrastructure/api
COPY ./batch-service/infrastructure/rss ./infrastructure/rss
COPY ./batch-service/internal ./internal

RUN go mod download \
&& go build -o main /app/cmd/article-site-and-summary-crawler/main.go


FROM alpine:3.18
WORKDIR /app
COPY --from=go-builder /app/main .

CMD ["/app/main"]
26 changes: 26 additions & 0 deletions batch-service/cmd/article-site-and-summary-crawler/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# staging environment
substitutions:
_IMAGE: 'article-site-and-summary-crawler/latest'
_JOB_NAME: 'article-site-and-summary-crawler'
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', '$_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE','-f', 'batch-service/cmd/article-site-and-summary-crawler/Dockerfile', '.']
# Push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', '$_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE']
# Deploy container image to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'jobs'
- 'deploy'
- '$_JOB_NAME'
- '--image'
- '$_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE'
- '--region'
- '$_REGION'
# - '--execute-now'
images:
- $_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE
24 changes: 24 additions & 0 deletions batch-service/cmd/trend-article-crawler/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.22-alpine3.18 AS go-builder

RUN apk update && apk add git

WORKDIR /app

COPY ./batch-service/go.mod ./
COPY ./batch-service/go.sum ./
COPY ./batch-service/cmd/trend-article-crawler ./cmd/trend-article-crawler
COPY ./batch-service/database/init_db.go ./database/init_db.go
COPY ./batch-service/domain ./domain
COPY ./batch-service/entity ./entity
COPY ./batch-service/infrastructure/api ./infrastructure/api
COPY ./batch-service/infrastructure/rss ./infrastructure/rss
COPY ./batch-service/internal ./internal

RUN go mod download \
&& go build -o main /app/cmd/trend-article-crawler/main.go

FROM alpine:3.18
WORKDIR /app
COPY --from=go-builder /app/main .

CMD ["/app/main"]
26 changes: 26 additions & 0 deletions batch-service/cmd/trend-article-crawler/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# staging environment
substitutions:
_IMAGE: 'trend-article-crawler/latest'
_JOB_NAME: 'trend-article-crawler'
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', '$_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE','-f', 'batch-service/cmd/trend-article-crawler/Dockerfile', '.']
# Push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', '$_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE']
# Deploy container image to Cloud Run Jobs
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
- 'run'
- 'jobs'
- 'deploy'
- '$_JOB_NAME'
- '--image'
- '$_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE'
- '--region'
- '$_REGION'
# - '--execute-now'
images:
- $_REGION-docker.pkg.dev/$PROJECT_ID/$_IMAGE
34 changes: 0 additions & 34 deletions web/client/cloudbuild-production.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions web/client/cloudbuild-staging.yaml

This file was deleted.

0 comments on commit f0cedff

Please sign in to comment.