Skip to content

Commit

Permalink
rename project (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
philmtd authored Nov 1, 2021
1 parent 6d681dc commit 4ffc45c
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 42 deletions.
28 changes: 14 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
- checkout
- restore_cache:
keys:
- oneko-url-trigger-go-mod-{{ checksum "go.sum" }}
- oneko-catnip-go-mod-{{ checksum "go.sum" }}
- run:
name: Install dependencies
command: go mod download
- save_cache:
key: oneko-url-trigger-go-mod-{{ checksum "go.sum" }}
key: oneko-catnip-go-mod-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
- run:
Expand All @@ -31,9 +31,9 @@ jobs:
- run:
name: Build the application
command: make go-build-for-docker
- run: mkdir ./circle-artifacts && cp ./o-neko-url-trigger ./circle-artifacts/
- run: mkdir ./circle-artifacts && cp ./o-neko-catnip ./circle-artifacts/
- save_cache:
key: oneko-url-trigger-artifacts-{{ .Environment.CIRCLE_SHA1 }}
key: oneko-catnip-artifacts-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ./circle-artifacts/
- store_artifacts:
Expand All @@ -46,11 +46,11 @@ jobs:
- checkout
- setup_remote_docker
- restore_cache:
key: oneko-url-trigger-artifacts-{{ .Environment.CIRCLE_SHA1 }}
- run: cp ./circle-artifacts/o-neko-url-trigger .
- run: docker build -t subshellgmbh/o-neko-url-trigger:latest-dev .
key: oneko-catnip-artifacts-{{ .Environment.CIRCLE_SHA1 }}
- run: cp ./circle-artifacts/o-neko-catnip .
- run: docker build -t subshellgmbh/o-neko-catnip:latest-dev .
- run: echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- run: docker push subshellgmbh/o-neko-url-trigger:latest-dev
- run: docker push subshellgmbh/o-neko-catnip:latest-dev

release:
docker:
Expand All @@ -59,13 +59,13 @@ jobs:
- checkout
- setup_remote_docker
- restore_cache:
key: oneko-url-trigger-artifacts-{{ .Environment.CIRCLE_SHA1 }}
- run: cp ./circle-artifacts/o-neko-url-trigger .
- run: docker build -t subshellgmbh/o-neko-url-trigger:latest .
- run: docker tag subshellgmbh/o-neko-url-trigger:latest subshellgmbh/o-neko-url-trigger:$CIRCLE_TAG
key: oneko-catnip-artifacts-{{ .Environment.CIRCLE_SHA1 }}
- run: cp ./circle-artifacts/o-neko-catnip .
- run: docker build -t subshellgmbh/o-neko-catnip:latest .
- run: docker tag subshellgmbh/o-neko-catnip:latest subshellgmbh/o-neko-catnip:$CIRCLE_TAG
- run: echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- run: docker push subshellgmbh/o-neko-url-trigger:latest
- run: docker push subshellgmbh/o-neko-url-trigger:$CIRCLE_TAG
- run: docker push subshellgmbh/o-neko-catnip:latest
- run: docker push subshellgmbh/o-neko-catnip:$CIRCLE_TAG

workflows:
version: 2
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ linter_results.xml
.idea
*.iml

o-neko-url-trigger
!*/o-neko-url-trigger/
o-neko-catnip
!*/o-neko-catnip/
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ FROM scratch
# Import from builder.
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

ADD /o-neko-url-trigger /app/
ADD /o-neko-catnip /app/
ADD /config/application-default.yaml /app/config/
ADD /public /app/public

WORKDIR /app

CMD ["/app/o-neko-url-trigger", "server"]
CMD ["/app/o-neko-catnip", "server"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ clean: go-clean
build-and-docker: go-build-for-docker docker

docker:
docker build -t subshellgmbh/o-neko-url-trigger .
docker build -t subshellgmbh/o-neko-catnip .
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# O-Neko URL Trigger
# O-Neko Catnip

[![CircleCI](https://circleci.com/gh/subshell/o-neko-url-trigger/tree/master.svg?style=svg)](https://circleci.com/gh/subshell/o-neko-url-trigger/tree/master)
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/subshellgmbh/o-neko-url-trigger?color=2496ED&label=subshellgmbh%2Fo-neko-url-trigger&logo=docker&logoColor=white&sort=semver)](https://hub.docker.com/r/subshellgmbh/o-neko-url-trigger/tags)
[![CircleCI](https://circleci.com/gh/subshell/o-neko-catnip/tree/master.svg?style=svg)](https://circleci.com/gh/subshell/o-neko-catnip/tree/master)
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/subshellgmbh/o-neko-catnip?color=2496ED&label=subshellgmbh%2Fo-neko-catnip&logo=docker&logoColor=white&sort=semver)](https://hub.docker.com/r/subshellgmbh/o-neko-catnip/tags)

This is an optional extension application for [O-Neko](https://github.com/subshell/o-neko/). Its purpose is to be used as a default backend / default ingress
for stopped O-Neko deployments. It will then try to start the deployment with the URL it has been loaded with and will then redirect the user to the deployment
once it started.

[![O-Neko URL trigger](./docs/screenshot_small.png)](./docs/screenshot.png)
[![O-Neko Catnip](./docs/screenshot_small.png)](./docs/screenshot.png)

## Why

Expand Down
4 changes: 2 additions & 2 deletions cmd/o-neko-url-trigger/root.go → cmd/o-neko-catnip/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"flag"
"fmt"
"github.com/spf13/cobra"
"o-neko-url-trigger/pkg/o-neko-url-trigger/logger"
"o-neko-catnip/pkg/o-neko-catnip/logger"
"os"
)

Expand All @@ -25,7 +25,7 @@ func init() {
commandVersion = fmt.Sprintf("%s (%s)", GitTag, GitCommit)
}
rootCmd = &cobra.Command{
Use: "o-neko-url-trigger [flags]",
Use: "o-neko-catnip [flags]",
Short: "This tool starts O-Neko deployments by its URL when used as a default HTTP backend.",
Long: "This tool starts stopped O-Neko deployments by its URL when used as a default HTTP backend in your infrastructure.",
SilenceUsage: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"context"
"github.com/spf13/cobra"
"o-neko-url-trigger/pkg/o-neko-url-trigger/config"
"o-neko-url-trigger/pkg/o-neko-url-trigger/server"
"o-neko-catnip/pkg/o-neko-catnip/config"
"o-neko-catnip/pkg/o-neko-catnip/server"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ LDFLAGS += -ldflags '-extldflags "-static" -s -w -X=main.GitTag=$(VERSION) -X
BUILDFLAGS += -installsuffix cgo --tags release

BUILD_PATH ?= $(shell pwd)
CMD = $(BUILD_PATH)/o-neko-url-trigger
CMD_SRC = cmd/o-neko-url-trigger/*.go
CMD = $(BUILD_PATH)/o-neko-catnip
CMD_SRC = cmd/o-neko-catnip/*.go

all: test lint build

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module o-neko-url-trigger
module o-neko-catnip

go 1.17

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package logger

import (
"fmt"
"o-neko-url-trigger/pkg/o-neko-url-trigger/config"
"o-neko-catnip/pkg/o-neko-catnip/config"

"go.uber.org/zap"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/go-resty/resty/v2"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"o-neko-url-trigger/pkg/o-neko-url-trigger/config"
"o-neko-catnip/pkg/o-neko-catnip/config"
"regexp"
"strings"
"time"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"
"net/http"
"o-neko-url-trigger/pkg/o-neko-url-trigger/config"
"o-neko-url-trigger/pkg/o-neko-url-trigger/logger"
"o-neko-catnip/pkg/o-neko-catnip/config"
"o-neko-catnip/pkg/o-neko-catnip/logger"
"time"

"github.com/ReneKroon/ttlcache/v2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"github.com/jarcoal/httpmock"
"github.com/stretchr/testify/assert"
"o-neko-url-trigger/pkg/o-neko-url-trigger/config"
"o-neko-catnip/pkg/o-neko-catnip/config"
"os"
"testing"
"time"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"html/template"
"log"
"net/http"
"o-neko-url-trigger/pkg/o-neko-url-trigger/config"
"o-neko-url-trigger/pkg/o-neko-url-trigger/logger"
"o-neko-url-trigger/pkg/o-neko-url-trigger/metrics"
"o-neko-url-trigger/pkg/o-neko-url-trigger/oneko"
"o-neko-catnip/pkg/o-neko-catnip/config"
"o-neko-catnip/pkg/o-neko-catnip/logger"
"o-neko-catnip/pkg/o-neko-catnip/metrics"
"o-neko-catnip/pkg/o-neko-catnip/oneko"
"os"
"os/signal"
"syscall"
Expand Down Expand Up @@ -97,13 +97,13 @@ type templateParameters struct {
}

func (s *TriggerServer) handleHeadRequests(c *gin.Context) {
c.Header("oneko-url-trigger", s.appVersion)
c.Header("oneko-catnip", s.appVersion)
c.Status(http.StatusOK)
}

func (s *TriggerServer) handleGetRequests(c *gin.Context) {
project, version, err := s.oneko.HandleRequest(c.Request.Host, c.Request.RequestURI)
c.Header("oneko-url-trigger", s.appVersion)
c.Header("oneko-catnip", s.appVersion)
if err != nil {
c.HTML(http.StatusBadRequest, "error.html.gotmpl", gin.H{
"error": err.Error(),
Expand Down
2 changes: 1 addition & 1 deletion public/static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function checkIfDeploymentIsReady() {
// apparently something is happening but the service is not available yet
console.log("new deployment not available yet");
setTimeout(() => checkIfDeploymentIsReady(), 1000);
} else if (response.headers.has("oneko-url-trigger")) {
} else if (response.headers.has("oneko-catnip")) {
// still oneko
console.log("still o-neko");
setTimeout(() => checkIfDeploymentIsReady(), 1000);
Expand Down

0 comments on commit 4ffc45c

Please sign in to comment.