Skip to content

Commit

Permalink
Merge pull request #3 from spring-financial-group/cronjobs
Browse files Browse the repository at this point in the history
Push latest tag on release
  • Loading branch information
Skisocks authored Aug 12, 2022
2 parents e84fefb + de51397 commit 8521c21
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 8 deletions.
25 changes: 21 additions & 4 deletions .lighthouse/jenkins-x/pullrequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,31 @@ spec:
name: build-containers
resources: { }
script: |
chmod +x build_containers.sh
./build_containers.sh
#!/busybox/sh
set -e
source .jx/variables.sh
cp /tekton/creds-secrets/tekton-container-registry-auth/.dockerconfigjson /kaniko/.docker/config.json
for image in $(find . -maxdepth 1 -type d | sed 's|^./||' | grep -F -v .); do
echo -e "\n------------------ BUILDING CONTAINER $image ------------------\n"
/kaniko/executor $KANIKO_FLAGS --cleanup --context=/workspace/source/$image --dockerfile="Dockerfile" --destination=$PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:$VERSION --no-push --tarPath "$image".tar
done
- image: ghcr.io/spring-financial-group/container-tools:latest
name: push-containers
resources: { }
script: |
chmod +x push_containers.sh
./push_containers.sh
#!/bin/bash
set -e
source .jx/variables.sh
cp /tekton/creds-secrets/tekton-container-registry-auth/.dockerconfigjson ~/.docker/config.json
for image in $(find . -maxdepth 1 -type d | sed 's|^./||' | grep -F -v .); do
echo -e "\n------------------ PUSHING CONTAINER $image ------------------\n"
# Push preview image
crane push /workspace/source/"$image".tar $PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:$VERSION
cosign sign --key k8s://jx-staging/cosign $PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:$VERSION
cosign verify --key k8s://jx-staging/cosign $PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:$VERSION
done
podTemplate: {}
serviceAccountName: tekton-bot
timeout: 12h0m0s
Expand Down
30 changes: 26 additions & 4 deletions .lighthouse/jenkins-x/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,36 @@ spec:
name: build-containers
resources: { }
script: |
chmod +x build_containers.sh
./build_containers.sh
#!/busybox/sh
set -e
source .jx/variables.sh
cp /tekton/creds-secrets/tekton-container-registry-auth/.dockerconfigjson /kaniko/.docker/config.json
for image in $(find . -maxdepth 1 -type d | sed 's|^./||' | grep -F -v .); do
echo -e "\n------------------ BUILDING CONTAINER $image ------------------\n"
/kaniko/executor $KANIKO_FLAGS --cleanup --context=/workspace/source/$image --dockerfile="Dockerfile" --destination=$PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:$VERSION --no-push --tarPath "$image".tar
done
- image: ghcr.io/spring-financial-group/container-tools:latest
name: push-containers
resources: { }
script: |
chmod +x push_containers.sh
./push_containers.sh
#!/bin/bash
set -e
source .jx/variables.sh
cp /tekton/creds-secrets/tekton-container-registry-auth/.dockerconfigjson ~/.docker/config.json
for image in $(find . -maxdepth 1 -type d | sed 's|^./||' | grep -F -v .); do
echo -e "\n------------------ PUSHING CONTAINER $image ------------------\n"
# Update latest image
crane push /workspace/source/"$image".tar $PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:latest
cosign sign --key k8s://jx-staging/cosign $PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:latest
cosign verify --key k8s://jx-staging/cosign $PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:latest
# Push versioned image
crane push /workspace/source/"$image".tar $PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:$VERSION
cosign sign --key k8s://jx-staging/cosign $PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:$VERSION
cosign verify --key k8s://jx-staging/cosign $PUSH_CONTAINER_REGISTRY/$DOCKER_REGISTRY_ORG/$image:$VERSION
done
- name: promote-changelog
resources: {}
podTemplate: {}
Expand Down

0 comments on commit 8521c21

Please sign in to comment.