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

mve (do not merge) #90

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5243570
fix: uses correct id in argocd container
jmgilman Oct 23, 2024
85a855d
wip: fix
jmgilman Oct 23, 2024
d018c20
wip: fix
jmgilman Oct 23, 2024
9aac7a9
fix: adds ca certs
jmgilman Oct 23, 2024
b96428c
Add init.sh script
benbooth493 Oct 24, 2024
3efc66f
Move to root
benbooth493 Oct 24, 2024
2d6be7e
Set execute bit
benbooth493 Oct 24, 2024
80a0230
fix: try version 0.17.0
jmgilman Oct 24, 2024
cb1295e
wip: adds ECR helper
jmgilman Oct 24, 2024
622f5b1
Bump version
benbooth493 Oct 29, 2024
e4c73cc
wip: adds debug flag
jmgilman Oct 29, 2024
d878806
chore: merge branch 'master' into fix-argo-container
jmgilman Oct 30, 2024
df9c6ac
wip: testing
jmgilman Oct 30, 2024
680725d
wip: testing
jmgilman Oct 30, 2024
c5265f3
wip: testing
jmgilman Oct 30, 2024
0b8c17d
chore: merge branch 'master' into mve
jmgilman Oct 30, 2024
47a66fd
wip: testing
jmgilman Oct 30, 2024
44ba1ac
wip: testing
jmgilman Oct 30, 2024
044e318
wip: testing
jmgilman Oct 30, 2024
a129b13
wip: use always
jmgilman Oct 31, 2024
62191d5
chore: merge branch 'master' into mve
jmgilman Oct 31, 2024
4bb4a84
wip: switch namespace
jmgilman Oct 31, 2024
f8486e2
Use new deployment module
benbooth493 Nov 4, 2024
bd28f26
Use expected data structure
benbooth493 Nov 4, 2024
bcd6654
Move environment key to correct place
benbooth493 Nov 4, 2024
78f2367
Bump version
benbooth493 Nov 4, 2024
b0ea725
Bump version
benbooth493 Nov 4, 2024
32e4b4b
Bump version
benbooth493 Nov 4, 2024
625b54b
Bump version and specify pre-sync values
benbooth493 Nov 6, 2024
2500cad
Fix typo
benbooth493 Nov 6, 2024
9792447
Bump version (again)
benbooth493 Nov 6, 2024
ffc9900
Fixed typo
benbooth493 Nov 6, 2024
fc00f59
New version
benbooth493 Nov 6, 2024
711bc98
Bump version
benbooth493 Nov 6, 2024
58c8bef
Bumped version
benbooth493 Nov 6, 2024
e4085bb
Bump version
benbooth493 Nov 6, 2024
1cd4a4d
Bump version
benbooth493 Nov 6, 2024
6449591
Bump version
benbooth493 Nov 6, 2024
38a3f40
Bump version
benbooth493 Nov 6, 2024
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
144 changes: 73 additions & 71 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@master
uses: input-output-hk/catalyst-forge/actions/install@mve
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@master
uses: input-output-hk/catalyst-forge/actions/install-local@mve
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -61,14 +61,14 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@master
uses: input-output-hk/catalyst-forge/actions/setup@mve
with:
skip_docker: 'true'
skip_github: 'true'
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Discovery
id: discovery
uses: input-output-hk/catalyst-forge/actions/discovery@master
uses: input-output-hk/catalyst-forge/actions/discovery@mve
with:
filters: |
${{ env.FORGE_REGEX_CHECK }}
Expand All @@ -79,67 +79,68 @@ jobs:
${{ env.FORGE_REGEX_RELEASE }}
${{ env.FORGE_REGEX_PUBLISH }}

check:
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
needs: [discover]
if: (fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$'] != null) && !failure() && !cancelled()
with:
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$']) }}
forge_version: ${{ inputs.forge_version }}
local: ${{ inputs.local }}
verbosity: ${{ inputs.verbosity }}
secrets:
earthly_token: ${{ secrets.earthly_token }}
# check:
# uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@mve
# needs: [discover]
# if: (fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$'] != null) && !failure() && !cancelled()
# with:
# earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$']) }}
# forge_version: ${{ inputs.forge_version }}
# local: ${{ inputs.local }}
# verbosity: ${{ inputs.verbosity }}
# secrets:
# earthly_token: ${{ secrets.earthly_token }}

build:
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
needs: [discover, check]
if: (fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$'] != null) && !failure() && !cancelled()
with:
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$']) }}
forge_version: ${{ inputs.forge_version }}
local: ${{ inputs.local }}
verbosity: ${{ inputs.verbosity }}
secrets:
earthly_token: ${{ secrets.earthly_token }}
# build:
# uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@mve
# needs: [discover, check]
# if: (fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$'] != null) && !failure() && !cancelled()
# with:
# earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$']) }}
# forge_version: ${{ inputs.forge_version }}
# local: ${{ inputs.local }}
# verbosity: ${{ inputs.verbosity }}
# secrets:
# earthly_token: ${{ secrets.earthly_token }}

package:
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
needs: [discover, check, build]
if: (fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$'] != null) && !failure() && !cancelled()
with:
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$']) }}
forge_version: ${{ inputs.forge_version }}
local: ${{ inputs.local }}
verbosity: ${{ inputs.verbosity }}
secrets:
earthly_token: ${{ secrets.earthly_token }}
# package:
# uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@mve
# needs: [discover, check, build]
# if: (fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$'] != null) && !failure() && !cancelled()
# with:
# earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$']) }}
# forge_version: ${{ inputs.forge_version }}
# local: ${{ inputs.local }}
# verbosity: ${{ inputs.verbosity }}
# secrets:
# earthly_token: ${{ secrets.earthly_token }}

test:
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
needs: [discover, check, build, package]
if: (fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$'] != null) && !failure() && !cancelled()
with:
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$']) }}
forge_version: ${{ inputs.forge_version }}
local: ${{ inputs.local }}
verbosity: ${{ inputs.verbosity }}
secrets:
earthly_token: ${{ secrets.earthly_token }}
# test:
# uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@mve
# needs: [discover, check, build, package]
# if: (fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$'] != null) && !failure() && !cancelled()
# with:
# earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$']) }}
# forge_version: ${{ inputs.forge_version }}
# local: ${{ inputs.local }}
# verbosity: ${{ inputs.verbosity }}
# secrets:
# earthly_token: ${{ secrets.earthly_token }}

docs:
uses: input-output-hk/catalyst-forge/.github/workflows/docs.yml@master
needs: [discover, check, build, test]
if: (fromJson(needs.discover.outputs.earthfiles)['^docs(-.*)?$'] != null) && !failure() && !cancelled()
with:
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^docs(-.*)?$']) }}
forge_version: ${{ inputs.forge_version }}
secrets:
earthly_token: ${{ secrets.earthly_token }}
# docs:
# uses: input-output-hk/catalyst-forge/.github/workflows/docs.yml@mve
# needs: [discover, check, build, test]
# if: (fromJson(needs.discover.outputs.earthfiles)['^docs(-.*)?$'] != null) && !failure() && !cancelled()
# with:
# earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^docs(-.*)?$']) }}
# forge_version: ${{ inputs.forge_version }}
# secrets:
# earthly_token: ${{ secrets.earthly_token }}

release:
uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@master
needs: [discover, check, build, test]
uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@mve
#needs: [discover, check, build, test]
needs: [discover]
if: (fromJson(needs.discover.outputs.releases)[0] != null) && !failure() && !cancelled()
with:
releases: ${{ needs.discover.outputs.releases }}
Expand All @@ -149,20 +150,21 @@ jobs:
secrets:
earthly_token: ${{ secrets.earthly_token }}

deploy:
uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@master
needs: [discover, check, build, test, release]
if: (fromJson(needs.discover.outputs.deployments)[0] != null) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && !failure() && !cancelled()
with:
deployments: ${{ needs.discover.outputs.deployments }}
forge_version: ${{ inputs.forge_version }}
local: ${{ inputs.local }}
verbosity: ${{ inputs.verbosity }}
secrets:
earthly_token: ${{ secrets.earthly_token }}
# deploy:
# uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@mve
# needs: [discover, check, build, test, release]
# if: (fromJson(needs.discover.outputs.deployments)[0] != null) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && !failure() && !cancelled()
# with:
# deployments: ${{ needs.discover.outputs.deployments }}
# forge_version: ${{ inputs.forge_version }}
# local: ${{ inputs.local }}
# verbosity: ${{ inputs.verbosity }}
# secrets:
# earthly_token: ${{ secrets.earthly_token }}

final:
needs: [check, build, package, test, release]
#needs: [check, build, package, test, release]
needs: [discover]
if: (!failure() && !cancelled())
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@master
uses: input-output-hk/catalyst-forge/actions/install@mve
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@master
uses: input-output-hk/catalyst-forge/actions/install-local@mve
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -61,11 +61,11 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@master
uses: input-output-hk/catalyst-forge/actions/setup@mve
with:
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Deploy
uses: input-output-hk/catalyst-forge/actions/run@master
uses: input-output-hk/catalyst-forge/actions/run@mve
with:
command: deploy push
args: ${{ matrix.deployment }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@master
uses: input-output-hk/catalyst-forge/actions/install@mve
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@master
uses: input-output-hk/catalyst-forge/actions/install-local@mve
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -64,11 +64,11 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@master
uses: input-output-hk/catalyst-forge/actions/setup@mve
with:
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Run
uses: input-output-hk/catalyst-forge/actions/run@master
uses: input-output-hk/catalyst-forge/actions/run@mve
with:
command: run
args: --artifact ${{ env.OUTPUT }} ${{ matrix.earthfile }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@master
uses: input-output-hk/catalyst-forge/actions/install@mve
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@master
uses: input-output-hk/catalyst-forge/actions/install-local@mve
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -65,11 +65,11 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@master
uses: input-output-hk/catalyst-forge/actions/setup@mve
with:
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Release
uses: input-output-hk/catalyst-forge/actions/run@master
uses: input-output-hk/catalyst-forge/actions/run@mve
with:
command: release
args: ${{ matrix.release.project }} ${{ matrix.release.name }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@master
uses: input-output-hk/catalyst-forge/actions/install@mve
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@master
uses: input-output-hk/catalyst-forge/actions/install-local@mve
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -62,11 +62,11 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@master
uses: input-output-hk/catalyst-forge/actions/setup@mve
with:
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Run
uses: input-output-hk/catalyst-forge/actions/run@master
uses: input-output-hk/catalyst-forge/actions/run@mve
with:
command: run
args: ${{ matrix.earthfile }}
Expand Down
25 changes: 18 additions & 7 deletions foundry/api/blueprint.cue
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,32 @@ project: {
deployment: {
environment: "dev"
modules: main: {
container: "foundry-api-deployment"
version: "0.1.0"
namespace: string | *"default" @env(name="ARGOCD_APP_NAMESPACE",type="string")
container: "foundry-api-new-deployment"
version: "0.1.15"
values: {
environment: name: "dev"
server: image: {
tag: _ @forge(name="GIT_COMMIT_HASH")
app: {
environment: "dev"
image: {
tag: _ @forge(name="GIT_COMMIT_HASH")
}
presync: {
repoName: "catalyst-forge"
repoOwner: "input-output-hk"
commitHash: _ @forge(name="GIT_COMMIT_HASH")
checkInterval: 5
timeout: 300
}
}
}
}
}
release: {
docker: {
on: {
merge: {}
tag: {}
//merge: {}
//tag: {}
always: {}
}
config: {
tag: _ @forge(name="GIT_COMMIT_HASH")
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}
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