Skip to content

WIP: Migrate to SDK 2 #10

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

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5e1480b
Update packages
Jan 7, 2020
f2e4f55
Update @cto.ai/sdk version to ^2. Sort imports, and replace console.l…
Jan 7, 2020
214d109
Await ux.print. Fix tests.
Jan 7, 2020
771d05d
Temporarily fix prints that are now async, inside non-async functions
Jan 7, 2020
856c36f
Removed inquirer. Use sdk for types
Jan 7, 2020
f84eed0
Removed empty input validation, as SDK does that. Further remove inqu…
Jan 7, 2020
bbe6748
Reimplement validated prompts. Use Question typing alias
Jan 8, 2020
411be5f
Further progress in migrating to SDK 2
Jan 8, 2020
6bcbb16
Rename validatedPrompts file to promptUtils
Jan 8, 2020
7157d88
Fleshed out keyValPrompt
Jan 8, 2020
8ba3363
keyValPrompt now supports multiple Question types
Jan 8, 2020
316a51c
Migrations to SDK 2 for a few more commands
Jan 8, 2020
bc755fa
Migrate pulls:list and repo:clone to SDK 2
Jan 8, 2020
13e2d73
Migrated all commands to SDK 2
Jan 8, 2020
a7026f4
Optional chaining is not supported yet by the node version in base image
Jan 8, 2020
2930212
Fix building
Jan 8, 2020
90285ee
Update dependencies, remove dead dependencies, add package-lock.json …
Jan 8, 2020
d4d2b4a
Use ux.print to print to stdout
Jan 8, 2020
29ec2de
await spinners
Jan 8, 2020
a46d7c6
Remove unused autocomplete stuff
Jan 9, 2020
72afd34
Remove commented out code
Jan 17, 2020
66f6b1d
Cleaned up commented out code
Jan 17, 2020
592f93b
Bump version to v1.1.0
Jan 17, 2020
b1007c1
Validate message for issue:save
Jan 17, 2020
ae8fc09
Fixed missing NOT
Jan 17, 2020
85adcd6
Renamed symbol nameList -> choicesArr
Jan 17, 2020
251af04
Cleaned up promptUtils
Jan 17, 2020
5a2a104
Add typing to keyValPrompt and update packages
Jan 20, 2020
e342ddf
Remove TODO
Jan 20, 2020
71251fc
Revert debugging-only function from ux.print back to console.log
Jan 20, 2020
4550c84
validatedPrompt error message is now optional
Jan 20, 2020
5f75372
Improve comments for promptUtils functions
Jan 21, 2020
528d03a
Fix typo breaking keyValPrompt
Jan 23, 2020
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
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
############################
# Build container
############################
FROM node:10-alpine AS dep
FROM registry.cto.ai/official_images/node:latest AS dep

WORKDIR /ops

RUN apk add python
RUN apt update && apt install -y python && mkdir lib

ADD package.json .
ADD package.json package-lock.json ./
RUN npm install
RUN du -sh /ops/node_modules && npx modclean -release && rm modclean*.log && du -sh /ops/node_modules

ADD . .

RUN mkdir lib

RUN npm run build
RUN npm run build && rm -rf /ops/src package-lock.json .dockerignore && mv /ops/lib/templates /ops/lib/src/ && mv /ops/lib/src/* /ops/lib/ && rm -r /ops/lib/src/

############################
# Final container
############################
FROM node:10-alpine
FROM registry.cto.ai/official_images/node:latest

WORKDIR /ops

RUN apk --update add git make vim && npm install -g typescript && npm install -g ts-node @types/node
RUN apt update && apt install -y git make ca-certificates && rm -rf /var/lib/apt/lists/*

COPY --from=dep /ops .
6 changes: 3 additions & 3 deletions ops.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
version: "1"
commands:
- name: # Unique identifier for your op (required)
github:1.0.0
github:1.1.0
description: # Short description for what your op does (required)
An Op to simplify an opinionated GitHub workflow.
public: # Determines whether this version of the op is visible to other people
true
sourceCodeURL: "https://github.com/cto-ai/github"
sdk: "2"
run: # Command that is executed when op is started ("npm start", "./start_script.sh", etc.) (required)
node /ops/lib/index.js
env:
Expand All @@ -20,6 +21,7 @@ commands:
- src
- Dockerfile
- package.json
- package-lock.json
- .dockerignore
- tsconfig.json
mountCwd: # If set to `true`, binds the host's current working directory to `/cwd`; default value: `false` - working directory `/ops`
Expand All @@ -30,8 +32,6 @@ commands:
- /tmp:/tmp
- ~/.ssh:/root/.ssh
- ~/.ops/cto.ai/github:/root/.ops/cto.ai/github
port: # Map ports for your op container
- 3000:3000
help: # Configure the output for when your op is run with `op --help` or `op -h`
usage: "ops run github [ARGUMENT]"
arguments:
Expand Down
Loading