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

Add prettier #377

Open
wants to merge 14 commits into
base: release-0.3.0
Choose a base branch
from
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
name: Bug
about: An undesirable behaviour that needs correction
title: Bug
labels: ''
assignees: ''

labels: ""
assignees: ""
---

**Describe the Bug**
Expand All @@ -22,6 +21,7 @@ A clear and concise description of any implications.
**Steps To Reproduce**
Steps to reproduce the behaviour:
User/Role:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand Down
15 changes: 9 additions & 6 deletions .github/ISSUE_TEMPLATE/spike.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@
name: Spike
about: Research options prior to development work
title: Spike
labels: ''
assignees: ''

labels: ""
assignees: ""
---

**Problem Description**
**Problem Description**
**In order to** (achieve some goal), (a system or persona) **needs to** (some action).

**Solution Needs**

- Enter the non-negotiables of the solution (what are the needs vs. what are the wants)

**Timebox**

- How much effort are we committing to this research?

**Outcome**
Details describing the outcome of the research
- Was it successful? What direction should the work go?
Details describing the outcome of the research

- Was it successful? What direction should the work go?
- Was it unsuccessful? Discuss next steps with team

**Additional Context**

- enter text here
- enter text here
7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
name: Task
about: Any work that does not directly impact the user
title: Task
labels: ''
assignees: ''

labels: ""
assignees: ""
---

**Describe the task**
Expand All @@ -14,10 +13,12 @@ A clear and concise description of what the task is.
The reason why this task is needed and/or what value it adds.

**Acceptance Criteria**

- [ ] first
- [ ] second
- [ ] third

**Additional context**

- Add any other context about the task here.
- Or here
7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/user-story.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
name: User Story
about: This template is to be used when describing a feature from the user's perspective
title: User Story
labels: ''
assignees: ''

labels: ""
assignees: ""
---

**Title:**

**Description:**

- [ ] "As a [type of user]" "I want [an action or feature]" "So that [benefit or value]" -

**Wireframe:** <link>
Expand All @@ -22,6 +22,7 @@ assignees: ''
- [ ] Given I am a <role>, When I am <doing something>, then <this happens>

**Development Checklist:**

- [ ] A
- [ ] B
- [ ] C
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/prettier-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CTHUB prettier test

on:
push:
branches: [ prettier-0.3.0 ]
workflow_dispatch:

jobs:

test-prettier:

name: prettier
runs-on: ubuntu-latest

steps:

- name: Check out repository
uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}

- name: Prettify code
uses: creyD/[email protected]
with:
prettier_options: --write **/*.{js,md,html}

- name: Run python black code formatter
uses: DataDog/[email protected]
with:
fail_on_error: "false"

- name: Commit Python files
uses: EndBug/[email protected]
with:
add: 'django'
committer_name: 'kuan'
message: 'python files changed after formater DataDog/action-py-black-formatter'
8 changes: 4 additions & 4 deletions .pipeline/build-metabase.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const task = require('./lib/build-metabase.js')
const settings = require('./lib/config.js')
"use strict";
const task = require("./lib/build-metabase.js");
const settings = require("./lib/config.js");

task(Object.assign(settings, { phase: 'build'}))
task(Object.assign(settings, { phase: "build" }));
8 changes: 4 additions & 4 deletions .pipeline/build-patroni.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const task = require('./lib/build-patroni.js')
const settings = require('./lib/config.js')
"use strict";
const task = require("./lib/build-patroni.js");
const settings = require("./lib/config.js");

task(Object.assign(settings, { phase: 'build'}))
task(Object.assign(settings, { phase: "build" }));
8 changes: 4 additions & 4 deletions .pipeline/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const task = require('./lib/build.js')
const settings = require('./lib/config.js')
"use strict";
const task = require("./lib/build.js");
const settings = require("./lib/config.js");

task(Object.assign(settings, { phase: 'build'}))
task(Object.assign(settings, { phase: "build" }));
8 changes: 4 additions & 4 deletions .pipeline/clean-tools.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const settings = require('./lib/config.js')
const task = require('./lib/clean-tools.js')
"use strict";
const settings = require("./lib/config.js");
const task = require("./lib/clean-tools.js");

task(Object.assign(settings, { phase: settings.options.env}));
task(Object.assign(settings, { phase: settings.options.env }));
8 changes: 4 additions & 4 deletions .pipeline/clean.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const settings = require('./lib/config.js')
const task = require('./lib/clean.js')
"use strict";
const settings = require("./lib/config.js");
const task = require("./lib/clean.js");

task(Object.assign(settings, { phase: settings.options.env}));
task(Object.assign(settings, { phase: settings.options.env }));
8 changes: 4 additions & 4 deletions .pipeline/deploy-knp.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const settings = require('./lib/config.js')
const task = require('./lib/deploy-knp.js')
"use strict";
const settings = require("./lib/config.js");
const task = require("./lib/deploy-knp.js");

task(Object.assign(settings, { phase: settings.options.env}));
task(Object.assign(settings, { phase: settings.options.env }));
8 changes: 4 additions & 4 deletions .pipeline/deploy-metabase.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const settings = require('./lib/config.js')
const task = require('./lib/deploy-metabase.js')
"use strict";
const settings = require("./lib/config.js");
const task = require("./lib/deploy-metabase.js");

task(Object.assign(settings, { phase: settings.options.env}));
task(Object.assign(settings, { phase: settings.options.env }));
8 changes: 4 additions & 4 deletions .pipeline/deploy-patroni.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const settings = require('./lib/config.js')
const task = require('./lib/deploy-patroni.js')
"use strict";
const settings = require("./lib/config.js");
const task = require("./lib/deploy-patroni.js");

task(Object.assign(settings, { phase: settings.options.env}));
task(Object.assign(settings, { phase: settings.options.env }));
8 changes: 4 additions & 4 deletions .pipeline/deploy-unittest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const settings = require('./lib/config.js')
const task = require('./lib/deploy-unittest.js')
"use strict";
const settings = require("./lib/config.js");
const task = require("./lib/deploy-unittest.js");

task(Object.assign(settings, { phase: settings.options.env}));
task(Object.assign(settings, { phase: settings.options.env }));
8 changes: 4 additions & 4 deletions .pipeline/deploy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
const settings = require('./lib/config.js')
const task = require('./lib/deploy.js')
"use strict";
const settings = require("./lib/config.js");
const task = require("./lib/deploy.js");

task(Object.assign(settings, { phase: settings.options.env}));
task(Object.assign(settings, { phase: settings.options.env }));
17 changes: 13 additions & 4 deletions .pipeline/lib/build-metabase.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@
const { OpenShiftClientX } = require("@bcgov/pipeline-cli");
const path = require("path");

module.exports = settings => {
module.exports = (settings) => {
const phases = settings.phases;
const options = settings.options;
const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options));
const oc = new OpenShiftClientX(
Object.assign({ namespace: phases.build.namespace }, options),
);
const phase = "build";
let objects = [];
const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, "../../openshift"));
const templatesLocalBaseUrl = oc.toFileUrl(
path.resolve(__dirname, "../../openshift"),
);

// The building of your cool app goes here ▼▼▼
objects = objects.concat(oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/templates/metabase/metabase-bc.yaml`, {}));
objects = objects.concat(
oc.processDeploymentTemplate(
`${templatesLocalBaseUrl}/templates/metabase/metabase-bc.yaml`,
{},
),
);

oc.applyRecommendedLabels(
objects,
Expand Down
17 changes: 13 additions & 4 deletions .pipeline/lib/build-patroni.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@
const { OpenShiftClientX } = require("@bcgov/pipeline-cli");
const path = require("path");

module.exports = settings => {
module.exports = (settings) => {
const phases = settings.phases;
const options = settings.options;
const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options));
const oc = new OpenShiftClientX(
Object.assign({ namespace: phases.build.namespace }, options),
);
const phase = "build";
let objects = [];
const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, "../../openshift"));
const templatesLocalBaseUrl = oc.toFileUrl(
path.resolve(__dirname, "../../openshift"),
);

// The building of your cool app goes here ▼▼▼
objects = objects.concat(oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/templates/patroni-2.1.1/templates/build.yaml`, {}));
objects = objects.concat(
oc.processDeploymentTemplate(
`${templatesLocalBaseUrl}/templates/patroni-2.1.1/templates/build.yaml`,
{},
),
);

oc.applyRecommendedLabels(
objects,
Expand Down
56 changes: 35 additions & 21 deletions .pipeline/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,51 @@
const { OpenShiftClientX } = require("@bcgov/pipeline-cli");
const path = require("path");

module.exports = settings => {
module.exports = (settings) => {
const phases = settings.phases;
const options = settings.options;
const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options));
const oc = new OpenShiftClientX(
Object.assign({ namespace: phases.build.namespace }, options),
);
const phase = "build";
let objects = [];
const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, "../../openshift"));
const templatesLocalBaseUrl = oc.toFileUrl(
path.resolve(__dirname, "../../openshift"),
);

// The building of your cool app goes here ▼▼▼

// build frontend
objects = objects.concat(oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/templates/frontend/frontend-bc.yaml`, {
'param':{
'NAME': phases[phase].name,
'SUFFIX': phases[phase].suffix,
'VERSION': phases[phase].tag,
'GIT_URL': oc.git.http_url,
'GIT_REF': oc.git.ref
}
}))
objects = objects.concat(
oc.processDeploymentTemplate(
`${templatesLocalBaseUrl}/templates/frontend/frontend-bc.yaml`,
{
param: {
NAME: phases[phase].name,
SUFFIX: phases[phase].suffix,
VERSION: phases[phase].tag,
GIT_URL: oc.git.http_url,
GIT_REF: oc.git.ref,
},
},
),
);

//build backend
objects = objects.concat(oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/templates/backend/backend-bc.yaml`, {
'param':{
'NAME': phases[phase].name,
'SUFFIX': phases[phase].suffix,
'VERSION': phases[phase].tag,
'GIT_URL': oc.git.http_url,
'GIT_REF': oc.git.ref
}
}))
objects = objects.concat(
oc.processDeploymentTemplate(
`${templatesLocalBaseUrl}/templates/backend/backend-bc.yaml`,
{
param: {
NAME: phases[phase].name,
SUFFIX: phases[phase].suffix,
VERSION: phases[phase].tag,
GIT_URL: oc.git.http_url,
GIT_REF: oc.git.ref,
},
},
),
);

oc.applyRecommendedLabels(
objects,
Expand Down
Loading