From 02615088ffc0150b9774a271aaeb30dce5c1aae8 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Fri, 28 Dec 2018 12:41:45 -0500 Subject: [PATCH] everywhere: remove -ce suffix --- Dockerfile | 34 +++++++++---------- api/Makefile | 4 +-- docker-compose.yml | 2 +- etc/bsd-rc/commento | 28 +++++++++++++++ etc/bsd-rc/commento_ce | 28 --------------- .../{commento-ce.service => commento.service} | 6 ++-- frontend/package.json | 4 +-- scripts/autoserve | 2 +- 8 files changed, 54 insertions(+), 54 deletions(-) create mode 100755 etc/bsd-rc/commento delete mode 100755 etc/bsd-rc/commento_ce rename etc/linux-systemd/{commento-ce.service => commento.service} (70%) diff --git a/Dockerfile b/Dockerfile index 3c23dd3..6eea16c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # backend build (api server) FROM golang:1.10.2-alpine AS api-build -COPY ./api /go/src/commento-ce/api -WORKDIR /go/src/commento-ce/api +COPY ./api /go/src/commento/api +WORKDIR /go/src/commento/api RUN apk update && apk add bash make git curl RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh @@ -13,8 +13,8 @@ RUN make prod -j$(($(nproc) + 1)) # frontend build (html, js, css, images) FROM node:10.3.0-alpine AS frontend-build -COPY ./frontend /commento-ce/frontend/ -WORKDIR /commento-ce/frontend/ +COPY ./frontend /commento/frontend/ +WORKDIR /commento/frontend/ RUN apk update && apk add bash make RUN npm install -g html-minifier@3.5.7 uglify-js@3.4.1 sass@1.5.1 @@ -25,8 +25,8 @@ RUN make prod -j$(($(nproc) + 1)) # templates build FROM alpine:3.7 AS templates-build -COPY ./templates /commento-ce/templates -WORKDIR /commento-ce/templates +COPY ./templates /commento/templates +WORKDIR /commento/templates RUN apk update && apk add bash make @@ -36,8 +36,8 @@ RUN make prod -j$(($(nproc) + 1)) # db build FROM alpine:3.7 AS db-build -COPY ./db /commento-ce/db -WORKDIR /commento-ce/db +COPY ./db /commento/db +WORKDIR /commento/db RUN apk update && apk add bash make @@ -47,19 +47,19 @@ RUN make prod -j$(($(nproc) + 1)) # final image FROM alpine:3.7 -COPY --from=api-build /go/src/commento-ce/api/build/prod/commento-ce /commento-ce/commento-ce -COPY --from=frontend-build /commento-ce/frontend/build/prod/*.html /commento-ce/ -COPY --from=frontend-build /commento-ce/frontend/build/prod/css/*.css /commento-ce/css/ -COPY --from=frontend-build /commento-ce/frontend/build/prod/js/*.js /commento-ce/js/ -COPY --from=frontend-build /commento-ce/frontend/build/prod/images/* /commento-ce/images/ -COPY --from=templates-build /commento-ce/templates/build/prod/templates/ /commento-ce/templates/ -COPY --from=db-build /commento-ce/db/build/prod/db/ /commento-ce/db/ +COPY --from=api-build /go/src/commento/api/build/prod/commento /commento/commento +COPY --from=frontend-build /commento/frontend/build/prod/*.html /commento/ +COPY --from=frontend-build /commento/frontend/build/prod/css/*.css /commento/css/ +COPY --from=frontend-build /commento/frontend/build/prod/js/*.js /commento/js/ +COPY --from=frontend-build /commento/frontend/build/prod/images/* /commento/images/ +COPY --from=templates-build /commento/templates/build/prod/templates/ /commento/templates/ +COPY --from=db-build /commento/db/build/prod/db/ /commento/db/ RUN apk update && apk add ca-certificates --no-cache EXPOSE 8080 -WORKDIR /commento-ce/ +WORKDIR /commento/ ENV COMMENTO_BIND_ADDRESS="0.0.0.0" -ENTRYPOINT ["/commento-ce/commento-ce"] +ENTRYPOINT ["/commento/commento"] diff --git a/api/Makefile b/api/Makefile index 7285014..bff8edb 100644 --- a/api/Makefile +++ b/api/Makefile @@ -7,9 +7,9 @@ PROD_BUILD_DIR = $(BUILD_DIR)/prod GO_SRC_DIR = . GO_SRC_FILES = $(wildcard $(GO_SRC_DIR)/*.go) GO_DEVEL_BUILD_DIR = $(DEVEL_BUILD_DIR) -GO_DEVEL_BUILD_BINARY = $(GO_DEVEL_BUILD_DIR)/commento-ce +GO_DEVEL_BUILD_BINARY = $(GO_DEVEL_BUILD_DIR)/commento GO_PROD_BUILD_DIR = $(PROD_BUILD_DIR) -GO_PROD_BUILD_BINARY = $(GO_PROD_BUILD_DIR)/commento-ce +GO_PROD_BUILD_BINARY = $(GO_PROD_BUILD_DIR)/commento devel: devel-go diff --git a/docker-compose.yml b/docker-compose.yml index f52763c..0fa719a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: server: - image: registry.gitlab.com/commento/commento-ce + image: registry.gitlab.com/commento/commento ports: - 8080:8080 environment: diff --git a/etc/bsd-rc/commento b/etc/bsd-rc/commento new file mode 100755 index 0000000..f33263a --- /dev/null +++ b/etc/bsd-rc/commento @@ -0,0 +1,28 @@ +#!/bin/sh + +# PROVIDE: commento +# REQUIRE: LOGIN postgresql +# KEYWORD: shutdown + +PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" + +. /etc/rc.subr + +desc="Commento daemon" +name=commento +rcvar=commento_enable + +load_rc_config $name + +: ${commento_enable:=NO} + +commento_env="COMMENTO_ORIGIN=https://commento.example.com \ +COMMENTO_PORT=8080 \ +COMMENTO_POSTGRES=postgres://commento:commento@db:5432/commento?sslmode=disable \ +COMMENTO_STATIC=/usr/local/share/commento" +commento_user=www + +command="/usr/local/bin/commento" +command_args=" >> /var/log/commento/${name}.log 2>&1 &" + +run_rc_command "$1" diff --git a/etc/bsd-rc/commento_ce b/etc/bsd-rc/commento_ce deleted file mode 100755 index 89fd72a..0000000 --- a/etc/bsd-rc/commento_ce +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# PROVIDE: commento_ce -# REQUIRE: LOGIN postgresql -# KEYWORD: shutdown - -PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" - -. /etc/rc.subr - -desc="Commento CE daemon" -name=commento_ce -rcvar=commento_ce_enable - -load_rc_config $name - -: ${commento_ce_enable:=NO} - -commento_ce_env="COMMENTO_ORIGIN=https://commento.example.com \ -COMMENTO_PORT=8080 \ -COMMENTO_POSTGRES=postgres://commento:commento@db:5432/commento?sslmode=disable \ -COMMENTO_STATIC=/usr/local/share/commento-ce" -commento_ce_user=www - -command="/usr/local/bin/commento-ce" -command_args=" >> /var/log/commento_ce/${name}.log 2>&1 &" - -run_rc_command "$1" diff --git a/etc/linux-systemd/commento-ce.service b/etc/linux-systemd/commento.service similarity index 70% rename from etc/linux-systemd/commento-ce.service rename to etc/linux-systemd/commento.service index 4539f03..f998f0b 100644 --- a/etc/linux-systemd/commento-ce.service +++ b/etc/linux-systemd/commento.service @@ -1,14 +1,14 @@ [Unit] -Description=Commento-CE daemon service +Description=Commento daemon service After=network.target postgresql.service [Service] Type=simple -ExecStart=/usr/bin/commento-ce +ExecStart=/usr/bin/commento Environment=COMMENTO_ORIGIN=https://commento.example.com Environment=COMMENTO_PORT=8080 Environment=COMMENTO_POSTGRES=postgres://commento:commento@db:5432/commento?sslmode=disable -Environment=COMMENTO_STATIC=/usr/share/commento-ce +Environment=COMMENTO_STATIC=/usr/share/commento [Install] WantedBy=multi-user.target diff --git a/frontend/package.json b/frontend/package.json index af95427..d61f047 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,8 +1,8 @@ { - "name": "commento-ce", + "name": "commento", "version": "1.0.0", "main": "index.js", - "repository": "git@gitlab.com:commento/commento-ce.git", + "repository": "git@gitlab.com:commento/commento.git", "author": "Adhityaa Anton Linevych anton@linevich.net", "license": "MIT", "private": true, diff --git a/scripts/autoserve b/scripts/autoserve index 43834de..63ec0d8 100755 --- a/scripts/autoserve +++ b/scripts/autoserve @@ -1,6 +1,6 @@ #!/usr/bin/env bash -binary_name=commento-ce +binary_name=commento trap ctrl_c INT ctrl_c() {