Skip to content

Commit

Permalink
Merge pull request #196 from ThePorgs/dev
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
ShutdownRepo authored Aug 10, 2023
2 parents 4b8aa94 + 0633cce commit ad28264
Show file tree
Hide file tree
Showing 624 changed files with 5,606 additions and 4,602 deletions.
111 changes: 109 additions & 2 deletions .github/workflows/entrypoint_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- dev
paths-ignore:
- ".github/**"
# - ".github/**"
- "**.md"

env:
Expand Down Expand Up @@ -89,12 +89,119 @@ jobs:
docker manifest push ${DOCKER_TARGET_REPO}:${IMAGE_BASE_NAME}-${IMAGE_VERSION}
docker manifest rm ${DOCKER_TARGET_REPO}:${IMAGE_BASE_NAME}-${IMAGE_VERSION}
tools_list:
name: Export tools list
needs:
- varset
- publish
- build_belt
# only exporting tools list if publish was a success AND the tests were a success
if: always() && ( needs.publish.result == 'success' && !contains(needs.build_belt.outputs.build, 'failure'))
strategy:
fail-fast: false
# only 1 job at a time, else there will be a conflict. Runner 2 will pull exegol-docs before runner 1 pushes changes.
max-parallel: 1
matrix:
arch: [ arm64, amd64 ]
runs-on:
- self-hosted
- builder
- ${{ matrix.arch }}
steps:
- name: Checkout Exegol-images
uses: actions/checkout@v3
- name: Prepare image version
id: prepare
run: |
COMMIT_ID=$(git rev-parse "$GITHUB_SHA")
if [ "$IMAGE_VERSION" == "" ]; then
IMAGE_VERSION=${COMMIT_ID:0:8}
fi
echo "image_version=${IMAGE_VERSION}"
echo "image_version=${IMAGE_VERSION}" >> $GITHUB_OUTPUT
- name: Checkout Exegol-docs
uses: actions/checkout@v3
with:
repository: 'ThePorgs/Exegol-docs'
ref: 'main'
- name: Inspect the built image
id: image_exists
run: docker inspect ${{ needs.varset.outputs.DOCKER_BUILD_REPO }}:${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }}
- name: Create a container from the built image
run: |
docker run --name exegol-${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }} --rm -t -d ${{ needs.varset.outputs.DOCKER_BUILD_REPO }}:${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }} endless
- name: Export the tools list
if: success()
run: |
docker cp exegol-${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }}:/.exegol/installed_tools.csv installed_tools.csv
- name: Debug print installed_tools.csv
id: list_exists
run: cat installed_tools.csv
- name: Sanity check for installed_tools.csv
if: success()
run: |
grep -qE '([^,]*,[^,]*){3,}' installed_tools.csv \
&& (echo '[-] Wrong number of columns on the following lines' \
&& grep -oE '([^,]*,[^,]*){3,}' installed_tools.csv || exit 1) \
|| (echo '[+] List contains right number of columns' && exit 0)
- name: Stop the container
if: always() && steps.image_exists.outcome == 'success'
run: docker stop exegol-${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }}
- name: Adding list to repo and tables
id: adding_list
if: always() && steps.list_exists.outcome == 'success'
run: |
mkdir -p source/assets/installed_tools/lists
echo '[*] [SHOULD BE NIGHTLY ONLY] Moving tools list to latest_nightly_arch.csv'
mv installed_tools.csv source/assets/installed_tools/lists/latest_nightly_${{ matrix.arch }}.csv
echo '[*] Changing nightly.csv so that new tools list appears'
echo '[*] [SHOULD BE NIGHTLY ONLY] Removing occurences of nightly,whateverversion,arch so that only the latest nightly is shown'
(head -n 1 source/assets/installed_tools/nightly.csv; \
echo "${{ needs.varset.outputs.IMAGE_BASE_NAME }},${{ steps.prepare.outputs.image_version }},${{ matrix.arch }},$(date -u +"%Y-%m-%dT%H:%M:%SZ"),:download:\`${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ steps.prepare.outputs.image_version }}_${{ matrix.arch }}.csv \
</assets/installed_tools/lists/latest_nightly_${{ matrix.arch }}.csv>\`"; \
( \
tail -n +2 source/assets/installed_tools/nightly.csv | grep -Ev "${{ needs.varset.outputs.IMAGE_BASE_NAME }},[0-9a-fA-F]{8},${{ matrix.arch }}" \
) \
) | tee source/assets/installed_tools/new_nightly.csv
mv source/assets/installed_tools/new_nightly.csv source/assets/installed_tools/nightly.csv
- name: Debug print nightly.csv
if: always() && !contains(steps.adding_list.outcome, 'skipped')
id: final_list_exists
run: cat source/assets/installed_tools/nightly.csv
- name: Push Exegol-docs
if: always() && steps.final_list_exists.outcome == 'success'
env:
SSH_DEPLOY_KEY: ${{ secrets.EXEGOL_DOCS_SSH_DEPLOY_KEY }}
run: |
echo '[*] Setting up git env for SSH use'
mkdir -p "$HOME/.ssh"
DEPLOY_KEY_FILE="$HOME/.ssh/deploy_key"
echo "${SSH_DEPLOY_KEY}" > "$DEPLOY_KEY_FILE"
chmod 600 "$DEPLOY_KEY_FILE"
SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
ssh-keyscan -H github.com > "$SSH_KNOWN_HOSTS_FILE"
export GIT_SSH_COMMAND="ssh -i "$DEPLOY_KEY_FILE" -o UserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE"
GIT_CMD_REPOSITORY="git@github.com:ThePorgs/Exegol-docs.git"
echo '[*] Setting git config'
git config --global user.name "exegol-images[pipeline]"
git config --global user.email "pipeline@exegol.images"
echo '[*] Staging changes'
echo '[*] [SHOULD BE NIGHTLY ONLY] Staging latest_nightly_arch.csv'
git add --verbose source/assets/installed_tools/lists/latest_nightly_${{ matrix.arch }}.csv
git add --verbose source/assets/installed_tools/nightly.csv
echo '[*] Commiting changes'
git commit --verbose -m "PIPELINE: tools list for ${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ steps.prepare.outputs.image_version }}_${{ matrix.arch }}"
echo '[*] Pushing changes'
git push --verbose "$GIT_CMD_REPOSITORY"
clean_runners:
name: Clean runner
needs:
- tools_list
- publish
- build_belt
# clean runners, if publish was a success, or at least if build succeeded
# we don't care if tools_list worked or not
if: always() && ( needs.publish.result == 'success' || !contains(needs.build_belt.outputs.build, 'failure'))
# even if this job fails, it won't affect the success/fail status of the whole workflow
continue-on-error: true
Expand All @@ -111,7 +218,7 @@ jobs:
run: |
image_name=${DOCKER_BUILD_REPO}:${IMAGE_BASE_NAME}-${{ matrix.arch }}
echo "Removing $image_name"
docker image inspect $image_name && docker rmi $image_name
docker image inspect $image_name || exit 0 && docker rmi $image_name
clean_registry:
name: Clean intermediate registry
Expand Down
98 changes: 97 additions & 1 deletion .github/workflows/entrypoint_preprod_ad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,105 @@ jobs:
docker manifest push ${DOCKER_TARGET_REPO}:${IMAGE_BASE_NAME}-${IMAGE_VERSION}
docker manifest rm ${DOCKER_TARGET_REPO}:${IMAGE_BASE_NAME}-${IMAGE_VERSION}
tools_list:
name: Export tools list
needs:
- varset
- publish
- build_belt
# only exporting tools list if publish was a success AND the tests were a success
if: always() && ( needs.publish.result == 'success' && !contains(needs.build_belt.outputs.build, 'failure'))
strategy:
fail-fast: false
# only 1 job at a time, else there will be a conflict. Runner 2 will pull exegol-docs before runner 1 pushes changes.
max-parallel: 1
matrix:
arch: [ arm64, amd64 ]
runs-on:
- self-hosted
- builder
- ${{ matrix.arch }}
steps:
- name: Checkout Exegol-images
uses: actions/checkout@v3
- name: Checkout Exegol-docs
uses: actions/checkout@v3
with:
repository: 'ThePorgs/Exegol-docs'
ref: 'dev-images'
- name: Inspect the built image
id: image_exists
run: docker inspect ${{ needs.varset.outputs.DOCKER_BUILD_REPO }}:${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }}
- name: Create a container from the built image
run: |
docker run --name exegol-${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }} --rm -t -d ${{ needs.varset.outputs.DOCKER_BUILD_REPO }}:${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }} endless
- name: Export the tools list
if: success()
run: |
docker cp exegol-${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }}:/.exegol/installed_tools.csv installed_tools.csv
- name: Debug print installed_tools.csv
id: list_exists
run: cat installed_tools.csv
- name: Sanity check for installed_tools.csv
if: success()
run: |
grep -qE '([^,]*,[^,]*){3,}' installed_tools.csv \
&& (echo '[-] Wrong number of columns on the following lines' \
&& grep -oE '([^,]*,[^,]*){3,}' installed_tools.csv || exit 1) \
|| (echo '[+] List contains right number of columns' && exit 0)
- name: Stop the container
if: always() && steps.image_exists.outcome == 'success'
run: docker stop exegol-${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }}
- name: Adding list to repo and tables
id: adding_list
if: always() && steps.list_exists.outcome == 'success'
run: |
mkdir -p source/assets/installed_tools/lists
echo '[*] Moving tools list to imagetag_version_arch.csv'
mv installed_tools.csv source/assets/installed_tools/lists/${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ needs.varset.outputs.IMAGE_VERSION }}_${{ matrix.arch }}.csv
echo '[*] Changing releases.csv so that new tools list appears'
echo '[*] [SHOULD BE RELEASES ONLY] Removing occurences of image,version,arch. This is because this workflow runs in the prerelease pipeline, meaning that there is a possibility tools list is pushed to exegol-docs even if the images are not released for some reasons (e.g. imageA prerelease works but not for imageB). Doing this grep -v will ensure that releases.csv does not have duplicates to the same tag, same version and same arch'
(head -n 1 source/assets/installed_tools/releases.csv; \
echo "${{ needs.varset.outputs.IMAGE_BASE_NAME }},${{ needs.varset.outputs.IMAGE_VERSION }},${{ matrix.arch }},$(date -u +"%Y-%m-%dT%H:%M:%SZ"),:download:\`${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ needs.varset.outputs.IMAGE_VERSION }}_${{ matrix.arch }}.csv \
</assets/installed_tools/lists/${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ needs.varset.outputs.IMAGE_VERSION }}_${{ matrix.arch }}.csv>\`"; \
( \
tail -n +2 source/assets/installed_tools/releases.csv | grep -Ev "${{ needs.varset.outputs.IMAGE_BASE_NAME }},${{ needs.varset.outputs.IMAGE_VERSION }},${{ matrix.arch }}" \
) \
) | tee source/assets/installed_tools/new_releases.csv
mv source/assets/installed_tools/new_releases.csv source/assets/installed_tools/releases.csv
- name: Debug print releases.csv
if: always() && !contains(steps.adding_list.outcome, 'skipped')
id: final_list_exists
run: cat source/assets/installed_tools/releases.csv
- name: Push Exegol-docs
if: always() && steps.final_list_exists.outcome == 'success'
env:
SSH_DEPLOY_KEY: ${{ secrets.EXEGOL_DOCS_SSH_DEPLOY_KEY }}
run: |
echo '[*] Setting up git env for SSH use'
mkdir -p "$HOME/.ssh"
DEPLOY_KEY_FILE="$HOME/.ssh/deploy_key"
echo "${SSH_DEPLOY_KEY}" > "$DEPLOY_KEY_FILE"
chmod 600 "$DEPLOY_KEY_FILE"
SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
ssh-keyscan -H github.com > "$SSH_KNOWN_HOSTS_FILE"
export GIT_SSH_COMMAND="ssh -i "$DEPLOY_KEY_FILE" -o UserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE"
GIT_CMD_REPOSITORY="git@github.com:ThePorgs/Exegol-docs.git"
echo '[*] Setting git config'
git config --global user.name "exegol-images[pipeline]"
git config --global user.email "pipeline@exegol.images"
echo '[*] Staging changes'
git add --verbose source/assets/installed_tools/lists/${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ needs.varset.outputs.IMAGE_VERSION }}_${{ matrix.arch }}.csv
git add --verbose source/assets/installed_tools/releases.csv
echo '[*] Commiting changes'
git commit --verbose -m "PIPELINE: tools list for ${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ needs.varset.outputs.IMAGE_VERSION }}_${{ matrix.arch }}"
echo '[*] Pushing changes'
git push --verbose "$GIT_CMD_REPOSITORY"
clean_runners:
name: Clean runner
needs:
- tools_list
- publish
- build_belt
# clean runners, if publish was a success, or at least if build succeeded
Expand All @@ -114,7 +210,7 @@ jobs:
run: |
image_name=${DOCKER_BUILD_REPO}:${IMAGE_BASE_NAME}-${{ matrix.arch }}
echo "Removing $image_name"
docker image inspect $image_name && docker rmi $image_name
docker image inspect $image_name || exit 0 && docker rmi $image_name
clean_registry:
name: Clean intermediate registry
Expand Down
98 changes: 97 additions & 1 deletion .github/workflows/entrypoint_preprod_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,105 @@ jobs:
docker manifest push ${DOCKER_TARGET_REPO}:${IMAGE_BASE_NAME}-${IMAGE_VERSION}
docker manifest rm ${DOCKER_TARGET_REPO}:${IMAGE_BASE_NAME}-${IMAGE_VERSION}
tools_list:
name: Export tools list
needs:
- varset
- publish
- build_belt
# only exporting tools list if publish was a success AND the tests were a success
if: always() && ( needs.publish.result == 'success' && !contains(needs.build_belt.outputs.build, 'failure'))
strategy:
fail-fast: false
# only 1 job at a time, else there will be a conflict. Runner 2 will pull exegol-docs before runner 1 pushes changes.
max-parallel: 1
matrix:
arch: [ arm64, amd64 ]
runs-on:
- self-hosted
- builder
- ${{ matrix.arch }}
steps:
- name: Checkout Exegol-images
uses: actions/checkout@v3
- name: Checkout Exegol-docs
uses: actions/checkout@v3
with:
repository: 'ThePorgs/Exegol-docs'
ref: 'dev-images'
- name: Inspect the built image
id: image_exists
run: docker inspect ${{ needs.varset.outputs.DOCKER_BUILD_REPO }}:${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }}
- name: Create a container from the built image
run: |
docker run --name exegol-${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }} --rm -t -d ${{ needs.varset.outputs.DOCKER_BUILD_REPO }}:${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }} endless
- name: Export the tools list
if: success()
run: |
docker cp exegol-${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }}:/.exegol/installed_tools.csv installed_tools.csv
- name: Debug print installed_tools.csv
id: list_exists
run: cat installed_tools.csv
- name: Sanity check for installed_tools.csv
if: success()
run: |
grep -qE '([^,]*,[^,]*){3,}' installed_tools.csv \
&& (echo '[-] Wrong number of columns on the following lines' \
&& grep -oE '([^,]*,[^,]*){3,}' installed_tools.csv || exit 1) \
|| (echo '[+] List contains right number of columns' && exit 0)
- name: Stop the container
if: always() && steps.image_exists.outcome == 'success'
run: docker stop exegol-${{ needs.varset.outputs.IMAGE_BASE_NAME }}-${{ matrix.arch }}
- name: Adding list to repo and tables
id: adding_list
if: always() && steps.list_exists.outcome == 'success'
run: |
mkdir -p source/assets/installed_tools/lists
echo '[*] Moving tools list to imagetag_version_arch.csv'
mv installed_tools.csv source/assets/installed_tools/lists/${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ needs.varset.outputs.IMAGE_VERSION }}_${{ matrix.arch }}.csv
echo '[*] Changing releases.csv so that new tools list appears'
echo '[*] [SHOULD BE RELEASES ONLY] Removing occurences of image,version,arch. This is because this workflow runs in the prerelease pipeline, meaning that there is a possibility tools list is pushed to exegol-docs even if the images are not released for some reasons (e.g. imageA prerelease works but not for imageB). Doing this grep -v will ensure that releases.csv does not have duplicates to the same tag, same version and same arch'
(head -n 1 source/assets/installed_tools/releases.csv; \
echo "${{ needs.varset.outputs.IMAGE_BASE_NAME }},${{ needs.varset.outputs.IMAGE_VERSION }},${{ matrix.arch }},$(date -u +"%Y-%m-%dT%H:%M:%SZ"),:download:\`${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ needs.varset.outputs.IMAGE_VERSION }}_${{ matrix.arch }}.csv \
</assets/installed_tools/lists/${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ needs.varset.outputs.IMAGE_VERSION }}_${{ matrix.arch }}.csv>\`"; \
( \
tail -n +2 source/assets/installed_tools/releases.csv | grep -Ev "${{ needs.varset.outputs.IMAGE_BASE_NAME }},${{ needs.varset.outputs.IMAGE_VERSION }},${{ matrix.arch }}" \
) \
) | tee source/assets/installed_tools/new_releases.csv
mv source/assets/installed_tools/new_releases.csv source/assets/installed_tools/releases.csv
- name: Debug print releases.csv
if: always() && !contains(steps.adding_list.outcome, 'skipped')
id: final_list_exists
run: cat source/assets/installed_tools/releases.csv
- name: Push Exegol-docs
if: always() && steps.final_list_exists.outcome == 'success'
env:
SSH_DEPLOY_KEY: ${{ secrets.EXEGOL_DOCS_SSH_DEPLOY_KEY }}
run: |
echo '[*] Setting up git env for SSH use'
mkdir -p "$HOME/.ssh"
DEPLOY_KEY_FILE="$HOME/.ssh/deploy_key"
echo "${SSH_DEPLOY_KEY}" > "$DEPLOY_KEY_FILE"
chmod 600 "$DEPLOY_KEY_FILE"
SSH_KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
ssh-keyscan -H github.com > "$SSH_KNOWN_HOSTS_FILE"
export GIT_SSH_COMMAND="ssh -i "$DEPLOY_KEY_FILE" -o UserKnownHostsFile=$SSH_KNOWN_HOSTS_FILE"
GIT_CMD_REPOSITORY="git@github.com:ThePorgs/Exegol-docs.git"
echo '[*] Setting git config'
git config --global user.name "exegol-images[pipeline]"
git config --global user.email "pipeline@exegol.images"
echo '[*] Staging changes'
git add --verbose source/assets/installed_tools/lists/${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ needs.varset.outputs.IMAGE_VERSION }}_${{ matrix.arch }}.csv
git add --verbose source/assets/installed_tools/releases.csv
echo '[*] Commiting changes'
git commit --verbose -m "PIPELINE: tools list for ${{ needs.varset.outputs.IMAGE_BASE_NAME }}_${{ needs.varset.outputs.IMAGE_VERSION }}_${{ matrix.arch }}"
echo '[*] Pushing changes'
git push --verbose "$GIT_CMD_REPOSITORY"
clean_runners:
name: Clean runner
needs:
- tools_list
- publish
- build_belt
# clean runners, if publish was a success, or at least if build succeeded
Expand All @@ -114,7 +210,7 @@ jobs:
run: |
image_name=${DOCKER_BUILD_REPO}:${IMAGE_BASE_NAME}-${{ matrix.arch }}
echo "Removing $image_name"
docker image inspect $image_name && docker rmi $image_name
docker image inspect $image_name || exit 0 && docker rmi $image_name
clean_registry:
name: Clean intermediate registry
Expand Down
Loading

0 comments on commit ad28264

Please sign in to comment.