From 3b7de13b802f0f5f3830f1c0e0a832879224a10d Mon Sep 17 00:00:00 2001 From: Alexey S Date: Wed, 18 May 2022 15:19:33 +0300 Subject: [PATCH] Test probot settings config (#19) --- .github/settings.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 14 +++++++------- Dockerfile.dev | 12 ++++++++---- 3 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 .github/settings.yml diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 0000000..2b2979e --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,46 @@ +# These settings are synced to GitHub by https://probot.github.io/apps/settings/ +_extends: .github + +teams: + - name: devs + permission: push + - name: bots + permission: push + - name: maintainers + permission: push + - name: erlang + permission: maintain + +branches: + - name: "master" + # https://developer.github.com/v3/repos/branches/#update-branch-protection + # Branch Protection settings. Set to null to disable + protection: + required_pull_request_reviews: + required_approving_review_count: 1 + dismiss_stale_reviews: false + require_code_owner_reviews: true + dismissal_restrictions: {} + required_status_checks: + strict: true + checks: + - context: "Load .env" + app_id: 15368 + - context: "Run checks / Build" + app_id: 15368 + - context: "Run checks / Check" + app_id: 15368 + - context: "Run checks / Dialyze" + app_id: 15368 + - context: "Run checks / Test" + app_id: 15368 + - context: "codecov/patch" + app_id: 254 + - context: "codecov/project" + app_id: 254 + enforce_admins: false + required_conversation_resolution: false + required_linear_history: true + restrictions: null + allow_force_pushes: false + allow_deletions: false diff --git a/Dockerfile b/Dockerfile index ee06622..ec0732d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ ARG OTP_VERSION # Build the release FROM docker.io/library/erlang:${OTP_VERSION} AS builder +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Install thrift compiler ARG THRIFT_VERSION - ARG TARGETARCH RUN wget -q -O- "https://github.com/valitydev/thrift/releases/download/${THRIFT_VERSION}/thrift-${THRIFT_VERSION}-linux-${TARGETARCH}.tar.gz" \ | tar -xvz -C /usr/local/bin/ @@ -16,8 +16,8 @@ COPY . /build/ # Build the release WORKDIR /build -RUN rebar3 compile -RUN rebar3 as prod release +RUN rebar3 compile && \ + rebar3 as prod release # Make a runner image FROM docker.io/library/erlang:${OTP_VERSION}-slim @@ -28,15 +28,15 @@ ARG SERVICE_NAME ENV CHARSET=UTF-8 ENV LANG=C.UTF-8 -# Expose SERVICE_NAME as env so CMD expands properly on start -ENV SERVICE_NAME=${SERVICE_NAME} - # Set runtime WORKDIR /opt/${SERVICE_NAME} COPY --from=builder /build/_build/prod/rel/${SERVICE_NAME} /opt/${SERVICE_NAME} +RUN echo "#!/bin/sh" >> /entrypoint.sh && \ + echo "exec /opt/${SERVICE_NAME}/bin/${SERVICE_NAME} foreground" >> /entrypoint.sh && \ + chmod +x /entrypoint.sh ENTRYPOINT [] -CMD /opt/${SERVICE_NAME}/bin/${SERVICE_NAME} foreground +CMD ["/entrypoint.sh"] EXPOSE 8022 diff --git a/Dockerfile.dev b/Dockerfile.dev index b2805aa..e4cfa53 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,13 +1,17 @@ ARG OTP_VERSION FROM docker.io/library/erlang:${OTP_VERSION} +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# Install thrift compiler ARG THRIFT_VERSION -ARG BUILDARCH - -RUN wget -q -O- "https://github.com/valitydev/thrift/releases/download/${THRIFT_VERSION}/thrift-${THRIFT_VERSION}-linux-${BUILDARCH}.tar.gz" \ +ARG TARGETARCH +RUN wget -q -O- "https://github.com/valitydev/thrift/releases/download/${THRIFT_VERSION}/thrift-${THRIFT_VERSION}-linux-${TARGETARCH}.tar.gz" \ | tar -xvz -C /usr/local/bin/ +# Set env ENV CHARSET=UTF-8 ENV LANG=C.UTF-8 -CMD /bin/bash + +# Set runtime +CMD ["/bin/bash"]