Skip to content

Initial commit#1

Open
flatnine wants to merge 4 commits into
masterfrom
INFRA-3100_new
Open

Initial commit#1
flatnine wants to merge 4 commits into
masterfrom
INFRA-3100_new

Conversation

@flatnine

@flatnine flatnine commented Nov 4, 2020

Copy link
Copy Markdown
Contributor

A new Github action that deploys gp-web to EKS when the trigger phrase

/preview

is used in a comment on a PR.

This role will also delete a deployment when a PR is closed.

@flatnine flatnine requested a review from benjambles November 4, 2020 15:31
@flatnine

flatnine commented Nov 4, 2020

Copy link
Copy Markdown
Contributor Author

@benjambles please take a look at the Javascript code. Let me know if you have any questions. I will raise a new PR against gp-web that will use this action so you can see how it works together.

This action will likely be thrown away in future, it's part of a MVP to get a preview system ready for gp-web.

The action is in a public repo as this is a requirement of Github actions.

Comment thread .editorconfig Outdated
end_of_line = lf

[*.html]
indent_size = 2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should probably all still be 4 as that's whats used on Miyagi and GP-Web

Comment thread .editorconfig
Comment thread Dockerfile

ARG KUBECTL_VERSION="1.17.7"

RUN apk add py-pip curl wget ca-certificates git bash jq

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha not wanting to use ash?

Comment thread Dockerfile

RUN apk add py-pip curl wget ca-certificates git bash jq
RUN pip install awscli
RUN curl -L -o /usr/bin/kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.17.7/2020-07-08/bin/linux/amd64/kubectl

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://amazon-eks.s3.us-west-2.amazonaws.com/1.17.7/2020-07-08/bin/linux/amd64/kubectl any way to pull that from an env file rather than it being hardcoded, or does it not matter that much?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope to replace this action shortly, using it to test concepts. I will leave fixed for the moment if that o.k.

Comment thread index.js
Comment on lines +56 to +64
const options = {};
options.listeners = {
stdout: (data) => {
cmdOutput += data.toString();
},
stderr: (data) => {
cmdError += data.toString();
}
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not massively important (it's not code thats run millions of times) but the following is better for performance:

Suggested change
const options = {};
options.listeners = {
stdout: (data) => {
cmdOutput += data.toString();
},
stderr: (data) => {
cmdError += data.toString();
}
};
const options = {
listeners = {
stdout: (data) => {
cmdOutput += data.toString();
},
stderr: (data) => {
cmdError += data.toString();
}
}
};

Comment thread package.json
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.4",
"@actions/github": "^4.0.0",
"common-tags": "^1.8.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main thing I would say is to add prettier to ensure consistent formatting in regards to spaces and semicolons. But that isn't needed for an MVP.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added prettier, any tips for rules?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants