Add back continuous delivery

pull/136/head
Aloïs Micard 3 years ago
parent ddcf5b40a8
commit d7e663fef6
No known key found for this signature in database
GPG Key ID: 1A0EB82F071F5EFE

3
.gitignore vendored

@ -1,2 +1,3 @@
.idea/
**/**_mock.go
**/**_mock.go
dist/

@ -37,6 +37,57 @@ builds:
- linux
goarch:
- amd64
dockers:
- goos: linux
goarch: amd64
binaries:
- bs-blacklister
image_templates:
- "creekorful/bs-blacklister:latest"
- "creekorful/bs-blacklister:{{ replace .Tag \"v\" \"\" }}"
- "creekorful/bs-blacklister:{{ .Major }}"
skip_push: false
dockerfile: build/docker/Dockerfile.blacklister
- goos: linux
goarch: amd64
binaries:
- bs-configapi
image_templates:
- "creekorful/bs-configapi:latest"
- "creekorful/bs-configapi:{{ replace .Tag \"v\" \"\" }}"
- "creekorful/bs-configapi:{{ .Major }}"
skip_push: false
dockerfile: build/docker/Dockerfile.configapi
- goos: linux
goarch: amd64
binaries:
- bs-crawler
image_templates:
- "creekorful/bs-crawler:latest"
- "creekorful/bs-crawler:{{ replace .Tag \"v\" \"\" }}"
- "creekorful/bs-crawler:{{ .Major }}"
skip_push: false
dockerfile: build/docker/Dockerfile.crawler
- goos: linux
goarch: amd64
binaries:
- bs-indexer
image_templates:
- "creekorful/bs-indexer:latest"
- "creekorful/bs-indexer:{{ replace .Tag \"v\" \"\" }}"
- "creekorful/bs-indexer:{{ .Major }}"
skip_push: false
dockerfile: build/docker/Dockerfile.indexer
- goos: linux
goarch: amd64
binaries:
- bs-scheduler
image_templates:
- "creekorful/bs-scheduler:latest"
- "creekorful/bs-scheduler:{{ replace .Tag \"v\" \"\" }}"
- "creekorful/bs-scheduler:{{ .Major }}"
skip_push: false
dockerfile: build/docker/Dockerfile.scheduler
checksum:
name_template: 'checksums.txt'
snapshot:

@ -54,10 +54,10 @@ If you've made a change to one of the crawler component and wish to use the upda
just need to issue the following command:
```sh
$ ./script/build.sh
$ goreleaser --snapshot --skip-publish --rm-dist
```
this will rebuild all crawler images using local changes. After that just run start.sh again to have the updated version
this will rebuild all images using local changes. After that just run start.sh again to have the updated version
running.
# Architecture

@ -1,24 +1,5 @@
# build image
FROM golang:1.15.0-alpine as builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
WORKDIR /app
# Copy and download dependencies to cache them and faster build time
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Test then build app
RUN go build -v github.com/creekorful/bathyscaphe/cmd/bs-blacklister
# runtime image
FROM alpine:latest
COPY --from=builder /app/bs-blacklister /app/
WORKDIR /app/
ADD bs-blacklister /usr/bin/bs-blacklister
ENTRYPOINT ["./bs-blacklister"]
ENTRYPOINT ["/usr/bin/bs-blacklister"]

@ -1,24 +1,5 @@
# build image
FROM golang:1.15.0-alpine as builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
WORKDIR /app
# Copy and download dependencies to cache them and faster build time
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Test then build app
RUN go build -v github.com/creekorful/bathyscaphe/cmd/bs-configapi
# runtime image
FROM alpine:latest
COPY --from=builder /app/bs-configapi /app/
WORKDIR /app/
ADD bs-configapi /usr/bin/bs-configapi
ENTRYPOINT ["./bs-configapi"]
ENTRYPOINT ["/usr/bin/bs-configapi"]

@ -1,24 +1,5 @@
# build image
FROM golang:1.15.0-alpine as builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
WORKDIR /app
# Copy and download dependencies to cache them and faster build time
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Test then build app
RUN go build -v github.com/creekorful/bathyscaphe/cmd/bs-crawler
# runtime image
FROM alpine:latest
COPY --from=builder /app/bs-crawler /app/
WORKDIR /app/
ADD bs-crawler /usr/bin/bs-crawler
ENTRYPOINT ["./bs-crawler"]
ENTRYPOINT ["/usr/bin/bs-crawler"]

@ -1,24 +1,5 @@
# build image
FROM golang:1.15.0-alpine as builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
WORKDIR /app
# Copy and download dependencies to cache them and faster build time
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Test then build app
RUN go build -v github.com/creekorful/bathyscaphe/cmd/bs-indexer
# runtime image
FROM alpine:latest
COPY --from=builder /app/bs-indexer /app/
WORKDIR /app/
ADD bs-indexer /usr/bin/bs-indexer
ENTRYPOINT ["./bs-indexer"]
ENTRYPOINT ["/usr/bin/bs-indexer"]

@ -1,24 +1,5 @@
# build image
FROM golang:1.15.0-alpine as builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
WORKDIR /app
# Copy and download dependencies to cache them and faster build time
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Test then build app
RUN go build -v github.com/creekorful/bathyscaphe/cmd/bs-scheduler
# runtime image
FROM alpine:latest
COPY --from=builder /app/bs-scheduler /app/
WORKDIR /app/
ADD bs-scheduler /usr/bin/bs-scheduler
ENTRYPOINT ["./bs-scheduler"]
ENTRYPOINT ["/usr/bin/bs-scheduler"]

@ -1,13 +0,0 @@
#!/bin/bash
# set image tag if provided
tag="latest"
if [ "$1" ]; then
tag="$1"
fi
# build docker images
for path in build/docker/Dockerfile.*; do
name=$(echo "$path" | cut -d'.' -f2)
docker build . -f "$path" -t "creekorful/bs-$name:$tag"
done

@ -1,13 +0,0 @@
#!/bin/bash
# set image tag if provided
tag="latest"
if [ "$1" ]; then
tag="$1"
fi
# push docker images
for path in build/docker/Dockerfile.*; do
name=$(echo "$path" | cut -d'.' -f2)
docker push "creekorful/$name:$tag"
done

@ -1,33 +0,0 @@
#!/bin/bash
# make sure we have passed a tag as version
if [ "$1" ]; then
tag="$1"
else
echo "correct usage ./release.sh <tag>"
exit 1
fi
# create signed tag
git tag -s "v$tag" -m "Release $tag"
# build the docker images
./scripts/build.sh "$tag" # create version tag
./scripts/build.sh # create latest tag
echo ""
echo ""
echo "Release $tag is ready!"
echo "Please validate the changes, and once everything is confirmed, run the following:"
echo ""
echo "Update the git repository:"
echo ""
echo "$ git push && git push --tags"
echo ""
echo "Update the docker images:"
echo ""
echo "$ ./scripts/push.sh $tag"
echo "$ ./scripts/push.sh"
echo ""
echo ""
echo "Happy hacking ;D"
Loading…
Cancel
Save