Skip to content

Commit

Permalink
fix skaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
olegfomenko committed Dec 2, 2024
1 parent 4cb8df3 commit 26fab4e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 60 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ on:

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
name: Skaffold Build Manual
runs-on: ubuntu-22.04
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/[email protected]

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_SHA
- name: Run Build
run: |
. $(werf ci-env github --as-file)
werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA
- name: Cache layers
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/.skaffold/cache"
key: skaffold-${{ hashFiles('**/cache') }}
restore-keys: |
skaffold-
- name: Run Skaffold pipeline as command
uses: hiberbee/github-action-skaffold@latest
id: build
with:
command: build --tag ${{ github.sha }}
repository: ghcr.io/${{ github.repository_owner }}
32 changes: 16 additions & 16 deletions .github/workflows/actions_onlymain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ on:

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
name: Skaffold Build Only Main
runs-on: ubuntu-22.04
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/[email protected]

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_SHA
- name: Run Build
run: |
. $(werf ci-env github --as-file)
werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA
- name: Cache layers
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/.skaffold/cache"
key: skaffold-${{ hashFiles('**/cache') }}
restore-keys: |
skaffold-
- name: Run Skaffold pipeline as command
uses: hiberbee/github-action-skaffold@latest
id: build
with:
command: build --tag ${{ github.sha }}
repository: ghcr.io/${{ github.repository_owner }}
32 changes: 16 additions & 16 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ on:

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
name: Skaffold Build For Tag
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/[email protected]

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_REF_NAME
- name: Run Build
run: |
. $(werf ci-env github --as-file)
werf export service --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME
- name: Cache layers
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/.skaffold/cache"
key: skaffold-${{ hashFiles('**/cache') }}
restore-keys: |
skaffold-
- name: Run Skaffold pipeline as command
uses: hiberbee/github-action-skaffold@latest
id: build
with:
command: build --tag ${{ github.sha }}
repository: ghcr.io/${{ github.repository_owner }}

- uses: shrink/actions-docker-extract@v3
id: extract
Expand Down
File renamed without changes.
17 changes: 5 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,30 @@ FROM golang:1.20-alpine as buildbase

RUN apk add build-base git

ARG CI_JOB_TOKEN

WORKDIR /go/src/github.com/rarimo/rarimo-core

ENV GO111MODULE="on"
ENV CGO_ENABLED=1
ENV GOOS="linux"
ENV GOPRIVATE=gitlab.com/*
ENV GONOSUMDB=gitlab.com/*
ENV GONOPROXY=gitlab.com/*

RUN echo "machine gitlab.com login gitlab-ci-token password $CI_JOB_TOKEN" > ~/.netrc
# RUN git config --global url."https://gitlab-ci-token:[email protected]/".insteadOf https://gitlab.com/
COPY go.mod .
COPY go.sum .
RUN go mod download

COPY . .

RUN go mod vendor
# TODO switch to latest cosmosvisor
RUN go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]

RUN go build -o /usr/local/bin/rarimo-core github.com/rarimo/rarimo-core/cmd/rarimo-cored



###
RUN cp $GOPATH/bin/cosmovisor /usr/local/bin/cosmovisor
RUN go build -mod=mod -o /usr/local/bin/rarimo-core github.com/rarimo/rarimo-core/cmd/rarimo-cored

FROM alpine:3.9

RUN apk add --no-cache ca-certificates

COPY --from=buildbase /usr/local/bin/rarimo-core /usr/local/bin/rarimo-core
COPY --from=buildbase /usr/local/bin/cosmovisor /usr/local/bin/cosmovisor

ENTRYPOINT ["rarimo-core"]
5 changes: 5 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: skaffold/v2beta28
kind: Config
build:
artifacts:
- image: rarimo-core

0 comments on commit 26fab4e

Please sign in to comment.