Skip to content

Commit

Permalink
Patch deployment types of Assemblyline to use the released stable by …
Browse files Browse the repository at this point in the history
…default
  • Loading branch information
cccs-rs committed Feb 4, 2025
1 parent 5b29da8 commit aa04e1c
Showing 1 changed file with 76 additions and 12 deletions.
88 changes: 76 additions & 12 deletions pipelines/full-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ resources:
type: github
endpoint: github-repo-sa
name: CybercentreCanada/assemblyline4_docs
- repository: DockerRepo
type: github
endpoint: github-repo-sa
name: CybercentreCanada/assemblyline-docker-compose
- repository: HelmRepo
type: github
endpoint: github-repo-sa
name: CybercentreCanada/assemblyline-helm-chart


stages:
### BUILDING ###
Expand Down Expand Up @@ -303,6 +312,60 @@ stages:
readme_path: $(README_PATH)


- job: update_helm_release
displayName: "Update default release in Helm chart"
steps:
- download: current
artifact: working
- checkout: HelmRepo
path: assemblyline-helm-chart
persistCredentials: true
- script: |
set -exv # Echo commands before they are run
if [[ "$TAG" == *stable* ]]
then
cd $(Agent.BuildDirectory)/assemblyline-helm-chart
chmod -R a+rw .
sed -i 's/release: ".*"/release: '"$TAG"'/g' assemblyline/values.yaml
git add .
git config --global user.email "[email protected]"
git config --global user.name "Azure Pipeline"
git commit -m "Pipeline: Release $TAG"
git push
fi
workingDirectory: $(Pipeline.Workspace)/working/
displayName: "Patch the default release version to the latest stable"
retryCountOnTaskFailure: 3
- job: update_docker_release
displayName: "Update default release in Docker appliance"
steps:
- download: current
artifact: working
- checkout: HelmRepo
path: assemblyline-docker-compose
persistCredentials: true
- script: |
set -exv # Echo commands before they are run
if [[ "$TAG" == *stable* ]]
then
cd $(Agent.BuildDirectory)/assemblyline-docker-compose
chmod -R a+rw .
sed -i 's/AL_VERSION=.*/AL_VERSION='$TAG'/g' .env
git add .
git config --global user.email "[email protected]"
git config --global user.name "Azure Pipeline"
git commit -m "Pipeline: Release $TAG"
git push
fi
workingDirectory: $(Pipeline.Workspace)/working/
displayName: "Patch the default release version to the latest stable"
retryCountOnTaskFailure: 3
- job: update_odm_docs
displayName: "Update Assemblyline4 Documentation"
steps:
Expand All @@ -319,20 +382,21 @@ stages:
- script: |
set -exv # Echo commands before they are run
# Prepare output directory
cp -rf $(Agent.BuildDirectory)/assemblyline4_docs .
(cd assemblyline4_docs && git checkout master)
chmod -R a+rw ./assemblyline4_docs
# Generate documentation from script
docker run -v $PWD/assemblyline4_docs:/tmp/assemblyline4_docs:rw \
-v $PWD/assemblyline-base:/tmp/assemblyline-base:ro \
-v $PWD/gen_docs.py:/tmp/gen_docs.py:ro \
-w /tmp \
cccstemp.azurecr.io/assemblyline:${TAG} \
/bin/bash -c 'pip install mkdocs-material==7.3.6 mkdocs-static-i18n && python gen_docs.py . "/assemblyline4_docs"'
if [[ "$TAG" == *stable* ]]
then
# Prepare output directory
cp -rf $(Agent.BuildDirectory)/assemblyline4_docs .
(cd assemblyline4_docs && git checkout master)
chmod -R a+rw ./assemblyline4_docs
# Generate documentation from script
docker run -v $PWD/assemblyline4_docs:/tmp/assemblyline4_docs:rw \
-v $PWD/assemblyline-base:/tmp/assemblyline-base:ro \
-v $PWD/gen_docs.py:/tmp/gen_docs.py:ro \
-w /tmp \
cccstemp.azurecr.io/assemblyline:${TAG} \
/bin/bash -c 'pip install mkdocs-material==7.3.6 mkdocs-static-i18n && python gen_docs.py . "/assemblyline4_docs"'
# Commit documentation changes (if any) to Documentation repo
cd assemblyline4_docs
if [[ `git status --porcelain` ]]; then
Expand Down

0 comments on commit aa04e1c

Please sign in to comment.