Giter Site home page Giter Site logo

bartholomew-site-template's People

Contributors

calebschoepp avatar itowlson avatar jagile avatar jmu avatar karthik2804 avatar michellen avatar radu-matei avatar technosophos avatar tpmccallum avatar vdice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bartholomew-site-template's Issues

Update for Spin 0.4

I haven't actually tried, but I assume these modules will need to be recompiled.

dockerfile, docker-compose, and init.sh

I made a docker config to automatically have my site in a container. I'd be happy to provide a PR, or you can take what I have here:

cat Dockerfile

FROM ubuntu:latest

WORKDIR /root

RUN apt-get update && apt-get install -y vim curl git && rm -rf /var/lib/apt

RUN curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash && mv ./spin /usr/local/bin/

RUN VERSION=$(curl -so- https://github.com/fermyon/bartholomew/releases | grep 'href="/fermyon/bartholomew/releases/tag/v[0-9]*.[0-9]*.[0-9]*\"' | sed -E 's/.*\/fermyon\/bartholomew\/releases\/tag\/(v[0-9\.]+)".*/\1/g' | head -1) && curl -fsOL "https://github.com/fermyon/bartholomew/releases/download/${VERSION}/bart-cli-${VERSION}-linux-amd64.tar.gz" && tar -xvzf bart-cli*.tar.gz && mv ./bart /usr/local/bin/ && rm bart-cli*.tar.gz 

EXPOSE 3000
COPY ./init.sh /root/init.sh
RUN chmod +x /root/init.sh
CMD /root/init.sh

cat docker-compose

version: '3.8'

services:
  bart:
    container_name: bart
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - ./ssh:/root/.ssh
    environment:
      - GIT_URL="git.sendthemtomir.com"
      - GIT_PORT=10022
      - GIT_REPO="/mbushey/bart-mir.git"
    ports:
      - "3000:3000"

cat init.sh

#!/bin/bash

if [ -z $GIT_URL ]; then
  export GIT_URL=github.com
  echo "ENV var GIT_URL not set. Setting to: '$GIT_URL'"
fi

if [ -z $GIT_PORT ]; then
  export GIT_PORT=22
  echo "ENV var GIT_PORT not set. Setting to: $GIT_PORT"
fi

if [ -z $GIT_REPO ]; then
  export GIT_REPO="/fermyon/bartholomew-site-template.git"
  echo "ENV var GIT_REPO not set. Setting to: '$GIT_REPO'"
fi

chmod 700 /root/.ssh
chmod 700 /root/.ssh/id_ed25519

if [ ! -f /root/.ssh/id_ed25519.pub ]; then
  echo "SSH key not found, generating"
  ssh-keygen -t ed25519 -C "bart" -f "/root/.ssh/id_ed25519" -q -N ""
  echo "Please add this key as a read-only deploy key to your git repo:"
  cat /root/.ssh/id_ed25519.pub
fi

## Recreate known_hosts ONLY if host does not exist in ~/.ssh/known_hosts
ssh-keygen -F "[${GIT_URL}]:${GIT_PORT}" || echo "Generating .ssh/known_hosts" && ssh-keyscan -p $GIT_PORT $GIT_URL > ~/.ssh/known_hosts

if [ ! -d bart ]; then
  git clone ssh://git@${GIT_URL}:${GIT_PORT}${GIT_REPO} bart
  if [ $? != 0 ]; then
    echo "Clone failed."
    echo "Make sure This key has perms to pull at $GIT_URL:"
    cat /root/.ssh/id_ed25519.pub
  fi
fi

cd bart
git pull
spin up --listen 0.0.0.0:3000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.