Skip to content
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

feat: gitea app operator #103

Merged
merged 51 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f526324
test: gitea-operator
ferruhcihan Jun 4, 2024
636b006
test: gitea operator
ferruhcihan Jun 4, 2024
31b241b
test: gitea operator
ferruhcihan Jun 4, 2024
a8ccc3e
test: gitea operator drone oauth
ferruhcihan Jun 4, 2024
f515aea
test: gitea operator
ferruhcihan Jun 5, 2024
efa3d42
test: gitea operator
ferruhcihan Jun 5, 2024
39b40b0
test: gitea operator
ferruhcihan Jun 5, 2024
4d6a0b9
feat: remove drone related code
ferruhcihan Jun 5, 2024
7ebe89b
test: gitea operator
ferruhcihan Jun 5, 2024
d4fbe37
test: gitea operator
ferruhcihan Jun 6, 2024
1bd4578
test: gitea operator
ferruhcihan Jun 6, 2024
e9308de
test: gitea operator
ferruhcihan Jun 6, 2024
899c404
test: gitea operator
ferruhcihan Jun 6, 2024
ccecc1a
test: gitea operator
ferruhcihan Jun 6, 2024
418f801
test: gitea operator
ferruhcihan Jun 6, 2024
6468443
test: gitea operator
ferruhcihan Jun 6, 2024
64dd3ba
feat: gitea operator setupGitea
ferruhcihan Jun 6, 2024
e48795b
test: gitea operator env
ferruhcihan Jun 6, 2024
76c5e7b
feat: gitea operator
ferruhcihan Jun 6, 2024
9e3efb7
test: gitea operator cm
ferruhcihan Jun 7, 2024
c4125d7
test: gitea operator cm
ferruhcihan Jun 7, 2024
99ff62b
test: gitea operator cm
ferruhcihan Jun 7, 2024
162449a
test: gitea operator
ferruhcihan Jun 7, 2024
ae89ee8
test: gitea operator
ferruhcihan Jun 7, 2024
95e80da
test: gitea operator
ferruhcihan Jun 7, 2024
255342e
test: gitea operator
ferruhcihan Jun 7, 2024
7e10be3
test: gitea operator
ferruhcihan Jun 7, 2024
1d65a9a
test: gitea operator
ferruhcihan Jun 7, 2024
d7d23b6
test: read configmap
ferruhcihan Jun 7, 2024
2c1670f
test: watch multiple resources
ferruhcihan Jun 7, 2024
86f7a27
test: gitea operator logs
ferruhcihan Jun 7, 2024
09892c5
test: gitea operator logs
ferruhcihan Jun 7, 2024
56e1b7b
test: gitea operator watch secrets
ferruhcihan Jun 7, 2024
3defc85
test: gitea operator secrets
ferruhcihan Jun 7, 2024
3675d26
test: gitea operator
ferruhcihan Jun 7, 2024
4c4958e
test: gitea operator
ferruhcihan Jun 7, 2024
8173730
test: gitea operator
ferruhcihan Jun 7, 2024
46f1813
feat: gitea operator
ferruhcihan Jun 10, 2024
c8c7c6e
feat: update gitea app operator
ferruhcihan Jun 14, 2024
378fd38
fix: gitea operator env
ferruhcihan Jun 14, 2024
4c5f6e0
fix: gitea app operator env sample
ferruhcihan Jun 14, 2024
c3ae597
test: gitea operator new structure
ferruhcihan Jun 21, 2024
44eeeca
feat: update gitea test
ferruhcihan Jun 21, 2024
782cd40
feat: gitea operator
ferruhcihan Jun 21, 2024
22fb3ef
feat: add vscode files for local development
ferruhcihan Jun 21, 2024
3987908
feat: update const names
ferruhcihan Jul 4, 2024
0fddd14
fix: remove unnecessary line
ferruhcihan Jul 4, 2024
4dd3b86
Merge branch 'main' into fc-feat-gitea-operator
ferruhcihan Jul 5, 2024
5d61dfc
fix: dependencies
ferruhcihan Jul 5, 2024
10531e0
feat: update gitea operator ns
ferruhcihan Jul 8, 2024
cf3a344
Merge branch 'main' into fc-feat-gitea-operator
ferruhcihan Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,22 @@
// language - current active spelling language
"language": "en",
// words - list of words to be always considered correct
"words": ["camelcase", "creds", "kubernetes", "openid", "otomi", "linode", "robotv"],
"words": [
"argocd",
"camelcase",
"creds",
"gitea",
"kubernetes",
"oidc",
"openid",
"otomi",
"robotv",
"tekton"
],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// For example "hte" should be "the"
"flagWords": ["hte"]
"flagWords": [
"hte"
]
}
8 changes: 3 additions & 5 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ REDIRECT_URIS='["http://localhost:8084/*","https://auth.dev.gke.otomi.cloud/*","

# Gitea task
GITEA_PASSWORD=''
GITEA_URL='http://127.0.0.1:8082'
DRONE_URL='http://127.0.0.1:8081'

# Drone task
DRONE_TOKEN=''
GITEA_URL='http://127.0.0.1'
GITEA_URL_PORT='8082'
GITEA_OPERATOR_NAMESPACE='gitea-app'
CasLubbers marked this conversation as resolved.
Show resolved Hide resolved

OTOMI_FLAGS='{}'
WAIT_OPTIONS='{"retries":1}'
Expand Down
46 changes: 7 additions & 39 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"type": "node",
"request": "launch",
"name": "Debug Drone task",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "tasks:drone-dev"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"env": {
"NODE_EXTRA_CA_CERTS": "${workspaceFolder}/.env.ca"
}
},
{
"type": "node",
"request": "launch",
Expand Down Expand Up @@ -84,6 +71,13 @@
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"env" : {
"KUBECONFIG": "/path/to/your/kubeconfig.yaml",
"GITEA_URL" : "http://localhost",
"GITEA_URL_PORT" : "8082",
"GITEA_OPERATOR_NAMESPACE" : "gitea-app",
},
"preLaunchTask": "port-forward-gitea"
},
{
"type": "node",
Expand All @@ -98,32 +92,6 @@
"NODE_EXTRA_CA_CERTS": "${workspaceFolder}/.env.ca"
}
},
{
"type": "node",
"request": "launch",
"name": "Debug Gitea task",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "tasks:gitea-dev"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"env": {
"NODE_EXTRA_CA_CERTS": "${workspaceFolder}/.env.ca"
}
},
{
"type": "node",
"request": "launch",
"name": "Debug Gitea drone auth task",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "tasks:gitea-drone-auth-dev"],
"cwd": "${workspaceRoot}",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"env": {
"NODE_EXTRA_CA_CERTS": "${workspaceFolder}/.env.ca"
}
},
{
"type": "node",
"request": "launch",
Expand Down
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "port-forward-gitea",
"type": "shell",
"command": "export KUBECONFIG=/path/to/your/kubeconfig.yaml && kubectl -n gitea port-forward svc/gitea-http 8082:3000",
"problemMatcher": [],
"isBackground": true,
"presentation": {
"reveal": "always",
"panel": "new"
}
}
]
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ To create a personal access token, go to GitHub -> settings -> developer setting
#
Then start a proxy to the api you wish to target:

- drone: `k -n team-admin port-forward svc/drone 8081:80 &`
- gitea: `k -n gitea port-forward svc/gitea-http 8082:3000 &`
- harbor: `k -n harbor port-forward svc/harbor-core 8083:80 &`
- keycloak: `k -n keycloak port-forward svc/keycloak-http 8084:80 &`
Expand Down
1 change: 0 additions & 1 deletion bin/start-proxies.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
k="kubectl"
$k -n team-admin port-forward svc/drone 8081:80 &
$k -n gitea port-forward svc/gitea-http 8082:3000 &
$k -n harbor port-forward svc/harbor-core 8083:80 &
$k -n keycloak port-forward svc/keycloak-http 8084:80 &
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Coming soon!

### 3. Runtime tests targeting a cluster

After values are pushed the cluster's drone will do a deployment run. Helmfile diff is used targeting `$CLOUD` & `$CLUSTER` before the final deployment of the artifacts.
After values are pushed, the cluster's Tekton pipeline will initiate a deployment run. Helmfile diff is used targeting `$CLOUD` & `$CLUSTER` before the final deployment of the artifacts.

If you have any meaningful additions to this, please let us know!
143 changes: 0 additions & 143 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"axios": "0.21.2",
"bluebird": "3.7.2",
"cookie": "0.4.1",
"drone-node": "2.2.0",
"envalid": "6.0.2",
"js-yaml": "3.14.0",
"lodash": "4.17.21",
Expand Down Expand Up @@ -123,12 +122,6 @@
"tasks:copy-certs-dev": "ts-node-dev ./src/tasks/otomi/copy-certs.ts",
"tasks:copy-certs": "node dist/tasks/otomi/copy-certs.js",
"tasks:copy-certs-argo": "node dist/tasks/otomi/copy-certs-argo.js",
"tasks:drone-dev": "ts-node-dev ./src/tasks/drone/drone.ts",
"tasks:drone": "node dist/tasks/drone/drone.js",
"tasks:gitea-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 ts-node-dev ./src/tasks/gitea/gitea.ts && ts-node-dev ./src/tasks/gitea/gitea-drone-oauth.ts",
"tasks:gitea-drone-auth-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 ts-node-dev ./src/tasks/gitea/gitea-drone-oauth.ts",
"tasks:gitea-drone-auth": "node dist/tasks/gitea/gitea-drone-oauth.js",
"tasks:gitea": "node dist/tasks/gitea/gitea.js && node dist/tasks/gitea/gitea-drone-oauth.js",
"tasks:harbor-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 ts-node-dev ./src/tasks/harbor/harbor.ts",
"tasks:harbor": "node dist/tasks/harbor/harbor.js",
"tasks:keycloak-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 ts-node-dev ./src/tasks/keycloak/keycloak.ts",
Expand Down
6 changes: 6 additions & 0 deletions src/operator/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const orgName = 'otomi'
export const teamNameOwners = 'Owners'
export const teamNameViewer = 'otomi-viewer'
export const otomiValuesRepoName = 'values'
export const otomiChartsRepoName = 'charts'
export const username = 'otomi-admin'
2 changes: 1 addition & 1 deletion src/operator/gitea.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai'
import { buildTeamString } from './gitea'

describe('giteaOperator', () => {
const teamNames = ['team-demo', 'team-demo2', 'team-demo3']
const teamNames = ['demo', 'demo2', 'demo3']
it('should create a valid group mapping string with all the teams', () => {
const mappingString = buildTeamString(teamNames)
expect(mappingString).to.be.equal(
Expand Down
Loading
Loading