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

fix: uses correct id in argocd container #87

Merged
merged 15 commits into from
Nov 26, 2024
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
earthly_token: ${{ secrets.earthly_token }}

release:
uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@master
uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@fix-argo-container
needs: [discover, check, build, test]
if: (fromJson(needs.discover.outputs.releases)[0] != null) && !failure() && !cancelled()
with:
Expand Down
2 changes: 1 addition & 1 deletion foundry/api/blueprint.cue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ project: {
environment: "dev"
modules: main: {
container: "foundry-api-deployment"
version: "0.1.0"
version: "0.1.1"
values: {
environment: name: "dev"
server: image: {
Expand Down
12 changes: 7 additions & 5 deletions tools/argocd/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VERSION 0.8
timoni:
FROM golang:1.23.0

ARG TIMONI_VERSION=v0.22.1
ARG TIMONI_VERSION=v0.17.0

WORKDIR /work

Expand All @@ -20,7 +20,8 @@ docker:
ARG TARGETARCH
ARG USERPLATFORM

RUN useradd -m argocd
RUN apt-get update && apt-get install -y ca-certificates amazon-ecr-credential-helper
RUN useradd -m -u 999 argocd

USER argocd
WORKDIR /home/argocd
Expand All @@ -36,7 +37,8 @@ docker:
RUN mkdir -p cmp-server/config
COPY plugin.yml cmp-server/config/plugin.yaml

ENTRYPOINT [ "/var/run/argocd/argocd-cmp-server" ]
SAVE IMAGE ${container}:${tag}

COPY init.sh /home/argocd/init.sh
RUN chmod +x /home/argocd/init.sh

ENTRYPOINT [ "/var/run/argocd/argocd-cmp-server", "--loglevel=info" ]
SAVE IMAGE ${container}:${tag}
5 changes: 3 additions & 2 deletions tools/argocd/blueprint.cue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ project: {
release: {
docker: {
on: {
merge: {}
tag: {}
//merge: {}
//tag: {}
always: {}
}
config: {
tag: _ @forge(name="GIT_COMMIT_HASH")
Expand Down
16 changes: 16 additions & 0 deletions tools/argocd/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail
set -o xtrace

ACCOUNT_ID=$(echo "${AWS_ROLE_ARN}" | cut -d':' -f5)
mkdir -p /home/argocd/.docker
cat >/home/argocd/.docker/config.json <<EOF
{
"credHelpers": {
"${ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com": "ecr-login"
}
}
EOF