-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from CSSSR/update-dependencies
Refactor test app
- Loading branch information
Showing
15 changed files
with
169 additions
and
16 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 @@ | ||
* @cwarck @qtm @verdel @nitive |
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,37 @@ | ||
name: Docker image build | ||
on: | ||
push: | ||
branches: [master] | ||
paths: | ||
- app/** | ||
pull_request: | ||
paths: | ||
- app/** | ||
|
||
jobs: | ||
build-images: | ||
name: Build docker image | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build test-app | ||
run: make build | ||
working-directory: app | ||
|
||
- name: Login to Quay | ||
if: github.event_name == 'push' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: quay.csssr.cloud | ||
username: csssr+github_devops_test_app | ||
password: ${{ secrets.QUAY_REGISTRY_PASSWORD }} | ||
|
||
- name: Publish test-app | ||
run: make publish | ||
if: github.event_name == 'push' | ||
working-directory: app |
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,19 @@ | ||
name: Lint renovate configuration | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
paths: | ||
- .renovaterc | ||
- ".github/workflows/lint-renovate.yaml" | ||
pull_request: | ||
paths: | ||
- .renovaterc | ||
- ".github/workflows/lint-renovate.yaml" | ||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 3 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: suzuki-shunsuke/github-action-renovate-config-validator@v1.0.1 |
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 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:recommended", | ||
":disableRateLimiting", | ||
":disableVulnerabilityAlerts" | ||
], | ||
"labels": [ | ||
"dependencies" | ||
], | ||
"postUpdateOptions": [ | ||
"gomodTidy", | ||
"gomodUpdateImportPaths" | ||
], | ||
"reviewersFromCodeOwners": true, | ||
"enabledManagers": [ | ||
"gomod", | ||
"dockerfile", | ||
"github-actions" | ||
], | ||
"packageRules": [ | ||
{ | ||
"matchDatasources": [ | ||
"golang-version" | ||
], | ||
"rangeStrategy": "bump" | ||
} | ||
] | ||
} |
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,11 +1,15 @@ | ||
|
||
.PHONY: publish-app start-app deploy | ||
|
||
HELM=$(shell which helm3 2>/dev/null || which helm) | ||
BRANCH ?= master | ||
|
||
build-app: | ||
docker build app --tag quay.csssr.cloud/csssr/test-app:$(BRANCH) | ||
docker push quay.csssr.cloud/csssr/test-app:$(BRANCH) | ||
start-app: | ||
$(MAKE) -C app start | ||
|
||
HELM ?= helm3 | ||
publish-app: | ||
$(MAKE) -C app build version=$(BRANCH) | ||
$(MAKE) -C app publish version=$(BRANCH) | ||
|
||
deploy: | ||
$(HELM) upgrade --install my-app-$(BRANCH) chart --set image.tag=$(BRANCH) --set ingress.host=$(BRANCH).my-app.com | ||
$(HELM) upgrade --install my-app-$(BRANCH) chart --set image.tag=$(BRANCH) --set ingress.host=$(BRANCH).csssr.cloud |
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,36 @@ | ||
root = '.' | ||
tmp_dir = 'bin' | ||
|
||
[build] | ||
cmd = 'go build -o bin/app main.go' | ||
bin = './bin/app' | ||
full_bin = '' | ||
args_bin = [] | ||
include_ext = ['go'] | ||
exclude_dir = ['bin', 'tests'] | ||
include_dir = [] | ||
exclude_file = [] | ||
exclude_regex = ['_test.go'] | ||
exclude_unchanged = false | ||
follow_symlink = false | ||
delay = 1000 | ||
stop_on_error = true | ||
send_interrupt = false | ||
kill_delay = 0 | ||
|
||
[color] | ||
main = 'magenta' | ||
watcher = 'cyan' | ||
build = 'yellow' | ||
runner = 'green' | ||
app = '' | ||
|
||
[log] | ||
time = false | ||
|
||
[misc] | ||
clean_on_exit = true | ||
|
||
[screen] | ||
clear_on_rebuild = false | ||
|
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 @@ | ||
* | ||
!go.mod | ||
!go.sum | ||
!main.go |
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 +1,2 @@ | ||
tmp-image | ||
bin/ |
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,4 +1,4 @@ | ||
FROM golang:1.14 | ||
FROM golang:1.22 | ||
|
||
WORKDIR /app | ||
|
||
|
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,17 @@ | ||
.PHONY: start build publish | ||
|
||
export GOBIN=${CURDIR}/bin | ||
|
||
version ?= master | ||
|
||
$(GOBIN)/air: | ||
go install github.com/air-verse/air@latest | ||
|
||
start: $(GOBIN)/air | ||
air | ||
|
||
build: | ||
docker build . --tag quay.csssr.cloud/csssr/test-app:$(version) | ||
|
||
publish: | ||
docker push quay.csssr.cloud/csssr/test-app:$(version) |
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,5 +1,5 @@ | ||
module github.com/CSSSR/my-app | ||
|
||
go 1.14 | ||
go 1.22 | ||
|
||
require github.com/logrusorgru/aurora v2.0.3+incompatible |
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 |
---|---|---|
|
@@ -29,4 +29,4 @@ spec: | |
volumes: | ||
- name: data | ||
persistentVolumeClaim: | ||
claimName: my-app | ||
claimName: {{ .Release.Name }} |
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