Skip to content

Commit

Permalink
Vendor2 (#66)
Browse files Browse the repository at this point in the history
* vendor

* make sure vendor is consistent

* simple release dockerfile

* smaller binaries

* push docker first
  • Loading branch information
yuval-k authored May 17, 2020
1 parent 0f6baf3 commit 7884b39
Show file tree
Hide file tree
Showing 699 changed files with 133,656 additions and 40,316 deletions.
51 changes: 37 additions & 14 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,52 @@ jobs:
run: |
go install github.com/hashicorp/packer/cmd/mapstructure-to-hcl2
go generate ./...
go mod vendor
if [[ $(git status --porcelain | wc -l) -ne 0 ]]; then
echo "Generating code produced a non-empty diff"
echo "Try running 'go install github.com/hashicorp/packer/cmd/mapstructure-to-hcl2 && go generate ./...' then re-pushing."
echo "Try running 'go install github.com/hashicorp/packer/cmd/mapstructure-to-hcl2 && go generate ./... && go mod vendor' then re-pushing."
git status --porcelain
git diff | cat
exit 1;
fi
- name: Build
run: |
go build -o packer-builder-arm-image .
go build -o flasher github.com/solo-io/packer-builder-arm-image/cmd/flasher
go build -ldflags="-s -w" -o packer-builder-arm-image .
go build -ldflags="-s -w" -o flasher github.com/solo-io/packer-builder-arm-image/cmd/flasher
docker build -t packer-builder-arm-image .
- name: Artifact packer-builder-arm-image
uses: actions/upload-artifact@v1
with:
name: packer-builder-arm-image
path: ./packer-builder-arm-image
- name: Artifact flasher
uses: actions/upload-artifact@v1
with:
name: flasher
path: ./flasher
release:
name: release
needs:
- build
runs-on: ubuntu-18.04
if: github.event.release.tag_name
steps:
- name: Download packer-builder-arm-image
uses: actions/download-artifact@v1
with:
name: packer-builder-arm-image
- name: Download flasher
uses: actions/download-artifact@v1
with:
name: flasher
- name: Push docker
env:
QUAY_IO_PASSWORD: ${{ secrets.QUAY_IO_PASSWORD }}
run: |
docker login quay.io --username "solo-io+solobot" --password $QUAY_IO_PASSWORD
docker build -t quay.io/solo-io/packer-builder-arm-image:${TAGGED_VERSION} -f Dockerfile.release .
docker push quay.io/solo-io/packer-builder-arm-image:${TAGGED_VERSION}
- name: Release packer-builder-arm-image
if: github.event.release.tag_name
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -53,20 +85,11 @@ jobs:
asset_name: packer-builder-arm-image
asset_content_type: application/octet-stream
- name: Release flasher
if: github.event.release.tag_name
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./flasher
asset_name: flasher
asset_content_type: application/octet-stream
- name: Push docker
if: github.event.release.tag_name
env:
QUAY_IO_PASSWORD: ${{ secrets.QUAY_IO_PASSWORD }}
run: |
docker login quay.io --username "solo-io+solobot" --password $QUAY_IO_PASSWORD
docker tag packer-builder-arm-image quay.io/solo-io/packer-builder-arm-image:${TAGGED_VERSION}
docker push quay.io/solo-io/packer-builder-arm-image:${TAGGED_VERSION}
asset_content_type: application/octet-stream
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ RUN apt-get update -qq \
sudo \
&& rm -rf /var/lib/apt/lists/*

ENV PACKER_VERSION 1.5.2
# use nightly release until packer 1.5.2 is released
ENV PACKER_VERSION 1.5.5

RUN wget https://github.com/hashicorp/packer/releases/download/nightly/packer_linux_amd64.zip -O /tmp/packer.zip && \
unzip /tmp/packer.zip -d /bin && \
Expand Down
23 changes: 23 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ubuntu:eoan

RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qqy \
qemu-user-static \
kpartx \
unzip \
wget \
curl \
sudo \
&& rm -rf /var/lib/apt/lists/*

ENV PACKER_VERSION 1.5.5

RUN wget https://github.com/hashicorp/packer/releases/download/nightly/packer_linux_amd64.zip -O /tmp/packer.zip && \
unzip /tmp/packer.zip -d /bin && \
mv /bin/pkg/packer_linux_amd64 /bin/packer && \
rm /tmp/packer.zip
WORKDIR /build
COPY entrypoint.sh /entrypoint.sh

COPY ./packer-builder-arm-image /bin/packer-builder-arm-image
ENTRYPOINT ["/entrypoint.sh"]
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10=
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
Expand Down
Loading

0 comments on commit 7884b39

Please sign in to comment.