Skip to content

Instantly share code, notes, and snippets.

@ArthurN
Created May 11, 2023 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArthurN/d008025c94b088016a4572a09d0af7c3 to your computer and use it in GitHub Desktop.
Save ArthurN/d008025c94b088016a4572a09d0af7c3 to your computer and use it in GitHub Desktop.
Fitstack - Azure Pipeline Example
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
variables:
imageName: 'your-app-image'
testScript: 'YOUR-TEST-SCRIPT.SH'
steps:
# ADD STEPS HERE TO BUILD/DOWNLOAD YOUR APP IMAGE
- bash: |
echo "Downloading ContainerFit installer..."
curl -fSs -O https://fitstack-rel-cicd.s3.us-west-2.amazonaws.com/install.sh
- bash: ./install.sh
displayName: Install ContainerFit
- bash : |
${HOME}/fitstack/ContainerFit -m ${{ variables.imageName }} -t ${{ variables.testScript }}
displayName: "Run ContainerFit"
- bash: |
DEBLOATED_IMAGE_NAME=$(cat /tmp/output/*/summary.json | jq -r .debloated_image_name)
echo "##vso[task.setvariable variable=DEBLOATED_IMAGE_NAME]$DEBLOATED_IMAGE_NAME"
- bash: |
docker save $(DEBLOATED_IMAGE_NAME) -o $(Pipeline.Workspace)/$(DEBLOATED_IMAGE_NAME).tar
displayName: Save debloated image
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)/$(DEBLOATED_IMAGE_NAME).tar'
artifact: 'DebloatedImage'
publishLocation: 'pipeline'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment