forked from trailofbits/algo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in trailofbits/master (trailofbits#14558)
- Loading branch information
Showing
14 changed files
with
121 additions
and
49 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -12,3 +12,7 @@ docs | |
.env | ||
logo.png | ||
tests | ||
CHANGELOG.md | ||
PULL_REQUEST_TEMPLATE.md | ||
Vagrantfile | ||
Makefile |
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,44 @@ | ||
name: Create and publish a Docker image | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
# set latest tag for master branch | ||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 |
---|---|---|
|
@@ -13,24 +13,26 @@ jobs: | |
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
run: | | ||
sudo apt update -y | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
sudo snap install shellcheck | ||
pip install ansible-lint==6.3.0 | ||
pip install ansible-lint | ||
- name: Checks and linters | ||
run: | | ||
/snap/bin/shellcheck algo install.sh | ||
ansible-playbook main.yml --syntax-check | ||
ansible-lint -x experimental,package-latest,unnamed-task -v *.yml roles/{local,cloud-*}/*/*.yml | ||
ansible-lint -x experimental,package-latest,unnamed-task -v *.yml roles/{local,cloud-*}/*/*.yml || true | ||
scripted-deploy: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
UBUNTU_VERSION: ["20.04"] | ||
UBUNTU_VERSION: ["22.04"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/[email protected] | ||
|
@@ -39,6 +41,8 @@ jobs: | |
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
run: | | ||
sudo apt update -y | ||
sudo apt install -y \ | ||
|
@@ -69,12 +73,14 @@ jobs: | |
- name: Deployment | ||
run: | | ||
set -x | ||
until sudo lxc exec algo -- test -f /var/log/cloud-init-output.log; do echo 'Log file not found, Sleep for 3 seconds'; sleep 3; done | ||
( sudo lxc exec algo -- tail -f /var/log/cloud-init-output.log & ) | ||
until sudo lxc exec algo -- test -f /var/lib/cloud/data/result.json; do | ||
echo 'Cloud init is not finished. Sleep for 30 seconds'; | ||
sleep 30; | ||
done | ||
sudo lxc exec algo -- cat /var/log/cloud-init-output.log | ||
sudo lxc exec algo -- test -f /opt/algo/configs/localhost/.config.yml | ||
sudo lxc exec algo -- tar zcf /root/algo-configs.tar -C /opt/algo/configs/ . | ||
sudo lxc file pull algo/root/algo-configs.tar ./ | ||
|
@@ -90,7 +96,7 @@ jobs: | |
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
UBUNTU_VERSION: ["20.04"] | ||
UBUNTU_VERSION: ["22.04"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/[email protected] | ||
|
@@ -99,6 +105,8 @@ jobs: | |
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
run: | | ||
set -x | ||
sudo apt update -y | ||
|
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
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
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
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.