-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
320 additions
and
265 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: Build | ||
on: | ||
push: | ||
tags: ["*"] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: [ ubuntu-latest ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
timeout-minutes: 15 | ||
continue-on-error: true | ||
with: | ||
node-version: 18.16 | ||
- name: Install bower | ||
run: npm install -g bower | ||
- name: Import PGP Key | ||
run: gpg --batch --import - <<< ${{ secrets.PGP_KEY }} | ||
- name: Write version | ||
id: version | ||
run: | | ||
V=$(sbt -no-colors --error "print version" | awk 'END{print $1}') | ||
echo "version=$V" | ||
echo "version=$V" >> $GITHUB_OUTPUT | ||
- name: Build packages | ||
run: sbt Docker/stage Debian/packageBin Rpm/packageBin Universal/packageBin cortexWithDeps/Docker/stage makeBom | ||
- name: Move packages | ||
run: | | ||
mv target/rpm/RPMS/noarch/cortex*.rpm target/ | ||
mv target/universal/cortex*.zip target/ | ||
- name: Write docker tags from version | ||
id: tags | ||
run: | | ||
V=${{ steps.version.outputs.version }} | ||
if ( echo $V | grep -qi rc ) | ||
then | ||
echo $( echo $V | sed -re 's/([0-9]+.[0-9]+.[0-9]+)-RC([0-9]+)-([0-9]+)/\1-RC\2,\1-RC\2-\3/' ) > target/tags | ||
else | ||
echo $( echo $V | sed -re 's/([0-9]+).([0-9]+).([0-9]+)-([0-9]+)/\1,\1.\2,\1.\2.\3,\1.\2.\3-\4,latest/' ) > target/tags | ||
fi | ||
echo "tags=$(cat target/tags)" >> $GITHUB_OUTPUT | ||
- name: Build list of additional tags | ||
id: additional-tags | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
core.setOutput('tags', `${{ steps.tags.outputs.tags }}`.split(",").join("\n")) | ||
- name: Generate full docker tags | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
name=${{ secrets.HARBOR_REGISTRY }}/thehiveproject/cortex | ||
name=thehiveproject/cortex | ||
tags: | | ||
${{ steps.additional-tags.outputs.tags }} | ||
- name: Login to Harbor | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ secrets.HARBOR_REGISTRY }} | ||
username: ${{ secrets.HARBOR_USERNAME }} | ||
password: ${{ secrets.HARBOR_PASSWORD }} | ||
|
||
- name: Login to Dockerhub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push docker | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: target/docker/stage | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
- name: Build and push fat docker | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: target/docker-withdeps/target/docker/stage | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
- name: Make github release | ||
uses: "softprops/action-gh-release@v1" | ||
id: make-release | ||
with: | ||
generate_release_notes: true | ||
files: | | ||
target/cortex*.deb | ||
target/cortex*.rpm | ||
target/cortex*.zip | ||
target/cortex*.bom.xml | ||
notify: | ||
needs: [ build ] | ||
runs-on: [ ubuntu-latest ] | ||
if: always() | ||
steps: | ||
- name: Slack notification | ||
uses: Gamesight/slack-workflow-status@master | ||
with: | ||
repo_token: ${{secrets.GITHUB_TOKEN}} | ||
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}} | ||
channel: "#ci-cortex" | ||
name: Cortex build | ||
include_commit_message: true | ||
include_jobs: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Check Code | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
push: | ||
branches: [master, develop] | ||
jobs: | ||
check: | ||
name: Check | ||
runs-on: [ ubuntu-latest ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
timeout-minutes: 15 | ||
continue-on-error: true | ||
with: | ||
node-version: 18.16 | ||
- name: Install bower | ||
run: npm install -g bower | ||
- name: Run tests | ||
run: sbt test Universal/packageBin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.