2022-03-17 22:00:10 +00:00
|
|
|
name: "Hourly import to Elasticsearch"
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 * * * *'
|
|
|
|
|
2023-02-07 15:32:04 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
issues: write
|
|
|
|
|
2022-03-17 22:00:10 +00:00
|
|
|
jobs:
|
|
|
|
|
2022-04-24 21:48:01 +00:00
|
|
|
nixos-channels:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.nixos-channels.outputs.matrix }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checking out the repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup
|
|
|
|
uses: ./.github/actions/common-setup
|
|
|
|
with:
|
2022-10-29 20:58:44 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-04-24 21:48:01 +00:00
|
|
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
|
|
|
|
|
|
|
- name: NixOS Channels
|
|
|
|
id: nixos-channels
|
|
|
|
run: |
|
|
|
|
nix build -L .#nixosChannels
|
|
|
|
channels="{\"channel\": $(< ./result)}"
|
|
|
|
echo $channels
|
|
|
|
echo "::set-output name=matrix::$channels"
|
|
|
|
|
2022-03-17 22:00:10 +00:00
|
|
|
import-nixpkgs:
|
2022-04-24 21:48:01 +00:00
|
|
|
needs: nixos-channels
|
2022-03-17 22:00:10 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
2022-04-24 21:48:01 +00:00
|
|
|
matrix: ${{ fromJSON(needs.nixos-channels.outputs.matrix) }}
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_LOG: debug
|
|
|
|
FI_ES_EXISTS_STRATEGY: abort
|
2022-11-03 09:56:05 +00:00
|
|
|
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL2 }}
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checking out the repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup
|
|
|
|
uses: ./.github/actions/common-setup
|
|
|
|
with:
|
2022-10-29 20:58:44 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-17 22:00:10 +00:00
|
|
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
|
|
|
|
|
|
|
- name: Import ${{ matrix.channel }} channel
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
nix run .#flake-info -- --push --elastic-schema-version=$(< VERSION) nixpkgs ${{ matrix.channel }}
|
|
|
|
if: github.repository_owner == 'NixOS'
|
|
|
|
|
|
|
|
- name: Warmup ${{ matrix.channel }} channel
|
|
|
|
run: |
|
|
|
|
for (( i = 0; i < 3; i++ )) do
|
2022-11-03 09:56:05 +00:00
|
|
|
curl -sS ${{ secrets.ELASTICSEARCH_URL2 }}/latest-$(< VERSION)-nixos-${{ matrix.channel }}/_search | jq -c '.took // .'
|
2022-03-17 22:00:10 +00:00
|
|
|
done
|
|
|
|
if: github.repository_owner == 'NixOS'
|
|
|
|
|
2023-02-07 15:32:04 +00:00
|
|
|
- name: Create issue if failed
|
|
|
|
if: failure()
|
|
|
|
uses: JasonEtco/create-an-issue@v2
|
|
|
|
with:
|
|
|
|
filename: .github/failing-import-issue.md
|
|
|
|
search_existing: open
|
|
|
|
update_existing: false
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
CHANNEL: ${{ matrix.channel }}
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
import-flakes:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
group:
|
|
|
|
- "manual"
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_LOG: debug
|
|
|
|
FI_ES_EXISTS_STRATEGY: recreate
|
2022-11-03 09:56:05 +00:00
|
|
|
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL2 }}
|
2022-03-17 22:00:10 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checking out the repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup
|
|
|
|
uses: ./.github/actions/common-setup
|
|
|
|
with:
|
2022-10-29 20:58:44 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-17 22:00:10 +00:00
|
|
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
|
|
|
|
|
|
|
- name: Import ${{ matrix.group }} group
|
|
|
|
run: |
|
|
|
|
nix run .#flake-info -- --push --elastic-schema-version=$(< ./VERSION) group ./flakes/${{ matrix.group }}.toml ${{ matrix.group }}
|
|
|
|
if: github.repository_owner == 'NixOS'
|
|
|
|
|
|
|
|
- name: Warmup ${{ matrix.group }} group
|
|
|
|
run: |
|
|
|
|
for (( i = 0; i < 3; i++ )) do
|
2022-11-03 09:56:05 +00:00
|
|
|
curl -sS ${{ secrets.ELASTICSEARCH_URL2 }}/latest-$(< VERSION)-group-${{ matrix.group }}/_search | jq -c '.took // .'
|
2022-03-17 22:00:10 +00:00
|
|
|
done
|
|
|
|
if: github.repository_owner == 'NixOS'
|