Skip to content

fix: add seed job for consumer flyway docker image #33

fix: add seed job for consumer flyway docker image

fix: add seed job for consumer flyway docker image #33

Workflow file for this run

---
# This workflow will validate the Packer AMI templates created using the
# Hashicorp Configuration Language (HCL2)
name: Packer AMI template validation
on:
workflow_dispatch:
pull_request:
branches: [master]
jobs:
validate:
runs-on: ubuntu-latest
environment: ${{ vars.ENVIRONMENT }}
name: Validate packer template for the custom AMI
steps:
- name: Checkout code from branch
uses: actions/checkout@v3
- name: Jenkins Configuration as Code artifacts
run: |
cd jenkins && cp jcasc.yaml ../ && cd ..
cd scripts && cp *.groovy ../ && cd ..
tar -czvf configs.tgz jcasc.yaml *.groovy
rm -rf jcasc.yaml *.groovy
- name: Create & configure Packer variables
run: |
touch ami.pkrvars.hcl
echo ami_prefix=\"${{ vars.AMI_PREFIX }}\" >> ami.pkrvars.hcl
echo OS=\"${{ vars.OS }}\" >> ami.pkrvars.hcl
echo ubuntu_version=\"${{ vars.UBUNTU_VERSION }}\" >> ami.pkrvars.hcl
echo ssh_username=\"${{ vars.SSH_USERNAME }}\" >> ami.pkrvars.hcl
echo subnet_id=\"${{ secrets.SUBNET_ID }}\" >> ami.pkrvars.hcl
echo source_ami=\"${{ vars.SOURCE_AMI }}\" >> ami.pkrvars.hcl
echo aws_region=\"${{ vars.AWS_REGION }}\" >> ami.pkrvars.hcl
echo instance_type=\"${{ vars.INSTANCE_TYPE}}\" >> ami.pkrvars.hcl
echo volume_size=\"${{ vars.VOLUME_SIZE}}\" >> ami.pkrvars.hcl
echo volume_type=\"${{ vars.VOLUME_TYPE}}\" >> ami.pkrvars.hcl
echo device_name=\"${{ vars.DEVICE_NAME}}\" >> ami.pkrvars.hcl
- name: Setup `packer`
uses: hashicorp/setup-packer@main
id: setup
with:
version: "latest"
- name: Packer format
id: fmt
run: "packer fmt ."
- name: Packer init
id: init
run: "packer init ubuntu.ami.pkr.hcl"
- name: Validate packer template
id: validate
run: "packer validate -evaluate-datasources \
-var 'ami_users=${{ secrets.AMI_USERS }}' \
--var-file=ami.pkrvars.hcl ubuntu.ami.pkr.hcl"