Skip to content

Commit bb95fd2

Browse files
committed
Initial commit
1 parent cb512d7 commit bb95fd2

File tree

5 files changed

+19
-37
lines changed

5 files changed

+19
-37
lines changed

.github/workflows/create-app-db.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Create App With DB
22
on:
33
workflow_dispatch:
44
inputs:
5+
repo-org:
6+
required: true
7+
description: "Repository organization"
8+
type: string
9+
default: "devopsparadox"
510
repo-user:
611
required: true
712
description: "Repository user"
@@ -48,7 +53,7 @@ jobs:
4853
- name: Create repo
4954
run: |
5055
chmod +x scripts/create-repo-app-db.sh
51-
./scripts/create-repo-app-db.sh ${{ secrets.ORG_ADMIN_TOKEN }} ${{ inputs.repo-user }} ${{ inputs.repo-name }} ${{ inputs.image-repo }} ${{ inputs.host }} ${{ inputs.db-version }} ${{ inputs.db-size }}
56+
./scripts/create-repo-app-db.sh ${{ secrets.ORG_ADMIN_TOKEN }} ${{ inputs.repo-org }} ${{ inputs.repo-user }} ${{ inputs.repo-name }} ${{ inputs.image-repo }} ${{ inputs.host }} ${{ inputs.db-version }} ${{ inputs.db-size }}
5257
- name: Create Argo CD App
5358
run: |
5459
chmod +x scripts/create-argocd-app.sh

apps/idp-demo-app-production.yaml

-22
This file was deleted.

port/backend-app-action.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"title": "Create Backend App With DB",
55
"userInputs": {
66
"properties": {
7+
"repo-org": {
8+
"type": "string",
9+
"title": "Repo User",
10+
"default": "devopsparadox"
11+
},
712
"repo-user": {
813
"type": "string",
914
"title": "Repo User",
@@ -46,7 +51,7 @@
4651
"default": "production"
4752
}
4853
},
49-
"required": ["repo-user", "repo-name", "image-repo", "host", "db-version", "db-size", "environment"]
54+
"required": ["repo-org", "repo-user", "repo-name", "image-repo", "host", "db-version", "db-size", "environment"]
5055
},
5156
"invocationMethod": {
5257
"type": "GITHUB",

scripts/create-argocd-app.sh

-6
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@ REPO_USER=$2
33
REPO_NAME=$3
44
ENVIRONMENT=$4
55

6-
# sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
7-
# sudo chmod a+x /usr/local/bin/yq
8-
96
FILE_PATH=apps/${NAME}-${ENVIRONMENT}.yaml
107

118
cp argocd/app-template.yaml $FILE_PATH
129
yq --inplace ".metadata.name = \"${NAME}\"" $FILE_PATH
1310
yq --inplace ".spec.source.repoURL = \"https://github.com/${REPO_USER}/${REPO_NAME}.git\"" $FILE_PATH
1411
yq --inplace ".spec.source.path = \"kustomize/overlays/${ENVIRONMENT}\"" $FILE_PATH
1512
yq --inplace ".spec.destination.namespace = \"${ENVIRONMENT}\"" $FILE_PATH
16-
17-
# TODO: Remove
18-
cat apps/${NAME}-${ENVIRONMENT}.yaml

scripts/create-repo-app-db.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
export GITHUB_TOKEN=$1
2-
export GITHUB_USER=$2
3-
export APP=$3
4-
export IMAGE_REPO=$4
5-
export HOST=$5
6-
export DB_VERSION=$6
7-
export DB_SIZE=$7
2+
export GITHUB_ORG=$2
3+
export GITHUB_USER=$3
4+
export APP=$4
5+
export IMAGE_REPO=$5
6+
export HOST=$6
7+
export DB_VERSION=$7
8+
export DB_SIZE=$8
89

910
curl -fsSL https://download.devstream.io/download.sh | bash
1011
chmod +x dtm
1112
curl -H "Cache-Control: no-cache, no-store" -o config.yaml https://raw.githubusercontent.com/vfarcic/template-go-backend-db-google/main/config.yaml
12-
ls -la
1313
./dtm init --config-file config.yaml
1414
./dtm apply --config-file config.yaml --yes
1515
rm dtm config.yaml devstream.state

0 commit comments

Comments
 (0)