Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
6750d54
better buildkitd support
diclophis Jan 27, 2023
1201021
repair bits
diclophis Jan 27, 2023
0982999
cleanup bits
diclophis Jan 27, 2023
6ee2ef0
add varying platform vertical.yaml configuration
diclophis May 16, 2023
a5dc1ed
updates in CHANGELOG.md
diclophis May 16, 2023
7fab3ac
updates in CHANGELOG.md
diclophis May 16, 2023
115b316
updates in CHANGELOG.md
diclophis May 16, 2023
27f6ad8
updates in CHANGELOG.md
diclophis May 16, 2023
e576284
updates in CHANGELOG.md
diclophis May 17, 2023
a0f9d12
more ux and code improvement
diclophis May 18, 2023
873f324
ux tweaks
diclophis May 18, 2023
ae46862
more ux cleanup
diclophis May 18, 2023
213b6dc
Merge branch '4.0-rc-1' of github.com:unhookd/polly into 4.0-rc-1
diclophis May 18, 2023
1e25840
update ux
diclophis May 18, 2023
9aa4744
add private k3s registry build bits
diclophis May 18, 2023
ef4b970
Merge branch '4.0-rc-1' of github.com:unhookd/polly into 4.0-rc-1
diclophis May 18, 2023
2f0a365
add polly rxn
diclophis May 19, 2023
9437307
repair in-cluster k8s registry
diclophis May 19, 2023
20603f1
allow cert package
diclophis May 19, 2023
ee95214
polly-registry listens on 23443
diclophis May 19, 2023
b49ff2d
configure ca-file and bits for polly-registry, and pre-init git-config
diclophis May 19, 2023
c1da8ac
Merge branch '4.0-rc-1' of github.com:unhookd/polly into 4.0-rc-1
diclophis May 19, 2023
ce4e1e4
better layer caching
diclophis May 19, 2023
05082bf
repair port
diclophis May 19, 2023
811434f
Merge branch '4.0-rc-1' of github.com:unhookd/polly into 4.0-rc-1
diclophis May 19, 2023
b4f2251
bad version
diclophis May 20, 2023
b060100
bits
diclophis May 20, 2023
7dbecfb
updates in CHANGELOG.md
diclophis May 20, 2023
0b9f897
make -it togglable
diclophis May 20, 2023
d532161
repair dns bits
diclophis May 20, 2023
819c546
repair cname creation
diclophis May 20, 2023
76b4c80
make p12 export function
diclophis May 21, 2023
f360590
Merge branch '4.0-rc-1' of github.com:unhookd/polly into 4.0-rc-1
diclophis May 22, 2023
e116895
better timeout for shr and rxn
diclophis May 25, 2023
32dc415
update to ruby 3
diclophis Jun 18, 2023
edcb276
Merge branch '3.0-rc1' into 4.0-rc-2
diclophis Jun 18, 2023
819e8cf
update thor version for better ruby3x support
diclophis Jun 21, 2023
be39e92
todo figure out how to map all secrets for single node instance case
diclophis Jun 21, 2023
065ed2d
better bootstrap sequence
diclophis Jun 27, 2023
ebbdcde
bits
diclophis Jul 31, 2023
3084127
bits
diclophis Jul 31, 2023
9ef7a96
bits
diclophis Jul 31, 2023
6784565
bits
diclophis Jul 31, 2023
a26d3d0
better container def args detection
diclophis Nov 10, 2023
ea7efac
better def rxn
diclophis Feb 6, 2024
28b4408
more debug and setup
diclophis Feb 7, 2024
dd5accf
Merge remote-tracking branch 'origin/4.0-rc-2' into 4.0-rc-3
diclophis Feb 7, 2024
7e85d5a
updates in CHANGELOG.md
diclophis Feb 7, 2024
b0a4dc8
add --stage support
diclophis Feb 7, 2024
a0d1a00
better args passing
diclophis Feb 29, 2024
81a7f4c
add polly deploy command
diclophis Mar 31, 2024
8d504c2
add polly gitch && polly build && polly deploy loop support
diclophis Mar 31, 2024
5044386
rebootstrap on debian bookworm
diclophis Apr 1, 2024
2eed3df
use specific version
diclophis Apr 1, 2024
e347556
rebootstrap gha action
diclophis Apr 1, 2024
50e611d
add missing envs
diclophis Apr 1, 2024
dbae672
rebootstrap from this branch base image
diclophis Apr 1, 2024
bbac762
add --no-tty ?
diclophis Apr 1, 2024
f951173
try --batch ?
diclophis Apr 1, 2024
127f2a0
ignore if keyring exists
diclophis Apr 1, 2024
1c998f3
remove old ref
diclophis Apr 1, 2024
f4ea6e5
update depedency gems
diclophis Apr 1, 2024
f73d4f2
redo bootstrap
diclophis Apr 1, 2024
3b9941e
redo bootstrap
diclophis Apr 1, 2024
c116e9f
updates in CHANGELOG.md
diclophis Apr 1, 2024
e5f6c12
repair git init polly test init
diclophis Apr 1, 2024
3e33fbc
better image artifact-first bootstrap
diclophis Apr 1, 2024
12d3d70
use full command override
diclophis Apr 1, 2024
8238ab6
better polly test
diclophis Apr 1, 2024
39ca051
try bootstrapping polly test with polly build
diclophis Apr 1, 2024
27b30b5
ensure git config is set
diclophis Apr 1, 2024
564a512
repair stdout
diclophis Apr 1, 2024
865d41c
use correct branch name on polly push
diclophis Apr 1, 2024
af4edc8
better app tag support
diclophis Apr 1, 2024
74e99fe
restore branch mode
diclophis Apr 1, 2024
2905862
even better branch name repair
diclophis Apr 1, 2024
826e763
more repair for polly test
diclophis Apr 1, 2024
3efad50
dont use ssh unless it is present
diclophis Apr 1, 2024
c900346
simple build
diclophis Apr 1, 2024
087f57a
try to confirm polly build in polly push
diclophis Apr 1, 2024
c0f7319
ensure capture of stderr
diclophis Apr 1, 2024
ead3b45
repair thor option
diclophis Apr 1, 2024
ec1baac
better checkout dir
diclophis Apr 1, 2024
254390b
use a better tmpdir
diclophis Apr 1, 2024
582322d
better config dir
diclophis Apr 1, 2024
2ab0f4c
just one config dir
diclophis Apr 1, 2024
c4502c6
use correct name
diclophis Apr 1, 2024
b4011c5
simpler shell command run.sh setup
diclophis Apr 1, 2024
1833b83
bits
diclophis Apr 1, 2024
33db805
possibly dont export client-side cache
diclophis Apr 1, 2024
0b7f2be
bits
diclophis Apr 2, 2024
afa566f
repair test
diclophis Apr 10, 2024
99f458f
simplify
diclophis Apr 10, 2024
7b973e7
new bits
diclophis Apr 10, 2024
2d75d5f
new bits
diclophis Apr 10, 2024
779ca11
better circleci compat
diclophis Apr 10, 2024
2b54c41
updates in CHANGELOG.md
diclophis Apr 10, 2024
a3dd75d
bits
diclophis Apr 10, 2024
6eb2273
rebootstrap
diclophis Apr 10, 2024
c6a4855
better async intermediate output for polly test
diclophis Apr 10, 2024
79e55d1
add updated circleci regen'd bootstrap test suite
diclophis Apr 10, 2024
45a1d24
updates in CHANGELOG.md
diclophis Apr 10, 2024
2fb4fa4
bits
diclophis Apr 10, 2024
3010856
add container_image syntax support
diclophis Apr 10, 2024
dde85a0
extra tag support
diclophis Apr 11, 2024
6355a39
Merge branch '4.0-rc-3' of github.com:unhookd/polly into 4.0-rc-3
diclophis Apr 11, 2024
84fc4c3
TODO: figure out why polly build + polly rxn is not working
diclophis Apr 12, 2024
9bf8ca9
split init and certificates
diclophis Apr 12, 2024
9d7da05
Merge branch '4.0-rc-3' of github.com:unhookd/polly into 4.0-rc-3
diclophis Apr 12, 2024
870bc6c
better polly deploy debug construction
diclophis Apr 12, 2024
244cd64
better tag support
diclophis Apr 12, 2024
139d2bb
match polly deploy tag to polly rxn tag
diclophis Apr 12, 2024
1361e49
refactor polly-controller/registry/buildkit resources to match polly …
diclophis Apr 12, 2024
e9c1019
comment out polly-registry ingress
diclophis Apr 12, 2024
b72d93c
use polly continuous --exec as polly push driver
diclophis Apr 12, 2024
ef56e5c
deploy polly-controller from polly push in polly repo
diclophis Apr 12, 2024
3172b08
just build on polly push
diclophis Apr 12, 2024
d9457c6
build and test
diclophis Apr 12, 2024
b5779fd
update rbac
diclophis Apr 12, 2024
f1efc6b
add cluster-wide rbac bits TODO: sort and minimize reqd RBAC for poll…
diclophis Apr 12, 2024
0cad6b5
add even more mega sudo root level RBAC ... TODO: reduce reqd privs
diclophis Apr 12, 2024
7188fc4
use correct apiGroups rbac policy spec
diclophis Apr 12, 2024
78a3380
rename command
diclophis Apr 12, 2024
b8203da
build, test and deploy
diclophis Apr 12, 2024
d2eab14
updates in CHANGELOG.md
diclophis Apr 12, 2024
3f2afe3
repair chown warning
diclophis Apr 12, 2024
8cc9f3c
resync build outputs generated auto gha
diclophis Apr 12, 2024
9031d34
add def exe
diclophis Jun 27, 2024
7568a85
Merge branch '4.0-rc-3' of github.com:unhookd/polly into 4.0-rc-3
diclophis Jun 27, 2024
0349fb5
fix bits
diclophis Jun 27, 2024
7ded9ba
add simple httpd static file server
diclophis Jul 1, 2024
3addcbf
Merge branch '4.0-rc-3' of github.com:unhookd/polly into 4.0-rc-3
diclophis Jul 1, 2024
89da494
update rxn utilz
diclophis Dec 5, 2024
7a90c2d
Merge branch '4.0-rc-3' of github.com:unhookd/polly into 4.0-rc-3
diclophis Dec 5, 2024
fad178d
ruby3 compat names
diclophis Jan 13, 2025
9b73242
add polly xxx
diclophis Mar 24, 2025
7e8bae8
repair spelling
diclophis Mar 24, 2025
53ca6df
Merge branch '4.0-rc-3' of github.com:unhookd/polly into 4.0-rc-3
diclophis Mar 24, 2025
0e4b08a
add --port to polly rxn
diclophis Mar 26, 2025
5a271b2
Merge branch '4.0-rc-3' of github.com:unhookd/polly into 4.0-rc-3
diclophis Mar 26, 2025
fc97847
Update Pollyfile
diclophis Jun 3, 2025
ce84773
Update Pollyfile
diclophis Jun 3, 2025
41a924c
Update generate.rb
diclophis Jun 3, 2025
36dcc7b
allow serviceAccountName override
diclophis Jun 4, 2025
07991f7
add --privileged annotations for kubectl rxn
diclophis Nov 14, 2025
04e6dc2
disable workdir chdir
diclophis Nov 14, 2025
3611edd
remove un-used dep
diclophis Nov 14, 2025
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
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#generated via: polly generate --mirror=circleci --registry=ghcr.io/unhookd > .circleci/config.yml
---
workflows:
version: 2
Expand All @@ -8,15 +9,15 @@ workflows:
version: 2
jobs:
primary:
working_directory: "/home/app/polly"
#working_directory: "/home/app/polly"
steps:
- checkout
- run:
name: primary
command: |-
echo DEMO!!!!
bundle config set --local path vendor/bundle
bundle install
bundle exec rspec
polly help
docker:
- image: ghcr.io/unhookd/polly:3.0-rc1
- image: ghcr.io/unhookd/polly:4.0-rc-3
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ vendor
.circleci
.github
Dockerfile
Pollyfile
Dockerfile.default
.dockerignore
Gemfile
*.swp
19 changes: 13 additions & 6 deletions .github/workflows/primary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:

container:
options: "--user 0"
#image: ubuntu:jammy-20220421
image: ghcr.io/unhookd/polly:3.0-rc1@sha256:7cc65086b101fe352a8ff83180888f0f7079b2f80139b0f39ba7b2a4cb34b168
image: public.ecr.aws/debian/debian:bookworm-20240311-slim
#image: ghcr.io/unhookd/polly:4.0-rc-3@sha256:1169fa172ec82abfaa368396aaad8be59d1879e76fcd115495567598d7500586

steps:
- uses: actions/checkout@v3
Expand All @@ -26,6 +26,12 @@ jobs:
run: |
set -ex

export DEBIAN_FRONTEND="noninteractive"
export LC_ALL="C.UTF-8"
export LANG="en_US"
export LANGUAGE="en_US"
export ACCEPT_EULA="y"

(getent group alpha || groupadd --gid 121 alpha);
(getent group tau || groupadd --gid 123 tau);
(getent group beta || groupadd --gid 134 beta);
Expand All @@ -36,15 +42,16 @@ jobs:
(getent passwd runner || useradd --uid 1001 --home-dir /home/runner --create-home --shell /bin/bash runner --groups alpha,beta,docker,theta,zeta,tau);
apt-get update; apt-get install -y locales locales-all; apt-get clean;
test -e /usr/lib/locale/locale-archive || ((locale-gen --purge en_US); (echo -e "LANG=$LANG\nLANGUAGE=$LANGUAGE\n" | tee /etc/default/locale); (locale-gen $LANGUAGE); (dpkg-reconfigure locales));
apt-get update; apt-get install -y vim git curl apt-transport-https aptitude ca-certificates apt-utils software-properties-common docker.io build-essential libyaml-dev ruby3* libruby3* ruby-bundler rubygems-integration rake amazon-ecr-credential-helper; apt-get clean;
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add;
apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main";
apt-get update; apt-get install -y vim git curl apt-transport-https aptitude ca-certificates apt-utils software-properties-common docker.io build-essential libyaml-dev ruby3* libruby3* ruby-bundler rubygems-integration rake amazon-ecr-credential-helper procps; apt-get clean;
test -e /etc/apt/keyrings/kubernetes-apt-keyring.gpg || (curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | gpg --batch --no-tty --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg);
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list;
apt-get update; apt-get install -y kubectl; apt-get clean;
usermod -a -G $(grep docker /etc/group | cut -d: -f3) app;
usermod -a -G $(grep docker /etc/group | cut -d: -f3) runner;
mkdir /tmp/buildkit && cd /tmp/buildkit && curl -sL -o buildkit.tar.gz "https://github.com/moby/buildkit/releases/download/v0.13.1/buildkit-v0.13.1.linux-amd64.tar.gz" && tar zxf buildkit.tar.gz && mv bin/buildctl /usr/local/bin && cd && rm -Rf /tmp/buildkit;

mkdir -p /polly/safe/git /polly/safe/run /polly/safe/tmp /polly/app /app /__w/polly/polly;
chown -R app.alpha /home/app /polly /app /__w/polly/polly;
chown -R app:alpha /home/app /polly /app /__w/polly/polly;
chown -R app /home/app /polly /app /__w/polly/polly;
chown -R app /home/app;
su app -s /bin/bash -c 'cd /__w/polly/polly && gem build polly.gemspec -o /home/app/polly-latest.gem';
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.bundle
vendor
Gemfile.lock
Dockerfile-pollygen*
*.swp
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
# [4.31.0] - 2024-04-12 - Jon Bardin

Add `polly tags` and initial prototype of build,test,deploy gitch ci

#######

# [4.30.0] - 2024-04-10 - Jon Bardin

better async output

#######

# [4.29.0] - 2024-04-10 - Jon Bardin

new version bits

#######

# [4.28.0] - 2024-04-01 - Jon Bardin

Upgrade base images and to ruby3

#######

# [4.27.0] - 2024-02-07 - Jon Bardin

Merge build features

#######

# [4.26.0] - 2023-05-19 - Jon

add more build/run options

#######

# [4.25.0] - 2023-05-16 - Jon Bardin

Allow `host-aliases` block to be defined and written out to /etc/hosts via cloud-init

#######

# [4.24.0] - 2023-05-16 - Jon Bardin

repair wxh git push hooks

#######

# [4.23.0] - 2023-05-16 - Jon Bardin

Add better version support

#######

# [2.22.0] - 2023-05-16 - Jon Bardin



#######

# [4.0.1] - 2023-05-16 - Jon Bardin

Add support for multi-platform launch configuration

#######

# [2.20.0] - 2023-01-22 - Jon Bardin

Test image container diff
Expand Down
19 changes: 13 additions & 6 deletions Dockerfile.default
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile-upstream:master-experimental
FROM ghcr.io/unhookd/polly:3.0-rc1@sha256:7cc65086b101fe352a8ff83180888f0f7079b2f80139b0f39ba7b2a4cb34b168 AS base
FROM public.ecr.aws/debian/debian:bookworm-20240311-slim AS base
USER root
ENV DEBIAN_FRONTEND=noninteractive LC_ALL=C.UTF-8 LANG=en_US LANGUAGE=en_US ACCEPT_EULA=y
RUN set -ex; \
Expand All @@ -13,12 +13,13 @@ RUN set -ex; \
(getent passwd runner || useradd --uid 1001 --home-dir /home/runner --create-home --shell /bin/bash runner --groups alpha,beta,docker,theta,zeta,tau); \
apt-get update; apt-get install -y locales locales-all; apt-get clean; \
test -e /usr/lib/locale/locale-archive || ((locale-gen --purge en_US); (echo -e "LANG=$LANG\nLANGUAGE=$LANGUAGE\n" | tee /etc/default/locale); (locale-gen $LANGUAGE); (dpkg-reconfigure locales)); \
apt-get update; apt-get install -y vim git curl apt-transport-https aptitude ca-certificates apt-utils software-properties-common docker.io build-essential libyaml-dev ruby3* libruby3* ruby-bundler rubygems-integration rake amazon-ecr-credential-helper; apt-get clean; \
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add; \
apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"; \
apt-get update; apt-get install -y vim git curl apt-transport-https aptitude ca-certificates apt-utils software-properties-common docker.io build-essential libyaml-dev ruby3* libruby3* ruby-bundler rubygems-integration rake amazon-ecr-credential-helper procps; apt-get clean; \
test -e /etc/apt/keyrings/kubernetes-apt-keyring.gpg || (curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | gpg --batch --no-tty --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg); \
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list; \
apt-get update; apt-get install -y kubectl; apt-get clean; \
usermod -a -G $(grep docker /etc/group | cut -d: -f3) app; \
usermod -a -G $(grep docker /etc/group | cut -d: -f3) runner; \
mkdir /tmp/buildkit && cd /tmp/buildkit && curl -sL -o buildkit.tar.gz "https://github.com/moby/buildkit/releases/download/v0.13.1/buildkit-v0.13.1.linux-amd64.tar.gz" && tar zxf buildkit.tar.gz && mv bin/buildctl /usr/local/bin && cd && rm -Rf /tmp/buildkit; \
true;
# syntax=docker/dockerfile-upstream:master-experimental
FROM base AS gem
Expand All @@ -32,7 +33,7 @@ COPY --chown=app bin /__w/polly/polly/bin
COPY --chown=app doc /__w/polly/polly/doc
RUN set -ex; \
mkdir -p /polly/safe/git /polly/safe/run /polly/safe/tmp /polly/app /app /__w/polly/polly; \
chown -R app.alpha /home/app /polly /app /__w/polly/polly; \
chown -R app:alpha /home/app /polly /app /__w/polly/polly; \
chown -R app /home/app /polly /app /__w/polly/polly; \
chown -R app /home/app; \
su app -s /bin/bash -c 'cd /__w/polly/polly && gem build polly.gemspec -o /home/app/polly-latest.gem'; \
Expand All @@ -43,6 +44,12 @@ WORKDIR /home/app
COPY --chown=app --from=gem /home/app/polly-latest.gem /home/app/polly-latest.gem
RUN set -ex; \
gem install --no-document --minimal-deps /home/app/polly-latest.gem && grep -Rn '\.gem\.' /var/lib 2>/dev/null | cut -d: -f1 | sort | uniq | xargs -I{} rm {} && rm /home/app/polly-latest.gem; \
ln -sf /usr/local/bin/polly /bin/dockerfile-frontend; \
true;
COPY --chown=app Pollyfile /home/app/Pollyfile
COPY --chown=app config/git-repo/templates /home/app/config/git-repo/templates
RUN set -ex; \
mkdir -p /polly/safe/git/polly/hooks && chown -R app:app /polly/safe; \
true;
USER app
LABEL "org.opencontainers.image.description"="For pollyci"
ENTRYPOINT ["/bin/dockerfile-frontend"]
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ gemspec

## https://github.com/rubygems/rubygems/issues/1104
group "development" do
gem "guard-rspec"
gem "rake"
gem "rspec"
end
93 changes: 62 additions & 31 deletions Pollyfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env ruby

@base = image {
stage "base", "ghcr.io/unhookd/polly:3.0-rc1@sha256:7cc65086b101fe352a8ff83180888f0f7079b2f80139b0f39ba7b2a4cb34b168"
#stage "base", "ghcr.io/unhookd/polly:3.0-rc1"
#stage "base", "ubuntu:jammy-20220421"
#stage "base", "ghcr.io/unhookd/polly:4.0-rc-3@sha256:1169fa172ec82abfaa368396aaad8be59d1879e76fcd115495567598d7500586"
stage "base", "public.ecr.aws/debian/debian:bookworm-20240311-slim"
#stage "base", "ghcr.io/unhookd/polly:4.0-rc-3"

root

Expand All @@ -20,23 +20,27 @@
group(1000, "theta")
group(1001, "zeta")

useradd(1000, "app", "alpha,beta,docker,theta,zeta,tau")
useradd(1000, "polly", "alpha,beta,docker,theta,zeta,tau")
useradd(1001, "runner", "alpha,beta,docker,theta,zeta,tau")

apt %w{locales locales-all}

run %q{test -e /usr/lib/locale/locale-archive || ((locale-gen --purge en_US); (echo -e "LANG=$LANG\nLANGUAGE=$LANGUAGE\n" | tee /etc/default/locale); (locale-gen $LANGUAGE); (dpkg-reconfigure locales))}

apt %w{vim git curl apt-transport-https aptitude ca-certificates apt-utils software-properties-common docker.io build-essential libyaml-dev ruby3* libruby3* ruby-bundler rubygems-integration rake amazon-ecr-credential-helper}
apt %w{vim git curl apt-transport-https aptitude ca-certificates apt-utils software-properties-common docker.io build-essential libyaml-dev ruby3* libruby3* ruby-bundler rubygems-integration rake amazon-ecr-credential-helper procps}

#run %q{curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add}
#run %q{apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"}
run %q{test -e /etc/apt/keyrings/kubernetes-apt-keyring.gpg || (curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | gpg --batch --no-tty --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg)}
run %q{echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list}

run %q{curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add}
run %q{apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"}
apt %w{kubectl}

run %q{usermod -a -G $(grep docker /etc/group | cut -d: -f3) app}
run %q{usermod -a -G $(grep docker /etc/group | cut -d: -f3) polly}
run %q{usermod -a -G $(grep docker /etc/group | cut -d: -f3) runner}

run %q{mkdir /tmp/buildkit && curl -sL -o buildkit.tar.gz "https://github.com/moby/buildkit/releases/download/v0.11.1/buildkit-v0.11.1.linux-amd64.tar.gz" && tar zxf buildkit.tar.gz && mv bin/buildctl /usr/local/bin && rm -Rf /tmp/buildkit}
buildkit_version = "v0.22.0"
run %Q{mkdir /tmp/buildkit && cd /tmp/buildkit && curl -sL -o buildkit.tar.gz "https://github.com/moby/buildkit/releases/download/#{buildkit_version}/buildkit-#{buildkit_version}.linux-amd64.tar.gz" && tar zxf buildkit.tar.gz && mv bin/buildctl /usr/local/bin && cd && rm -Rf /tmp/buildkit}
}

# image declares container artifacts
Expand All @@ -52,73 +56,100 @@

#TODO: more prototype-z detection
command("COPY") {
"--chown=app polly.gemspec VERSION CHANGELOG.md /__w/polly/polly/"
"--chown=polly polly.gemspec VERSION CHANGELOG.md /__w/polly/polly/"
}

command("COPY") {
"--chown=app Thorfile /__w/polly/polly/"
"--chown=polly Thorfile /__w/polly/polly/"
}

command("COPY") {
"--chown=app config /__w/polly/polly/config/"
"--chown=polly config /__w/polly/polly/config/"
}

command("COPY") {
"--chown=app lib /__w/polly/polly/lib"
"--chown=polly lib /__w/polly/polly/lib"
}

command("COPY") {
"--chown=app bin /__w/polly/polly/bin"
"--chown=polly bin /__w/polly/polly/bin"
}

command("COPY") {
"--chown=app doc /__w/polly/polly/doc"
"--chown=polly doc /__w/polly/polly/doc"
}

run %q{mkdir -p /polly/app /app /__w/polly/polly}
run %q{chown -R app.alpha /home/app /polly /app /__w/polly/polly}
run %q{chown -R app /home/app /polly /app /__w/polly/polly}
run %q{chown -R app /home/app}
run %q{su app -s /bin/bash -c 'cd /__w/polly/polly && gem build polly.gemspec -o /home/app/polly-latest.gem'}
run %q{mkdir -p /polly/safe/git /polly/safe/run /polly/safe/tmp /polly/polly /polly /__w/polly/polly}
run %q{chown -R polly:alpha /home/polly /polly /polly /__w/polly/polly}
run %q{chown -R polly /home/polly /polly /polly /__w/polly/polly}
run %q{chown -R polly /home/polly}
run %q{su polly -s /bin/bash -c 'cd /__w/polly/polly && gem build polly.gemspec -o /home/polly/polly-latest.gem'}
}

# final bits are just the .gem install as if on end-user box
@deploy = image {
stage "deploy", @base.stage

command("WORKDIR") {
"/home/app"
"/home/polly"
}

command("COPY") {
"--chown=polly --from=gem /home/polly/polly-latest.gem /home/polly/polly-latest.gem"
}

run %q{gem install --no-document --minimal-deps /home/polly/polly-latest.gem && grep -Rn '\.gem\.' /var/lib 2>/dev/null | cut -d: -f1 | sort | uniq | xargs -I{} rm {} && rm /home/polly/polly-latest.gem}

run %q{ln -sf /usr/local/bin/polly /bin/dockerfile-frontend}

command("COPY") {
"--chown=polly Pollyfile /home/polly/Pollyfile"
}

command("COPY") {
"--chown=app --from=gem /home/app/polly-latest.gem /home/app/polly-latest.gem"
"--chown=polly config/git-repo/templates /home/polly/config/git-repo/templates"
}

run %q{gem install --no-document --minimal-deps /home/app/polly-latest.gem && grep -Rn '\.gem\.' /var/lib 2>/dev/null | cut -d: -f1 | sort | uniq | xargs -I{} rm {} && rm /home/app/polly-latest.gem}
command("COPY") {
"--chown=polly kubernetes /home/polly/kubernetes"
}

run %q{mkdir -p /polly/safe/git/polly/hooks && chown -R polly:polly /polly/safe}

app

command("ENTRYPOINT") {
'["/bin/dockerfile-frontend"]'
}
}

#description("For pollyci")

workflow_image = "ghcr.io/unhookd/polly:3.0-rc1"
#TODO: !!!! make this make sense to configure workflow_image = "polly:latest"
#workflow_image = "ghcr.io/unhookd/polly:3.0-rc1"
#TODO: !!!! make this make sense to configure
#workflow_image = "polly-registry:23443/polly-registry/polly:latest"

@plain_workflow = plan {
job("primary",
[{"image"=>workflow_image}],
[
{"run"=>{"name"=>"demo","command"=>"echo DEMO!!!!"}},
#{"run"=>{"name"=>"demo","command"=>"echo DEMO?????"}},
#{"run"=>{"name"=>"demo","command"=>"sleep 300"}},
#{"run"=>{"name"=>"demo","command"=>"echo DEMO!!!!"}},
#{"run"=>{"name"=>"demo","command"=>"polly generate > Dockerfile"}},
#{"run"=>{"name"=>"demo","command"=>"polly help"}},
#{"run"=>{"name"=>"demo","command"=>"sleep infinity"}},
#{"run"=>{"name"=>"demo","command"=>"polly build"}},
{"run"=>{"name"=>"config","command"=>"bundle config set --local path vendor/bundle"}},
{"run"=>{"name"=>"bundler","command"=>"bundle install"}},
{"run"=>{"name"=>"rspec","command"=>"bundle exec rspec"}},
{"run"=>{"name"=>"build","command"=>"buildctl --addr kube-pod://buildkitd build --frontend dockerfile.v0 --local context=. --local dockerfile=."}}
],{},"/home/app/polly"
{"run"=>{"name"=>"demo","command"=>"polly help"}},
#{"run"=>{"name"=>"build","command"=>"pwd && ls -l && buildctl --timeout 120 --addr tcp://polly-buildkitd:1234 --tlsservername polly-buildkitd --tlscacert /certs/client/ca.pem --tlscert /certs/client/cert.pem --tlskey /certs/client/key.pem build --frontend dockerfile.v0 --local context=. --local dockerfile=."}}
],{},"/home/polly/polly"
)
}

@gitch_pipeline = continuous {
#TODO: !!!!
#publish @bootstrap_artifact
build @bootstrap_artifact
test @plain_workflow
deploy @example_instance
}
Loading
Loading