diff --git a/.github/workflows/action.yaml b/.github/workflows/action.yaml index cafca95..0184656 100644 --- a/.github/workflows/action.yaml +++ b/.github/workflows/action.yaml @@ -10,6 +10,6 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: LGTM - uses: beeceej/lgtm@v0.0.4 + uses: beeceej/lgtm@v0.0.6 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Dockerfile b/Dockerfile index b9a4cf3..5943349 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,2 @@ -FROM debian:buster-slim -RUN apt-get update -y && apt-get install netbase -y -ADD . . -ENTRYPOINT ./bin/entrypoint +FROM beeceej/lgtm:v0.0.5 +ENTRYPOINT [ "bin/lgtm" ] diff --git a/Dockerfile.release b/Dockerfile.release index 52dd0fd..291a4f7 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -12,6 +12,9 @@ RUN opam install -y dune \ atdgen ADD . . RUN sudo chown -R opam:nogroup . -RUN ./bin/build -RUN mkdir release -RUN mv _build/default/src/main.exe release/lgtm +RUN bin/build + +FROM debian:buster-slim +RUN apt-get update -y && apt-get install -y \ + netbase -y +COPY --from=build /home/opam/opam-repository/lgtm/_build/default/src/main.exe bin/lgtm \ No newline at end of file diff --git a/Makefile b/Makefile index 1de88d2..558a4f4 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,26 @@ -VERSION := "v0.0.4" -RELEASE_IMAGE := beeceej/lgtm:release +USER := beeceej +IMAGE := lgtm +VERSION := v0.0.6 +REPOSITORY:= $(USER)/$(IMAGE):$(VERSION) -release: clean lgtm - git tag -a "$(VERSION)" -m "release $(VERSION)" - git push --tags -lgtm: docker-release - docker run -it --rm -v "$${PWD}/release:/home/opam/opam-repository/lgtm/tmp" beeceej/lgtm:release mv release/lgtm tmp/lgtm +build: + docker build -t $(REPOSITORY) -f Dockerfile.release . + +tag: + docker tag $(REPOSITORY) $(REPOSITORY) + +push: + docker push $(REPOSITORY) -docker-release: - docker build -t $(RELEASE_IMAGE) -f Dockerfile.release . +Dockerfile: + bin/generate_dockerfile $(VERSION) clean: - rm -rf release + rm Dockerfile + +git-release: + git tag -a "$(VERSION)" -m "release $(VERSION)" + git push --tags -.PHONY: clean docker-release +release: clean build push Dockerfile git-release diff --git a/bin/entrypoint b/bin/entrypoint deleted file mode 100755 index bcbd6ef..0000000 --- a/bin/entrypoint +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -./release/lgtm diff --git a/bin/entrypoint~ b/bin/entrypoint~ deleted file mode 100755 index 88d4eaf..0000000 --- a/bin/entrypoint~ +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh - -/lgtm diff --git a/bin/generate_dockerfile b/bin/generate_dockerfile new file mode 100755 index 0000000..0bb9482 --- /dev/null +++ b/bin/generate_dockerfile @@ -0,0 +1,9 @@ +#! /bin/sh + +readonly dockerfile=$(cat < Dockerfile diff --git a/release/lgtm b/release/lgtm deleted file mode 100755 index aae6d21..0000000 Binary files a/release/lgtm and /dev/null differ