Created
May 11, 2023 04:20
-
-
Save ArthurN/d008025c94b088016a4572a09d0af7c3 to your computer and use it in GitHub Desktop.
Fitstack - Azure Pipeline Example
This file contains hidden or 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
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