Skip to content

ayindeHassan/cmdchallenge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMD Challenge

This repository contains the code for the site cmdchallenge.com

Read more about cmdchallenge

Installation

  • Install Docker
  • Install asdf
  • asdf install
  • docker pull registry.gitlab.com/jarv/cmdchallenge/cmd
  • docker pull registry.gitlab.com/jarv/cmdchallenge/cmd-no-bin

Testing

  • make test

Local development

Backend

Start the backend which will also initialize a new sqlite database in the cmdchallenge/ directory.

If you want to use the test in-memory database use the -dev flag.

make build-image-cmd # builds the docker images for the runner
go run cmdchallenge/cmd/serve.go

Test a single command:

curl  http://localhost:8181/c/r -X POST -F slug=hello_world -F cmd="echo hello world"

Fetch solutions:

curl http://localhost:8181/c/s?slug=hello_world

Frontend

Most of the logic is coded in src/cmdchallenge.js, to compile run:

npx webpack

To start the development webserver:

make serve

CI vars

The following CI vars are necessary to run the full pipeline

  • AWS_ACCESS_KEY_ID: Access key for AWS
  • AWS_SECRET_ACCESS_KEY: Secret key for AWS
  • STATE_S3_BUCKET: where to store Terraform state
  • STATE_S3_KEY: key for storing state
  • STATE_S3_REGION: region for deployment
  • SSH_PRIVATE_KEY: Private SSH key for the remote Docker machine
  • SSH_PUBLIC_KEY : Public SSH key for the remote Docker machine

Bugs / Suggestions

About

This repo is mirror of https://gitlab.com/jarv/cmdchallenge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 24.9%
  • CSS 22.2%
  • JavaScript 11.4%
  • Nim 10.9%
  • Shell 8.6%
  • Roff 6.5%
  • Other 15.5%