Skip to content

Commit

Permalink
ci: add trigger for gitlab pipeline
Browse files Browse the repository at this point in the history
NO_DOC=internal
NO_TEST=internal
NO_CHANGELOG=internal
  • Loading branch information
Виталий Шунков committed Mar 21, 2024
1 parent ef58810 commit e1bc8d5
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 494 deletions.
216 changes: 0 additions & 216 deletions .github/workflows/Build.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/Curl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Trigger_gitlab
on:
workflow_call:
secrets:
GITLAB_BUILDER:
description: 'A GITLAB_BUILDER passed from Release'
required: true

jobs:
curl:
runs-on: ubuntu-latest
steps:
- name: run gitlab pipeline
run: |
curl -f -X POST -F token=${{ secrets.GITLAB_BUILDER }} -F ref=main -F "variables[TYPE]=RELEASE" -F "variables[PROJECT_TARGET]=genin" https://git.picodata.io/api/v4/projects/166/trigger/pipeline
96 changes: 49 additions & 47 deletions .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,65 @@ on:
required: true
type: string
secrets:
DEPLOY_PROD_SSH_KEY:
description: 'A DEPLOY_PROD_SSH_KEY passed from UnitTest'
RAW_AUTH_RW:
description: 'A RAW_AUTH_RW passed from UnitTest'
required: true
KNOWN_HOSTS:
description: 'A KNOWN_HOSTS passed from UnitTest'
GITLAB_BUILDER:
description: 'A GITLAB_BUILDER passed from Release'
required: true
env:
VERSION: ${{ inputs.version }}
YUM_REGISTRY: https://binary.picodata.io/repository/yum
DEB_REGISTRY: https://binary.picodata.io/repository/ubuntu
RAW_REGISTRY: https://binary.picodata.io/repository/raw
jobs:
publish:
name: Publish to download.picodata.io
runs-on: [ self-hosted, genin ]
build:
name: Build genin binary
runs-on: [self-hosted, genin]
container:
image: docker.binary.picodata.io/rust-builder-stable:latest
steps:
- name: Download centos7 rpm
uses: actions/download-artifact@v3
with:
name: genin-${{ env.VERSION }}-1.el7.x86_64.rpm
path: ./centos7/
- name: Download centos8 rpm
uses: actions/download-artifact@v3
- uses: actions/checkout@v3
- name: Run make build_binary
run: |
make build_musl
- name: Archive musl binary
uses: actions/upload-artifact@v3
with:
name: genin-${{ env.VERSION }}-1.el8.x86_64.rpm
path: ./centos8/
- name: Download deb package
name: x86_64-unknown-linux-musl.zip
path: target/x86_64-unknown-linux-musl/release/genin

musl-bin:
name: Upload musl binary
needs: [build]
runs-on: [self-hosted, genin]
container:
image: docker.binary.picodata.io/rockylinux:8
steps:
- name: Download builded binary
uses: actions/download-artifact@v3
with:
name: genin-${{ env.VERSION }}.amd64.deb
path: ./debian/
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DEPLOY_PROD_SSH_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
if_key_exists: replace
- name: Upload centos7 rpm to picodata
run: |
scp -o stricthostkeychecking=no centos7/genin-${{ env.VERSION }}-1.el7.x86_64.rpm ansible@94.26.239.246:/data/nginx/www/packrepo/tarantool-picodata/el/7/x86_64/
ssh -o stricthostkeychecking=no ansible@94.26.239.246 "cd /data/nginx/www/packrepo/tarantool-picodata/el/7/ && createrepo --update x86_64 && gpg --no-tty --yes -u kdy@picodata.io --detach-sign --armor x86_64/repodata/repomd.xml"
- name: Upload centos8 rpm to picodata
name: x86_64-unknown-linux-musl.zip
path: .
- name: Upload archive with binary
run: |
scp -o stricthostkeychecking=no centos8/genin-${{ env.VERSION }}-1.el8.x86_64.rpm ansible@94.26.239.246:/data/nginx/www/packrepo/tarantool-picodata/el/8/x86_64/
ssh -o stricthostkeychecking=no ansible@94.26.239.246 "cd /data/nginx/www/packrepo/tarantool-picodata/el/8/ && createrepo --update x86_64 && gpg --no-tty --yes -u kdy@picodata.io --detach-sign --armor x86_64/repodata/repomd.xml"
- name: Upload deb to picodata
run: |
ssh -o stricthostkeychecking=no ansible@94.26.239.246 "mkdir -p ~/.deb"
scp -o stricthostkeychecking=no debian/genin-${{ env.VERSION }}.amd64.deb ansible@94.26.239.246:.deb/
ssh -o stricthostkeychecking=no ansible@94.26.239.246 "reprepro -b /data/nginx/www/packrepo/tarantool-picodata/ubuntu/ -C main includedeb focal ~/.deb/genin-${{ env.VERSION }}.amd64.deb; rm ~/.deb/genin-${{ env.VERSION }}.amd64.deb"
tar -czvf genin-${{ env.VERSION }}-x86_64-musl.tar.gz genin
curl -v -f -H "Authorization: Basic ${{ secrets.RAW_AUTH_RW }}" --upload-file genin-${{ env.VERSION }}-x86_64-musl.tar.gz ${{ env.RAW_REGISTRY }}/genin/bin/genin-${{ env.VERSION }}-x86_64-musl.tar.gz
- uses: actions/checkout@v3
- name: Clean workspace
run: rm -rf * .[^.]*
if: always()

clean:
runs-on: self-hosted
needs: [musl-bin]
steps:
- uses: AutoModality/action-clean@v1
- run: echo cleaned workdir

release:
name: Create new release
runs-on: [ self-hosted, genin ]
needs: [ publish ]
steps:
- name: Create genin Release
uses: softprops/action-gh-release@v1
Expand All @@ -75,20 +78,19 @@ jobs:
- [genin v${{ env.VERSION }}](#genin-v${{ env.VERSION }})
* [executable](#executable)
* [MacOSX](#macosx)
* [Centos x86_64](#centos-x86_64)
* [Debian x86_64](#debian-x86_64)
### Executable
[genin-${{ env.VERSION }}-x86_64-musl.tar.gz](${{ env.RAW_REGISTRY }}/genin/bin/genin-${{ env.VERSION }}-x86_64-musl.tar.gz)
### MacOSX
[genin-${{ env.VERSION }}-x86_64-macos.tar.gz](${{ env.RAW_REGISTRY }}/genin/osx/genin-${{ env.VERSION }}-x86_64-macosx.tar.gz)
### Centos x86_64:
[genin-${{ env.VERSION }}-1.el7.x86_64.rpm](${{ env.YUM_REGISTRY }}/el/7/x86_64/os/genin-${{ env.VERSION }}-1.el7.x86_64.rpm)
[genin-${{ env.VERSION }}-1.el8.x86_64.rpm](${{ env.YUM_REGISTRY }}/el/8/x86_64/os/genin-${{ env.VERSION }}-1.el8.x86_64.rpm)
### Debian x86_64
[genin-${{ env.VERSION }}.amd64.deb](${{ env.RAW_REGISTRY }}/genin/deb/genin-${{ env.VERSION }}.amd64.deb)
### For other OS, use the Picodata repository:
[genin-${{ env.VERSION }}-x86_64-musl.tar.gz(https://picodata.io/download/)
call_gitlab_ci:
name: Trigger_gitlab
secrets:
GITLAB_BUILDER: ${{ secrets.GITLAB_BUILDER }}
uses: ./.github/workflows/Curl.yaml

19 changes: 8 additions & 11 deletions .github/workflows/UnitTest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,18 @@ jobs:
- name: Clean workspace
run: rm -rf ..?* .[!.]* *
if: always()
call_integrations_tests:
name: IntegrationTest
needs: [version]
uses: ./.github/workflows/IntegrationTest.yaml
with:
VERSION: ${{ needs.version.outputs.VERSION }}
call_build:
name: Build
needs: [version, test]
uses: ./.github/workflows/Build.yaml
uses: ./.github/workflows/Release.yaml
secrets:
RAW_AUTH_RW: ${{ secrets.RAW_AUTH_RW }}
YUM_AUTH_RW: ${{ secrets.YUM_AUTH_RW }}
GPG_KEY_KDY: ${{ secrets.GPG_KEY_KDY }}
DEPLOY_PROD_SSH_KEY: ${{ secrets.DEPLOY_PROD_SSH_KEY }}
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }}
with:
VERSION: ${{ needs.version.outputs.VERSION }}
call_integrations_tests:
name: IntegrationTest
needs: [version]
uses: ./.github/workflows/IntegrationTest.yaml
GITLAB_BUILDER: ${{ secrets.GITLAB_BUILDER }}
with:
VERSION: ${{ needs.version.outputs.VERSION }}
Loading

0 comments on commit e1bc8d5

Please sign in to comment.