-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev4 #26
Merged
Dev4 #26
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d7e827b
TP-c01_ci-cd: add Dockerfiles for nginx and microservices, add servic…
wonderf00l f8ec2a3
TP-c01_ci-cd: changed prometheus targets, servers addresses from loca…
wonderf00l f862979
TP-c01_ci-cd: add linter configuration
wonderf00l ea75fda
TP-c01_ci-cd: add named volumes for postgres and redis, add compose.p…
wonderf00l 6c8a215
TP-c01_ci-cd: add workflows description, add configuration file for a…
wonderf00l 7318fe6
TP-c01_ci-cd: add kafka healthcheck
wonderf00l eaa7ece
TP-c01_ci-cd: deleted nginx config from compose.yml, changed triggers…
wonderf00l 8d07119
TP-c01_ci-cd: deleted dev3 from triggers
wonderf00l df49eed
TP-c01_ci-cd: changed triggers, add step
wonderf00l 24e85bd
TP-6ec_easyjson: generated easyjson, changed serialization for user, …
wonderf00l ea2a4d0
TP-8da update: returned user from and to when deleting message
Gvidow 5fcf9c3
Merge pull request #22 from go-park-mail-ru/TP-6ec_easyjson
Gvidow 1c0e335
Merge branch 'dev4' into TP-c01_ci-cd
Gvidow d63df1b
Update websocket.go: delete unused package "os"
Gvidow cd3b116
Merge pull request #23 from go-park-mail-ru/TP-c01_ci-cd
Gvidow 2d1c6d2
TP-6ec_easyjson: add rest easyjson
wonderf00l fab4cf5
Merge pull request #24 from go-park-mail-ru/TP-6ec_easyjson
wonderf00l febce68
dev4: removed pull request trigger for deploy workflow
wonderf00l e3d1477
dev4: replaced auth service host:port string with env variables, move…
wonderf00l 0170995
TP-87a_filtration: add filtration of pin content
wonderf00l ff13346
TP-87a_filtration: add task with cloud api token provision, add '2023…
wonderf00l 1b8f327
Merge pull request #25 from go-park-mail-ru/TP-87a_filtration
wonderf00l 6311811
dev4: replaced google vision client with image filter interface
wonderf00l e4dc478
de4: changed deployment branch, add cloud api token to the .env file
wonderf00l cae7718
dev4: add images volume for main service container
wonderf00l e71947b
dev4: changed makefile variable, included all branches in CI
wonderf00l File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,32 @@ | ||
name: Start pinspire CI | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: {} | ||
pull_request: | ||
types: [opened, edited, reopened] | ||
branches: [main, dev4] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get repository code | ||
uses: actions/checkout@v4 | ||
- name: Test application | ||
continue-on-error: true | ||
run: go test ./... | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get repository code | ||
uses: actions/checkout@v4 | ||
- name: Lint application | ||
run: make lint | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get repository code | ||
uses: actions/checkout@v4 | ||
- name: Build application | ||
run: make build_all |
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,58 @@ | ||
name: Start Pinspire deployment | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
- dev4 | ||
|
||
jobs: | ||
build_images: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: get repository code | ||
uses: actions/checkout@v4 | ||
- name: Login to DockerHub Registry | ||
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | ||
- name: Build docker images of services | ||
run: | | ||
docker build -t pinspireapp/main:latest -f deployments/Dockerfile.main . & | ||
docker build -t pinspireapp/auth:latest -f deployments/Dockerfile.auth . & | ||
docker build -t pinspireapp/realtime:latest -f deployments/Dockerfile.realtime . & | ||
docker build -t pinspireapp/messenger:latest -f deployments/Dockerfile.messenger . & | ||
for p in $(jobs -p); do wait "$p" || { echo "job $p failed" >&2; exit; }; done | ||
- name: Push docker images | ||
run: | | ||
docker push pinspireapp/main:latest & | ||
docker push pinspireapp/auth:latest & | ||
docker push pinspireapp/realtime:latest & | ||
docker push pinspireapp/messenger:latest & | ||
for p in $(jobs -p); do wait "$p" || { echo "job $p failed" >&2; exit; }; done | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build_images | ||
steps: | ||
- name: fetch changes | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: pinspire.online | ||
username: ${{ secrets.REMOTE_USERNAME }} | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
script: | | ||
cd ${{ secrets.PINSPIRE_BACKEND_PATH }} | ||
sudo git switch dev4 | ||
sudo git pull | ||
- name: deploy application | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: pinspire.online | ||
username: ${{ secrets.REMOTE_USERNAME }} | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
script: | | ||
cd ${{ secrets.PINSPIRE_BACKEND_PATH }}/deployments | ||
sudo docker compose down main_service auth_service realtime_service messenger_service | ||
sudo docker rmi pinspireapp/main:latest pinspireapp/auth:latest pinspireapp/realtime:latest pinspireapp/messenger:latest | ||
sudo docker compose -f docker-compose.yml -f compose.prod.yml up -d | ||
|
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 |
---|---|---|
|
@@ -25,3 +25,6 @@ testdata/ | |
cert/ | ||
.env | ||
redis.conf | ||
inventory | ||
keyVision.json | ||
script* |
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
.PHONY: build run test test_with_coverage cleantest retest doc generate cover_all currcover | ||
.PHONY: build_auth build_realtime build_messenger | ||
.PHONY: build_auth build_realtime build_messenger build_all | ||
.PHONY: .install-linter lint lint-fast | ||
|
||
ENTRYPOINT=cmd/app/main.go | ||
DOC_DIR=./docs | ||
COV_OUT=coverage.out | ||
COV_HTML=coverage.html | ||
CURRCOVER=github.com/go-park-mail-ru/2023_2_OND_team/internal/pkg/delivery/http/v1 | ||
|
||
PROJECT_DIR = $(shell pwd) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. У make есть такая переменная There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. исправили |
||
PROJECT_BIN = $(PROJECT_DIR)/bin | ||
$(shell [ -f bin ] || mkdir -p $(PROJECT_BIN)) | ||
GOLANGCI_LINT = $(PROJECT_BIN)/golangci-lint | ||
|
||
build: | ||
go build -o bin/app cmd/app/*.go | ||
|
||
|
@@ -19,6 +25,8 @@ build_realtime: | |
build_messenger: | ||
go build -o bin/messenger cmd/messenger/*.go | ||
|
||
build_all: build build_auth build_realtime build_messenger | ||
|
||
run: build | ||
./bin/app | ||
|
||
|
@@ -51,3 +59,11 @@ currcover: | |
go test -cover -v -coverprofile=cover.out ${CURRCOVER} | ||
go tool cover -html=cover.out -o cover.html | ||
|
||
.install-linter: | ||
[ -f $(PROJECT_BIN)/golangci-lint ] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(PROJECT_BIN) v1.55.2 | ||
|
||
lint: .install-linter | ||
$(GOLANGCI_LINT) run ./... --config=configs/.golangci.yml | ||
|
||
lint-fast: .install-linter | ||
$(GOLANGCI_LINT) run ./... --fast --config=configs/.golangci.yml |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
может сделать для любой ветки dev? или вам только в этих двух ветках пайплайн с тестами нужен?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
добавили остальные ветки