Skip to content

Commit

Permalink
prepare migration to smocker-dev org
Browse files Browse the repository at this point in the history
disable sonar temporarily

update docker login vars
  • Loading branch information
Thiht committed Mar 15, 2024
1 parent 29b5a33 commit 6d53eed
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 45 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: CI
on:
push:
branches:
- master
- main
tags:
- '*.*.*' # semver, will override latest
- '*-preview' # preview, won't override latest
pull_request:
branches:
- master
- main
workflow_dispatch: # Allow manual trigger

jobs:
Expand Down Expand Up @@ -118,11 +118,13 @@ jobs:
- name: Docker login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
Expand All @@ -132,8 +134,7 @@ jobs:
run: make VERSION=${{ steps.extract_ref.outputs.GIT_REF }} deploy-docker

- name: Deploy on GitHub releases
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: build/smocker.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.GH_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ node_modules/
sessions/
smocker
smocker.test
vendor/
yarn-error.log
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM golang:1.18-alpine AS build-backend
ARG GO_VERSION=1.22
FROM golang:${GO_VERSION}-alpine AS build-backend
RUN apk add --no-cache make
ARG VERSION=snapshot
ARG COMMIT
WORKDIR /go/src/github.com/Thiht/smocker
WORKDIR /go/src/smocker
COPY go.mod go.sum ./
RUN go mod download
COPY Makefile main.go ./
Expand All @@ -13,5 +14,5 @@ FROM alpine
WORKDIR /opt
EXPOSE 8080 8081
COPY build/client client/
COPY --from=build-backend /go/src/github.com/Thiht/smocker/build/* /opt/
COPY --from=build-backend /go/src/smocker/build/* /opt/
CMD ["/opt/smocker"]
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ ifeq ($(RELEASE), 1)
endif
GO_LDFLAGS:=-ldflags="$(GO_LDFLAGS)"

DOCKER_ACCOUNT?=thiht
DOCKER_IMAGE=$(DOCKER_ACCOUNT)/$(APPNAME)
DOCKER_IMAGE=ghcr.io/smocker-dev/smocker

# See: https://docs.docker.com/engine/reference/commandline/tag/#extended-description
# A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes.
Expand Down Expand Up @@ -63,7 +62,7 @@ start: $(REFLEX)

.PHONY: build
build:
go build $(GO_LDFLAGS) -o ./build/$(APPNAME)
go build -trimpath $(GO_LDFLAGS) -o ./build/$(APPNAME)

.PHONY: lint
lint: $(GOLANGCILINT)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<img src="./docs/logo-horizontal.png" alt="Smocker" height="100" title="Smocker logo by mandyellow" />
</h1>

[![CI](https://github.com/Thiht/smocker/actions/workflows/main.yml/badge.svg)](https://github.com/Thiht/smocker/actions/workflows/main.yml)
[![Docker Repository](https://img.shields.io/badge/docker-thiht%2Fsmocker-blue?logo=docker)](https://hub.docker.com/r/thiht/smocker)
[![Github Release](https://img.shields.io/github/v/release/Thiht/smocker.svg?logo=github)](https://github.com/Thiht/smocker/releases/latest)
[![Go Report Card](https://goreportcard.com/badge/github.com/Thiht/smocker)](https://goreportcard.com/report/github.com/Thiht/smocker)
[![License](https://img.shields.io/github/license/Thiht/smocker?logo=open-source-initiative)](https://github.com/Thiht/smocker/blob/master/LICENSE)
[![CI](https://github.com/smocker-dev/smocker/actions/workflows/main.yml/badge.svg)](https://github.com/smocker-dev/smocker/actions/workflows/main.yml)
<!-- TODO: replace with ghcr badge [![Docker Repository](https://img.shields.io/badge/docker-thiht%2Fsmocker-blue?logo=docker)](https://hub.docker.com/r/thiht/smocker) -->
[![Github Release](https://img.shields.io/github/v/release/smocker-dev/smocker.svg?logo=github)](https://github.com/smocker-dev/smocker/releases/latest)
[![Go Report Card](https://goreportcard.com/badge/github.com/smocker-dev/smocker)](https://goreportcard.com/report/github.com/smocker-dev/smocker)
[![License](https://img.shields.io/github/license/smocker-dev/smocker?logo=open-source-initiative)](https://github.com/smocker-dev/smocker/blob/main/LICENSE)

**Smocker** (server mock) is a simple and efficient HTTP mock server.

Expand Down Expand Up @@ -40,15 +40,15 @@ docker run -d \
-p 8080:8080 \
-p 8081:8081 \
--name smocker \
thiht/smocker
ghcr.io/smocker-dev/smocker
```

### Manual Deployment

```sh
# This will be the deployment folder for the Smocker instance
mkdir -p /opt/smocker && cd /opt/smocker
wget -P /tmp https://github.com/Thiht/smocker/releases/latest/download/smocker.tar.gz
wget -P /tmp https://github.com/smocker-dev/smocker/releases/latest/download/smocker.tar.gz
tar xf /tmp/smocker.tar.gz
nohup ./smocker -mock-server-listen-port=8080 -config-listen-port=8081 &
```
Expand Down
2 changes: 1 addition & 1 deletion client/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const App = () => (
Smocker version {window.version} &ndash; MIT Licensed
<br />
<a
href="https://github.com/Thiht/smocker"
href="https://github.com/smocker-dev/smocker"
title="Smocker on GitHub"
target="_blank"
rel="noreferrer"
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 github.com/Thiht/smocker
module github.com/smocker-dev/smocker

go 1.15

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package main
import (
"os"

"github.com/Thiht/smocker/server"
"github.com/Thiht/smocker/server/config"
"github.com/namsral/flag"
log "github.com/sirupsen/logrus"
"github.com/smocker-dev/smocker/server"
"github.com/smocker-dev/smocker/server/config"
)

var appName, buildVersion, buildCommit, buildDate string // nolint
Expand Down
6 changes: 3 additions & 3 deletions server/admin_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
"net/http"
"strconv"

"github.com/Thiht/smocker/server/config"
"github.com/Thiht/smocker/server/handlers"
"github.com/Thiht/smocker/server/services"
"github.com/facebookgo/grace/gracehttp"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
log "github.com/sirupsen/logrus"
"github.com/smocker-dev/smocker/server/config"
"github.com/smocker-dev/smocker/server/handlers"
"github.com/smocker-dev/smocker/server/services"
)

// TemplateRenderer is a custom html/template renderer for Echo framework
Expand Down
4 changes: 2 additions & 2 deletions server/handlers/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"net/http"
"strconv"

"github.com/Thiht/smocker/server/services"
"github.com/Thiht/smocker/server/types"
"github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
"github.com/smocker-dev/smocker/server/services"
"github.com/smocker-dev/smocker/server/types"
)

type Admin struct {
Expand Down
6 changes: 3 additions & 3 deletions server/handlers/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"sync"
"time"

"github.com/Thiht/smocker/server/services"
"github.com/Thiht/smocker/server/templates"
"github.com/Thiht/smocker/server/types"
"github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
"github.com/smocker-dev/smocker/server/services"
"github.com/smocker-dev/smocker/server/templates"
"github.com/smocker-dev/smocker/server/types"
"gopkg.in/yaml.v3"
)

Expand Down
4 changes: 2 additions & 2 deletions server/middlewares.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"runtime"
"time"

"github.com/Thiht/smocker/server/services"
"github.com/Thiht/smocker/server/types"
"github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
"github.com/smocker-dev/smocker/server/services"
"github.com/smocker-dev/smocker/server/types"
)

type bodyDumpResponseWriter struct {
Expand Down
6 changes: 3 additions & 3 deletions server/mock_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"net/http"
"strconv"

"github.com/Thiht/smocker/server/config"
"github.com/Thiht/smocker/server/handlers"
"github.com/Thiht/smocker/server/services"
"github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
"github.com/smocker-dev/smocker/server/config"
"github.com/smocker-dev/smocker/server/handlers"
"github.com/smocker-dev/smocker/server/services"
)

func NewMockServer(cfg config.Config) (*http.Server, services.Mocks) {
Expand Down
2 changes: 1 addition & 1 deletion server/services/graphs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"
"time"

"github.com/Thiht/smocker/server/types"
"github.com/smocker-dev/smocker/server/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion server/services/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

"github.com/Thiht/smocker/server/types"
"github.com/smocker-dev/smocker/server/types"
"github.com/teris-io/shortid"
)

Expand Down
2 changes: 1 addition & 1 deletion server/services/persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"path/filepath"
"sync"

"github.com/Thiht/smocker/server/types"
log "github.com/sirupsen/logrus"
"github.com/smocker-dev/smocker/server/types"
"golang.org/x/sync/errgroup"
"gopkg.in/yaml.v3"
)
Expand Down
2 changes: 1 addition & 1 deletion server/templates/go_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"text/template"

"github.com/Masterminds/sprig/v3"
"github.com/Thiht/smocker/server/types"
log "github.com/sirupsen/logrus"
"github.com/smocker-dev/smocker/server/types"
"gopkg.in/yaml.v3"
)

Expand Down
2 changes: 1 addition & 1 deletion server/templates/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package templates
import (
"fmt"

"github.com/Thiht/smocker/server/types"
"github.com/smocker-dev/smocker/server/types"
)

type TemplateEngine interface {
Expand Down
2 changes: 1 addition & 1 deletion server/templates/lua.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"time"

"github.com/Thiht/smocker/server/types"
goJson "github.com/layeh/gopher-json"
log "github.com/sirupsen/logrus"
"github.com/smocker-dev/smocker/server/types"
"github.com/yuin/gluamapper"
lua "github.com/yuin/gopher-lua"
luar "layeh.com/gopher-luar"
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sonar.organization=thiht
sonar.organization=smocker
sonar.projectKey=Thiht_smocker
sonar.projectName=Smocker

Expand Down

0 comments on commit 6d53eed

Please sign in to comment.