Skip to content

Commit

Permalink
Add dc spec, build, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-funk committed Jul 29, 2023
1 parent c21f9dd commit 29e5083
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 2 deletions.
60 changes: 60 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "devtools",
"shutdownAction": "none",
"build": { "dockerfile": "Dockerfile" },
"updateRemoteUserUID":false,
"overrideCommand": false,
"runArgs": [
"-p",
"3000:3000",
"--name",
"mycodecollection"
],
"forwardPorts": [
3000
],
"workspaceFolder": "/app/codecollection",
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
// configuration following google standard
"vscode": {
"extensions": [
"robocorp.robotframework-lsp",
"ms-python.pylint",
"ms-python.black-formatter",
"ms-python.python",
"njpwerner.autodocstring"
],
"settings": {
"python.languageServer": "Jedi",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": [
"--max-line-length=120",
"--enable=W0614" // track unused imports
],
"[python]": {
"editor.insertSpaces": true,
"editor.tabSize": 4
},
"editor.formatOnSave": true,
"editor.lineNumbers": "on",
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"--line-length",
"120"
],
"robot.language-server.python": "/usr/local/bin/python",
"robot.pythonpath": [
"/app",
"/app/rw-public-codecollection/libraries",
"/app/rw-public-codecollection/libraries/RW",
"/app/codecollection/libraries",
"/app/codecollection/libraries/RW",
"/app/dev_facade"
]
}
}
}
}
24 changes: 24 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build And Push

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-push-ghcr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: |-
docker build \
-t "ghcr.io/${{ github.repository }}:latest" \
-t "ghcr.io/${{ github.repository }}:main" \
-f Dockerfile .
- name: Push
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login --username ${{ github.actor }} --password-stdin ghcr.io
docker push ghcr.io/${{ github.repository }} --all-tags
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM us-docker.pkg.dev/runwhen-nonprod-shared/public-images/codecollection-devtools:latest

USER root

RUN mkdir /app/codecollection
COPY . /app/codecollection

RUN pip install -r /app/codecollection/requirements.txt

# Install packages
RUN apt-get update && \
apt install -y git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/apt

# Change the owner of all files inside /app to user and give full permissions
RUN chown 1000:0 -R $WORKDIR
RUN chmod -R 644 /app

# Set the user to $USER
USER python
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
A hello-world-style template for codecollection authors to get started writing codebundles. This template contains the minimum file structure expected by the RunWhen platform.

## Getting Started
To get started go have a look at our public [Code Collection Development](https://docs.runwhen.com/public/code-collection-development/setup-your-codecollection-repository) docs.
Looking to be a contributor for CodeCollections or start your own? We'd love to collaborate! Head on over to our [public docs](https://docs.runwhen.com/public/runwhen-authors/getting-started-with-codecollection-development) to get started.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
robotframework>=4.1.2
ruamel.base>=1.0.0
ruamel.yaml>=0.17.20
requests>=2
requests>=2

0 comments on commit 29e5083

Please sign in to comment.