FossilRepo
Remove promote workflow -- fossilhub is a separate application
Commit
1d729909aad4e477103633980327f858f57d58b1a61fb4413014d37f1dbe2903
Parent
6f6482c20ed028f…
1 file changed
-94
D
.github/workflows/promote.yaml
-94
| --- a/.github/workflows/promote.yaml | ||
| +++ b/.github/workflows/promote.yaml | ||
| @@ -1,94 +0,0 @@ | ||
| 1 | -name: Promote to Production | |
| 2 | - | |
| 3 | -on: | |
| 4 | - push: | |
| 5 | - tags: | |
| 6 | - - 'v*' | |
| 7 | - | |
| 8 | -env: | |
| 9 | - AWS_REGION: us-west-2 | |
| 10 | - ECR_REPO: fossilrepo | |
| 11 | - ECS_CLUSTER: prd-fossilhub | |
| 12 | - ECS_SERVICE: prd-fossilhub-app | |
| 13 | - TASK_FAMILY: prd-fossilhub-app | |
| 14 | - | |
| 15 | -jobs: | |
| 16 | - promote: | |
| 17 | - runs-on: ubuntu-latest | |
| 18 | - permissions: | |
| 19 | - id-token: write | |
| 20 | - contents: read | |
| 21 | - | |
| 22 | - steps: | |
| 23 | - - uses: aws-actions/configure-aws-credentials@v4 | |
| 24 | - with: | |
| 25 | - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| 26 | - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| 27 | - aws-region: ${{ env.AWS_REGION }} | |
| 28 | - | |
| 29 | - - uses: aws-actions/amazon-ecr-login@v2 | |
| 30 | - id: ecr | |
| 31 | - | |
| 32 | - - name: Tag image as stable + version | |
| 33 | - env: | |
| 34 | - ECR_REGISTRY: ${{ steps.ecr.outputs.registry }} | |
| 35 | - VERSION_TAG: ${{ github.ref_name }} | |
| 36 | - run: | | |
| 37 | - # Pull the latest image (what dev is running) | |
| 38 | - MANIFEST=$(aws ecr batch-get-image \ | |
| 39 | - --repository-name $ECR_REPO \ | |
| 40 | - --image-ids imageTag=latest \ | |
| 41 | - --query 'images[0].imageManifest' \ | |
| 42 | - --output text) | |
| 43 | - | |
| 44 | - # Tag it with the version | |
| 45 | - aws ecr put-image \ | |
| 46 | - --repository-name $ECR_REPO \ | |
| 47 | - --image-tag "$VERSION_TAG" \ | |
| 48 | - --image-manifest "$MANIFEST" || true | |
| 49 | - | |
| 50 | - # Tag it as stable | |
| 51 | - aws ecr put-image \ | |
| 52 | - --repository-name $ECR_REPO \ | |
| 53 | - --image-tag stable \ | |
| 54 | - --image-manifest "$MANIFEST" || true | |
| 55 | - | |
| 56 | - echo "Promoted latest → $VERSION_TAG + stable" | |
| 57 | - | |
| 58 | - - name: Deploy to production ECS | |
| 59 | - env: | |
| 60 | - ECR_REGISTRY: ${{ steps.ecr.outputs.registry }} | |
| 61 | - VERSION_TAG: ${{ github.ref_name }} | |
| 62 | - run: | | |
| 63 | - TASK_DEF=$(aws ecs describe-task-definition \ | |
| 64 | - --task-definition $TASK_FAMILY \ | |
| 65 | - --query 'taskDefinition' \ | |
| 66 | - --output json) | |
| 67 | - | |
| 68 | - NEW_TASK_DEF=$(echo "$TASK_DEF" | jq \ | |
| 69 | - --arg IMAGE "$ECR_REGISTRY/$ECR_REPO:$VERSION_TAG" \ | |
| 70 | - '.containerDefinitions[0].image = $IMAGE | | |
| 71 | - del(.taskDefinitionArn, .revision, .status, | |
| 72 | - .requiresAttributes, .compatibilities, | |
| 73 | - .registeredAt, .registeredBy, .deregisteredAt)') | |
| 74 | - | |
| 75 | - NEW_TASK_ARN=$(aws ecs register-task-definition \ | |
| 76 | - --cli-input-json "$NEW_TASK_DEF" \ | |
| 77 | - --query 'taskDefinition.taskDefinitionArn' \ | |
| 78 | - --output text) | |
| 79 | - | |
| 80 | - aws ecs update-service \ | |
| 81 | - --cluster $ECS_CLUSTER \ | |
| 82 | - --service $ECS_SERVICE \ | |
| 83 | - --task-definition "$NEW_TASK_ARN" \ | |
| 84 | - --force-new-deployment | |
| 85 | - | |
| 86 | - echo "Deployed $VERSION_TAG to production" | |
| 87 | - | |
| 88 | - - name: Wait for deployment to stabilize | |
| 89 | - run: | | |
| 90 | - echo "Waiting for production to reach steady state..." | |
| 91 | - aws ecs wait services-stable \ | |
| 92 | - --cluster $ECS_CLUSTER \ | |
| 93 | - --services $ECS_SERVICE | |
| 94 | - echo "Production deployment stable." |
| --- a/.github/workflows/promote.yaml | |
| +++ b/.github/workflows/promote.yaml | |
| @@ -1,94 +0,0 @@ | |
| 1 | name: Promote to Production |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | tags: |
| 6 | - 'v*' |
| 7 | |
| 8 | env: |
| 9 | AWS_REGION: us-west-2 |
| 10 | ECR_REPO: fossilrepo |
| 11 | ECS_CLUSTER: prd-fossilhub |
| 12 | ECS_SERVICE: prd-fossilhub-app |
| 13 | TASK_FAMILY: prd-fossilhub-app |
| 14 | |
| 15 | jobs: |
| 16 | promote: |
| 17 | runs-on: ubuntu-latest |
| 18 | permissions: |
| 19 | id-token: write |
| 20 | contents: read |
| 21 | |
| 22 | steps: |
| 23 | - uses: aws-actions/configure-aws-credentials@v4 |
| 24 | with: |
| 25 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 26 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 27 | aws-region: ${{ env.AWS_REGION }} |
| 28 | |
| 29 | - uses: aws-actions/amazon-ecr-login@v2 |
| 30 | id: ecr |
| 31 | |
| 32 | - name: Tag image as stable + version |
| 33 | env: |
| 34 | ECR_REGISTRY: ${{ steps.ecr.outputs.registry }} |
| 35 | VERSION_TAG: ${{ github.ref_name }} |
| 36 | run: | |
| 37 | # Pull the latest image (what dev is running) |
| 38 | MANIFEST=$(aws ecr batch-get-image \ |
| 39 | --repository-name $ECR_REPO \ |
| 40 | --image-ids imageTag=latest \ |
| 41 | --query 'images[0].imageManifest' \ |
| 42 | --output text) |
| 43 | |
| 44 | # Tag it with the version |
| 45 | aws ecr put-image \ |
| 46 | --repository-name $ECR_REPO \ |
| 47 | --image-tag "$VERSION_TAG" \ |
| 48 | --image-manifest "$MANIFEST" || true |
| 49 | |
| 50 | # Tag it as stable |
| 51 | aws ecr put-image \ |
| 52 | --repository-name $ECR_REPO \ |
| 53 | --image-tag stable \ |
| 54 | --image-manifest "$MANIFEST" || true |
| 55 | |
| 56 | echo "Promoted latest → $VERSION_TAG + stable" |
| 57 | |
| 58 | - name: Deploy to production ECS |
| 59 | env: |
| 60 | ECR_REGISTRY: ${{ steps.ecr.outputs.registry }} |
| 61 | VERSION_TAG: ${{ github.ref_name }} |
| 62 | run: | |
| 63 | TASK_DEF=$(aws ecs describe-task-definition \ |
| 64 | --task-definition $TASK_FAMILY \ |
| 65 | --query 'taskDefinition' \ |
| 66 | --output json) |
| 67 | |
| 68 | NEW_TASK_DEF=$(echo "$TASK_DEF" | jq \ |
| 69 | --arg IMAGE "$ECR_REGISTRY/$ECR_REPO:$VERSION_TAG" \ |
| 70 | '.containerDefinitions[0].image = $IMAGE | |
| 71 | del(.taskDefinitionArn, .revision, .status, |
| 72 | .requiresAttributes, .compatibilities, |
| 73 | .registeredAt, .registeredBy, .deregisteredAt)') |
| 74 | |
| 75 | NEW_TASK_ARN=$(aws ecs register-task-definition \ |
| 76 | --cli-input-json "$NEW_TASK_DEF" \ |
| 77 | --query 'taskDefinition.taskDefinitionArn' \ |
| 78 | --output text) |
| 79 | |
| 80 | aws ecs update-service \ |
| 81 | --cluster $ECS_CLUSTER \ |
| 82 | --service $ECS_SERVICE \ |
| 83 | --task-definition "$NEW_TASK_ARN" \ |
| 84 | --force-new-deployment |
| 85 | |
| 86 | echo "Deployed $VERSION_TAG to production" |
| 87 | |
| 88 | - name: Wait for deployment to stabilize |
| 89 | run: | |
| 90 | echo "Waiting for production to reach steady state..." |
| 91 | aws ecs wait services-stable \ |
| 92 | --cluster $ECS_CLUSTER \ |
| 93 | --services $ECS_SERVICE |
| 94 | echo "Production deployment stable." |
| --- a/.github/workflows/promote.yaml | |
| +++ b/.github/workflows/promote.yaml | |
| @@ -1,94 +0,0 @@ | |