Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hungran committed Mar 17, 2023
1 parent 218689a commit 6b747d3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 86 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Build action
on:
workflow_dispatch:
push:
# schedule:
# - cron: '15 3 * * *' # every day at 03:15 (just wanted to avoid midnight)
schedule:
- cron: '15 3 * * *' # every day at 03:15 (just wanted to avoid midnight)

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -42,8 +42,9 @@ jobs:

- uses: chainguard-dev/actions/melange-build@main
with:
config: azcopy.melange.yaml
config: azure-storage-azcopy.melange.yaml
sign-with-temporary-key: true
# archs: x86_64,aarch64
archs: x86_64

- uses: chainguard-images/actions/apko-publish@e61cb0631c83e84cadc21337be090ad06bf05da2
Expand Down Expand Up @@ -77,4 +78,4 @@ jobs:
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
sarif_file: 'trivy-results.sarif'
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


docker run --privileged --rm -v "${PWD}":/work \
cgr.dev/chainguard/melange build melange.yaml \
--arch x86_64,amd64 \
cgr.dev/chainguard/melange build azcopy.melange.yaml \
--arch x86_64 \
--signing-key melange.rsa

docker run --rm -v ${PWD}:/work cgr.dev/chainguard/apko \
Expand Down
89 changes: 16 additions & 73 deletions azcopy.melange.yaml
Original file line number Diff line number Diff line change
@@ -1,89 +1,32 @@
package:
name: azcopy-postgres
version: "10.17.0"
name: azure-storage-azcopy
version: 10.17.0
epoch: 0
description: tool azcopy and postgres client
description: The new Azure Storage data transfer utility - AzCopy v10
target-architecture:
- x86_64
- all
copyright:
- paths:
- "*"
attestation: TODO
license: MIT

environment:
contents:
keyring:
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
repositories:
- https://dl-cdn.alpinelinux.org/alpine/edge/main
- https://dl-cdn.alpinelinux.org/alpine/edge/community
- https://packages.wolfi.dev/bootstrap/stage3
- https://packages.wolfi.dev/os
keyring:
- https://packages.wolfi.dev/bootstrap/stage3/wolfi-signing.rsa.pub
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
packages:
# - wolfi-baselayout
- busybox
- ca-certificates-bundle
- build-base
- bash
- openssh
- openssl
- openssl-dev
- busybox
- go
# - libffi
# - libc6-compat
# - musl
# - libc-dev
# - make
# - linux-headers
- wget
- curl
- automake
- autoconf
- openssl-dev
- libedit-dev
- zlib-dev
- libxml2-dev
- bison
- flex
- execline-dev
- util-linux-dev
pipeline:
# Postgresql client
- uses: fetch
with:
expected-sha256: 13109e2b71f1139405c27201da3733a61ace72ee1c228d9c9f0320e06aee14c2
uri: https://ftp.postgresql.org/pub/source/v11.19/postgresql-11.19.tar.bz2
- uses: autoconf/configure
with:
opts: |
--mandir=/usr/share/man \
--with-openssl \
--with-libedit-preferred
# --with-uuid=e2fs requores util-linux, let's avoid this package for now
# MAKELEVEL=0 is used because of a postgresql build system bug:
# https://www.postgresql.org/message-id/15407-7b64e5de97dedc5e%40postgresql.org
- uses: autoconf/make
with:
opts: MAKELEVEL=0
- uses: autoconf/make-install
- uses: strip

- uses: fetch
with:
expected-sha256: f970ad5a68fb0a84935bedc687a6ed8a9d051791e61b032a433ff1cf0ac38105
uri: https://github.com/Azure/azure-storage-azcopy/archive/refs/tags/v${{package.version}}.tar.gz
extract: true


- name: Build
runs: |
tar -xvzf v${{package.version}}.tar.gz
cd azure-storage-azcopy-${{package.version}}
- runs: |
go build
mkdir -p ${{targets.destdir}}/usr/local/bin
mv ./azure-storage-azcopy "${{targets.destdir}}"/usr/local/bin/azcopy
chmod +x ${{targets.destdir}}/usr/local/bin/azcopy
subpackages:
- name: postgresql-11-client
description: PostgreSQL client
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/bin
mv ${{targets.destdir}}/usr/bin/psql ${{targets.subpkgdir}}/usr/bin/
install -D -m 0755 "./azure-storage-azcopy" -t "${{targets.destdir}}/usr/local/bin"
- uses: strip
16 changes: 9 additions & 7 deletions latest.apko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ contents:
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub
repositories:
- https://packages.wolfi.dev/os
- packages
- '@local ./packages'
packages:
- wolfi-baselayout
- busybox
- glibc
- bash
- azcopy-postgres
- azure-storage-azcopy@local
- postgresql-15-client
- libpq-15 # need to fix this upstream maybe??

accounts:
groups:
Expand All @@ -21,8 +21,10 @@ accounts:
gid: 65532
run-as: 65532

# entrypoint:
# command: /usr/local/bin/hello
entrypoint:
command: /usr/local/bin/azure-storage-azcopy
cmd: --help

archs:
- x86_64
- amd64
# - arm64

0 comments on commit 6b747d3

Please sign in to comment.