Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add docker build support #303

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:alpine AS builder

RUN apk update && apk add --no-cache \
build-base \
jq \
zip \
git; \
rm -rf /var/cache/apk/*

WORKDIR /app

COPY release.sh .
COPY possum.pem .

RUN ./release.sh

FROM scratch AS releaser

COPY --from=builder /app/privacypossum/possum.zip /
6 changes: 6 additions & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.PHONY: build
build:
@docker build \
--target=releaser \
--output=. \
.
7 changes: 7 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# How to build

Just run the following command:

```bash
make build
```
28 changes: 28 additions & 0 deletions build/possum.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC1owgVWIMD9GDI
ZbZF2qbkNouRV3LEl6m/RHlJX8L6CSVAJiQ8ItMVaiT5rqivbxW+Mus1NoP9YZQa
2sWlct6FEdTzN2zJJN6D2RX5cKJGIAxRWGtiGd6Bq7N0p1xG3EvHDPYNLmBZGJvZ
wUdL9VCfqGi00HibeTpxAIgBcYjoRcpgCNc0qA40CcSJxi4COUiNl+bWRzM5lKbS
evcji8wXO1E6sUp21eKglKrfXkJOTdM2veP4eNZK59bH+id9l/WGvDvuwAmxJQUW
dKQktOvnJHQ5VbiSzJTjsB+qZbJcMA4cVc3EGGXr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J5e77/RQdJhiLBsMcnt7/DkO4eJvvO2iQP7lzpQZAoGBAI2oPTccNgVj+aWLguqj
2Hjsh//LDOoihU0C5mGf5zLzf7Awi1eb5QrjdEZB/iyqjvtHjUAzGuLpcaDim7Gb
rCufDRHOJYzMBvpaYK+oFVCGes9nsbYqS/RsYWsUJleGuV7Si/TcWgGd+U/CBLYm
96supGJ5/24AdnMhR/cHDErn
-----END PRIVATE KEY-----
21 changes: 21 additions & 0 deletions build/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env sh

set -eou pipefail

# Clone git repo.
git clone --depth=1 --branch master --single-branch https://github.com/cowlicks/privacypossum.git
cd privacypossum || exit

# Edit the manifest.json version number to the form year.month.day with no leading zeros.
today=$(date '+%Y.%-m.%-d')
target="src/manifest.json"
sed -i "s/2019.7.18/${today}/g" ${target}

# Save and commit.
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git add . && git commit -m "release"

# Run make release, this tags the repo with the manifest version and builds a zip file.
cp ../possum.pem .
make release