From 6ad482d83737d0636d134f3ce68d3e787b99e1e7 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Thu, 16 Feb 2023 13:23:31 +0800 Subject: [PATCH] update --- .github/workflows/golden-image-pipeline.yaml | 28 +++++++++++++++++++ Readme.md | 6 ++-- .../workflows/packer => packer}/bootstrap.sh | 0 {.github/workflows/packer => packer}/build.sh | 0 .../golden-image-pipeline.yaml | 0 .../packer => packer}/ubuntu-os-ami.json | 0 .../ubuntu-os-ami.json.pkr.hcl | 0 7 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/golden-image-pipeline.yaml rename {.github/workflows/packer => packer}/bootstrap.sh (100%) rename {.github/workflows/packer => packer}/build.sh (100%) rename {.github/workflows/packer => packer}/golden-image-pipeline.yaml (100%) rename {.github/workflows/packer => packer}/ubuntu-os-ami.json (100%) rename {.github/workflows/packer => packer}/ubuntu-os-ami.json.pkr.hcl (100%) diff --git a/.github/workflows/golden-image-pipeline.yaml b/.github/workflows/golden-image-pipeline.yaml new file mode 100644 index 0000000..01c3326 --- /dev/null +++ b/.github/workflows/golden-image-pipeline.yaml @@ -0,0 +1,28 @@ +name: Create AWS Golden AMI + pull_request: + push: + paths: + - '.github/workflows/packer/build.sh' + - '.github/workflows/packer/bootstrap.sh' + - '.github/workflows/packer/ubuntu-os-ami.json' + - '.github/workflows/packer/ubuntu-os-ami.json.pkr.hcl' + - '.github/workflows/packer/golden-image-pipeline.yaml' + branches: + - main + +jobs: + create-golden-ami: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Packer + run: sudo apt-get install -y zip unzip jq + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Download Packer + run: wget https://releases.hashicorp.com/packer/1.6.2/packer_1.6.2_linux_amd64.zip + shell: bash + - name: Create Golden image + run: packer/build.sh + shell: bash diff --git a/Readme.md b/Readme.md index b15f0e3..fe1f157 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,5 @@ -git clone https://github.com/fluxcd/image-automation-controller.git --branch v0.24.0 && cd image-automation-controller && git switch -c main && rm -rvf .git* - +## Howto +1. clone repo +2. create repo Actions secrets and variables: HELM_REPO_PASSWORD +3. push your code will be tigger github ci pipeline diff --git a/.github/workflows/packer/bootstrap.sh b/packer/bootstrap.sh similarity index 100% rename from .github/workflows/packer/bootstrap.sh rename to packer/bootstrap.sh diff --git a/.github/workflows/packer/build.sh b/packer/build.sh similarity index 100% rename from .github/workflows/packer/build.sh rename to packer/build.sh diff --git a/.github/workflows/packer/golden-image-pipeline.yaml b/packer/golden-image-pipeline.yaml similarity index 100% rename from .github/workflows/packer/golden-image-pipeline.yaml rename to packer/golden-image-pipeline.yaml diff --git a/.github/workflows/packer/ubuntu-os-ami.json b/packer/ubuntu-os-ami.json similarity index 100% rename from .github/workflows/packer/ubuntu-os-ami.json rename to packer/ubuntu-os-ami.json diff --git a/.github/workflows/packer/ubuntu-os-ami.json.pkr.hcl b/packer/ubuntu-os-ami.json.pkr.hcl similarity index 100% rename from .github/workflows/packer/ubuntu-os-ami.json.pkr.hcl rename to packer/ubuntu-os-ami.json.pkr.hcl