Skip to content

Commit

Permalink
Merge pull request #927 from replicatedhq/divolgin/ffi
Browse files Browse the repository at this point in the history
Don't release kots.so.  Build it for the API
  • Loading branch information
divolgin committed Aug 10, 2020
2 parents 09ae90b + 2bf93da commit 4fbb722
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
name: kots
path: bin/kots

- run: make ffi
- run: cp ./bin/kots.so kotsadm/api
- run: make -C kotsadm kotsadm
- run: make -C kotsadm/operator build
- run: make -C kotsadm/kurl_proxy build
Expand Down
52 changes: 50 additions & 2 deletions .github/workflows/kotsadm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,36 @@ jobs:
path: ./kotsadm/web/dist


build_ffi:
runs-on: ubuntu-18.04
needs: [build-schema-migrations]
container:
image: replicated/gitops-builder:buildkite-go14-node10
options: --user root
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Get the version
if: startsWith(github.ref, 'refs/tags/')
id: get_tag
shell: bash
run: echo ::set-output name=GIT_TAG::${GITHUB_REF/refs\/tags\//}

- name: Build kots.so
env:
GIT_COMMIT: ${{ github.sha }}
GIT_TAG: ${{ steps.get_tag.outputs.GIT_TAG }}
SCOPE_DSN_PUBLIC: ""
run: SCOPE_DSN=$SCOPE_DSN_PUBLIC make ffi

- name: Upload kots.so bin artifact
uses: actions/upload-artifact@v2
with:
name: kots.so
path: ./bin/kots.so


build_operator:
runs-on: ubuntu-18.04
needs: [build-schema-migrations]
Expand Down Expand Up @@ -432,7 +462,7 @@ jobs:
release_typescript_api_alpha:
runs-on: ubuntu-18.04
if: ${{ github.ref == 'refs/heads/master' }}
needs: [build_typescript_api]
needs: [build_typescript_api, build_ffi]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -447,16 +477,23 @@ jobs:
with:
node-version: '10'

- name: Download kots.so artifact
uses: actions/download-artifact@v2
with:
name: kots.so
path: ./bin/kots.so

- name: Build alpha release
env:
GIT_COMMIT: ${{ github.sha }}
run: |
cp ./bin/kots.so kotsadm/api
make -C kotsadm/api build-alpha
release_typescript_api_tagged:
runs-on: ubuntu-18.04
needs: [build_typescript_api]
needs: [build_typescript_api, build_ffi]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -479,6 +516,17 @@ jobs:
shell: bash
run: echo ::set-output name=GIT_TAG::${GITHUB_REF/refs\/tags\//}

- name: Download kots.so artifact
uses: actions/download-artifact@v2
with:
name: kots.so
path: ./bin/kots.so

- name: Copy kots.so
env:
run: |
cp -f ./bin/kots.so kotsadm/api
- name: Build tagged release
if: ${{ steps.get_tag.outputs.GIT_TAG != '' }}
env:
Expand Down
30 changes: 0 additions & 30 deletions deploy/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,6 @@ builds:
flags: -tags netgo -tags containers_image_ostree_stub -tags exclude_graphdriver_devicemapper -tags exclude_graphdriver_btrfs -tags containers_image_openpgp -installsuffix netgo
binary: kots
hooks: {}
- id: so
goos:
- linux
goarch:
- amd64
env:
- CGO_ENABLED=1
- GO111MODULE=on
main: ./ffi
ldflags: -s -w
-X github.com/replicatedhq/kots/pkg/version.version={{.Version}}
-X github.com/replicatedhq/kots/pkg/version.gitSHA={{.FullCommit}}
-X github.com/replicatedhq/kots/pkg/version.buildTime={{.Date}}
flags: -buildmode=c-shared
binary: kots.so
hooks: {}

archives:
- id: kots
Expand All @@ -58,17 +42,3 @@ archives:
- README*
- changelog*
- CHANGELOG*
- id: kots.so
builds:
- so
format: tar.gz
name_template: '{{ .Binary }}_{{ .Os }}_{{ .Arch }}'
files:
- licence*
- LICENCE*
- license*
- LICENSE*
- readme*
- README*
- changelog*
- CHANGELOG*
6 changes: 1 addition & 5 deletions kotsadm/api/deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ RUN curl -L "https://github.com/kubernetes-sigs/kustomize/releases/download/kust
chmod a+x kustomize && \
mv kustomize "/usr/local/bin/kustomize3.5.4"

# Install kots.so
RUN curl -L "https://github.com/replicatedhq/kots/releases/download/v1.16.1/kots.so_linux_amd64.tar.gz" > /tmp/kots.tar.gz && \
cd /tmp && tar xzvf kots.tar.gz && \
mv /tmp/kots.so /lib/kots.so && \
rm -rf /tmp/*
ADD ./kots.so /lib/kots.so

# Install troubleshoot.so
RUN curl -L "https://github.com/replicatedhq/troubleshoot/releases/download/v0.9.38/troubleshoot.so_linux_amd64.tar.gz" > /tmp/troubleshoot.tar.gz && \
Expand Down

0 comments on commit 4fbb722

Please sign in to comment.