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

ci/cd work #14487

Draft
wants to merge 100 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
3e6241c
ci/cd work
josiahzimmerman-caci Dec 30, 2024
7cb4cdf
ci/cd work
josiahzimmerman-caci Dec 30, 2024
0681e3f
ci/cd work
josiahzimmerman-caci Dec 30, 2024
97ba893
Merge branch 'main' into B-22106-AddIntegrationTesting
josiahzimmerman-caci Dec 30, 2024
51e29bd
udpate ci/cd
josiahzimmerman-caci Jan 2, 2025
4fe30d1
Merge branch 'B-22106-AddIntegrationTesting' of https://github.com/tr…
josiahzimmerman-caci Jan 2, 2025
ebadabe
udpate ci/cd
josiahzimmerman-caci Jan 2, 2025
c06baf5
Merge branch 'main' into B-22106-AddIntegrationTesting
josiahzimmerman-caci Jan 2, 2025
6f6b9be
remove circle ci validate
josiahzimmerman-caci Jan 2, 2025
88108b0
add double quote
josiahzimmerman-caci Jan 2, 2025
738a21e
Merge branch 'main' into B-22106-AddIntegrationTesting
josiahzimmerman-caci Jan 2, 2025
0af3797
try to fix the ato-linter pretest
josiahzimmerman-caci Jan 2, 2025
bbdb574
try to fix the ato-linter pretest
josiahzimmerman-caci Jan 2, 2025
80ee488
turn off atolinter for now
josiahzimmerman-caci Jan 2, 2025
124bf41
run ato by itself
josiahzimmerman-caci Jan 3, 2025
8543057
add debug
josiahzimmerman-caci Jan 3, 2025
1c20b58
Merge branch 'main' into B-22106-AddIntegrationTesting
josiahzimmerman-caci Jan 3, 2025
f7c7112
add more server test
josiahzimmerman-caci Jan 3, 2025
8d120f7
Merge branch 'B-22106-AddIntegrationTesting' of https://github.com/tr…
josiahzimmerman-caci Jan 3, 2025
1a66d04
add more server test
josiahzimmerman-caci Jan 3, 2025
a5fa0a4
adjust pre-test
josiahzimmerman-caci Jan 3, 2025
cfa25fc
adjust server-test
josiahzimmerman-caci Jan 3, 2025
bc651bc
adjust client test
josiahzimmerman-caci Jan 6, 2025
d974cdf
Merge branch 'main' into B-22106-AddIntegrationTesting
josiahzimmerman-caci Jan 6, 2025
5ee19cd
adjust client test
josiahzimmerman-caci Jan 6, 2025
8380223
Merge branch 'B-22106-AddIntegrationTesting' of https://github.com/tr…
josiahzimmerman-caci Jan 6, 2025
64c0a7d
adjust client test
josiahzimmerman-caci Jan 6, 2025
e10a176
run precommit and fix email
josiahzimmerman-caci Jan 7, 2025
1f83782
cache work. wip go sum
josiahzimmerman-caci Jan 8, 2025
ab24b47
cache work. wip go sum
josiahzimmerman-caci Jan 8, 2025
b32fce2
mkdir -p
josiahzimmerman-caci Jan 8, 2025
5593f29
Merge branch 'main' into B-22106-AddIntegrationTesting
josiahzimmerman-caci Jan 8, 2025
6965d66
Merge branch 'main' into B-22106-AddIntegrationTesting
josiahzimmerman-caci Jan 9, 2025
92e31ff
add test ignore rules
josiahzimmerman-caci Jan 9, 2025
863d928
Merge branch 'B-22106-AddIntegrationTesting' of https://github.com/tr…
josiahzimmerman-caci Jan 9, 2025
b2479c4
add test ignore rules
josiahzimmerman-caci Jan 9, 2025
8df4df8
add test ignore rules
josiahzimmerman-caci Jan 9, 2025
770028c
add tags
josiahzimmerman-caci Jan 9, 2025
3e5952c
work server_test
josiahzimmerman-caci Jan 10, 2025
c1caeaa
work server_test
josiahzimmerman-caci Jan 10, 2025
3dfc8df
add cache
josiahzimmerman-caci Jan 10, 2025
d638efb
add cache
josiahzimmerman-caci Jan 10, 2025
4cc7ce7
work on deploy anchors
josiahzimmerman-caci Jan 13, 2025
54e62c3
work on deploy anchors
josiahzimmerman-caci Jan 14, 2025
afd5a15
add client test and deploy
josiahzimmerman-caci Jan 14, 2025
2d0fc26
missing env var for otel dp3
josiahzimmerman-caci Jan 14, 2025
9616512
adjust case for app env variable
josiahzimmerman-caci Jan 15, 2025
2053c36
use default region
josiahzimmerman-caci Jan 15, 2025
5cbbc11
forgot some pre checks on dp3
josiahzimmerman-caci Jan 15, 2025
926eca9
test our runner capacity/cache
josiahzimmerman-caci Jan 15, 2025
63f9a84
adjust needs on deploy tasks to wait for migration
josiahzimmerman-caci Jan 15, 2025
f641a27
change cache pull override
josiahzimmerman-caci Jan 16, 2025
79a383c
add more needs otel is needed for the app task. Set it at migration f…
josiahzimmerman-caci Jan 16, 2025
0934454
main merge into
josiahzimmerman-caci Jan 16, 2025
d4e863c
merge failed
josiahzimmerman-caci Jan 16, 2025
a9aaa39
policy removal
josiahzimmerman-caci Jan 16, 2025
68f5efb
test health check and dynamic env
josiahzimmerman-caci Jan 17, 2025
b317cfa
test grouping update checkdp3
josiahzimmerman-caci Jan 20, 2025
73aaf46
test grouping
josiahzimmerman-caci Jan 20, 2025
b8f7286
revert grouping
josiahzimmerman-caci Jan 21, 2025
0595f04
test our runner
josiahzimmerman-caci Jan 21, 2025
e0e5a15
test client test output to file
josiahzimmerman-caci Jan 21, 2025
56af1ef
test
josiahzimmerman-caci Jan 21, 2025
ef7a16e
test higher runner
josiahzimmerman-caci Jan 21, 2025
f28ecc1
test higher runner
josiahzimmerman-caci Jan 21, 2025
1f2e05b
test output to file
josiahzimmerman-caci Jan 21, 2025
9694573
Merge branch 'main' of https://github.com/transcom/mymove into B-2210…
josiahzimmerman-caci Jan 21, 2025
4401388
test client change
josiahzimmerman-caci Jan 22, 2025
564285b
test network timeout on yarn test
josiahzimmerman-caci Jan 22, 2025
8a93a84
fix pretest
josiahzimmerman-caci Jan 22, 2025
58c7c9c
test larger cpu
josiahzimmerman-caci Jan 22, 2025
a7fde43
test larger memory for client
josiahzimmerman-caci Jan 22, 2025
198ab32
test testing runner
josiahzimmerman-caci Jan 23, 2025
507d267
test testing runner
josiahzimmerman-caci Jan 23, 2025
1e6914f
test testing runner
josiahzimmerman-caci Jan 23, 2025
7c74f02
Merge branch 'main' of https://github.com/transcom/mymove into B-2210…
josiahzimmerman-caci Jan 23, 2025
67e1d8d
remove services
josiahzimmerman-caci Jan 23, 2025
5349169
remove services for real
josiahzimmerman-caci Jan 23, 2025
01cda10
testing psql updates from dedicated runner
josiahzimmerman-caci Jan 24, 2025
64c222d
testing psql updates from dedicated runner
josiahzimmerman-caci Jan 24, 2025
667f3d0
clean up server test
josiahzimmerman-caci Jan 24, 2025
3a5e8c6
add linux script
josiahzimmerman-caci Jan 25, 2025
ed4df12
Merge branch 'main' into B-22106-AddIntegrationTesting
josiahzimmerman-caci Jan 25, 2025
d131e2e
fix typo
josiahzimmerman-caci Jan 25, 2025
1db6e14
modify make
josiahzimmerman-caci Jan 25, 2025
0dc5996
modify make
josiahzimmerman-caci Jan 25, 2025
e05fc75
modify make
josiahzimmerman-caci Jan 27, 2025
96e04a1
modify make
josiahzimmerman-caci Jan 27, 2025
957c586
modify make
josiahzimmerman-caci Jan 27, 2025
6e1f0d2
modify make
josiahzimmerman-caci Jan 27, 2025
5d04ac9
modify make
josiahzimmerman-caci Jan 27, 2025
b49e617
modify make
josiahzimmerman-caci Jan 27, 2025
4170463
modify make
josiahzimmerman-caci Jan 27, 2025
2197bf6
turning on gitlab
JacintaCallahan Jan 27, 2025
f72d50e
modify make
josiahzimmerman-caci Jan 27, 2025
1b6c912
fix whitespace in make
josiahzimmerman-caci Jan 27, 2025
38ec456
turning on gitlab
JacintaCallahan Jan 27, 2025
0dcece4
fix whitespace in make
josiahzimmerman-caci Jan 27, 2025
52ff3a7
Merge branch 'main' into B-22274-turn-on-gitlab-all-deploys
josiahzimmerman-caci Jan 27, 2025
5b4d602
merge main
josiahzimmerman-caci Jan 27, 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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2653,7 +2653,7 @@ workflows:
- integration_tests_mtls
filters:
branches:
only: main
only: nolonger_main

- deploy_stg_migrations:
requires:
Expand Down
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ if [ ! -r .nix-disable ] && has nix-env; then

# add the NIX_PROFILE bin path so that everything we just installed
# is available on the path
PATH_add ${NIX_PROFILE}/bin
PATH_add "${NIX_PROFILE}"/bin
# Add the node binaries to our path
PATH_add ./node_modules/.bin
# nix is immutable, so we need to specify a path for local changes, e.g.
Expand Down
170 changes: 92 additions & 78 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ variables:
SERVER_IGNORE_BRANCH: &server_ignore_branch placeholder_branch_name

RUNNER_TAG: &runner_tag milmove

DOCKER_RUNNER_TAG: &docker_runner_tag eks_cluster_runner

postgres: &postgres postgres:16.4
#postgres: &postgres postgres:16.4
postgres: &postgres postgres:16
redis: &redis redis:5.0.6

stages:
Expand Down Expand Up @@ -128,18 +128,18 @@ stages:
.setup_release_stg: &setup_release_stg
#if main
- export ECR_REPOSITORY_URI=${STG_ACCOUNT_ID}.dkr.ecr.${STG_REGION}.amazonaws.com
- export APP_DOCKER_FILE=Dockerfile.dp3
- export TASK_DOCKER_FILE=Dockerfile.tasks_dp3
- export APP_DOCKER_FILE=Dockerfile
- export TASK_DOCKER_FILE=Dockerfile.tasks
#TODO: update demo to stg
- export APP_ENVIRONMENT=demo
- export APP_ENVIRONMENT=stg

.setup_release_prd: &setup_release_prd
#build off prd variables
- export ECR_REPOSITORY_URI=${PRD_ACCOUNT_ID}.dkr.ecr.${PRD_REGION}.amazonaws.com
- export APP_DOCKER_FILE=Dockerfile.dp3
- export TASK_DOCKER_FILE=Dockerfile.tasks_dp3
- export APP_DOCKER_FILE=Dockerfile
- export TASK_DOCKER_FILE=Dockerfile
#TODO: update exp to prod
- export APP_ENVIRONMENT=exp
- export APP_ENVIRONMENT=prd

.kaniko_before_setup: &kaniko_before_setup
# prep login for kaniko
Expand All @@ -148,7 +148,7 @@ stages:
echo "{\"credHelpers\":{\"${ECR_REPOSITORY_URI}\":\"ecr-login\"}}" > /kaniko/.docker/config.json

.check_dp3: &check_dp3
- if: $DP3_ENV == "exp" || $DP3_ENV == "loadtest" || $DP3_ENV == "demo"
- if: (($DP3_ENV == "exp" || $DP3_ENV == "loadtest" || $DP3_ENV == "demo") && $DP3_BRANCH == $CI_COMMIT_BRANCH)

.check_main: &check_main
- if: '$CI_COMMIT_BRANCH == "main"'
Expand All @@ -173,6 +173,7 @@ stages:
- |
mkdir -p /builds/milmove/mymove/.cache
mkdir -p /builds/milmove/mymove/.cache/yarn
yarn config set network-timeout 600000 -g
yarn install --frozen-lockfile --cache-folder /builds/milmove/mymove/.cache/yarn
scripts/check-generated-code yarn.lock
echo "yarn check dependencies"
Expand Down Expand Up @@ -217,29 +218,38 @@ stages:
.setup_server_env_variables: &setup_server_env_variables
- |
echo "make server_test_build for app"
export LOGIN_GOV_SECRET_KEY=$(echo $E2E_LOGIN_GOV_SECRET_KEY | base64 --decode)
export OKTA_CUST_CLIENT_ID=notrealkey
export OKTA_CUSTOMER_SECRET_KEY=notrealkey
export OKTA_OFFICE_SECRET_KEY=notrealkey1
export OKTA_ADMIN_SECRET_KEY=notrealkey2
export OKTA_TENANT_ORG_URL=test-milmove.okta.mil
export GOTEST_PARALLEL=8
export DB_PORT_TEST=5433
export MOVE_MIL_DOD_CA_CERT=$(cat config/tls/devlocal-ca.pem)
export MOVE_MIL_DOD_TLS_CERT=$(cat config/tls/devlocal-https.pem)
export MOVE_MIL_DOD_TLS_KEY=$(cat config/tls/devlocal-https.key)
export DB_NAME=test_db
export DB_NAME_TEST=test_db
export DTOD_USE_MOCK='true'
export ENV=test
export DB_NAME_DEV=test_db
export ENVIRONMENT=test
export SERVER_REPORT=1
export COVERAGE=1
export SERVE_API_INTERNAL='true'
export OKTA_CUSTOMER_CLIENT_ID=1q2w3e4r5t6y7u8i9o
export OKTA_ADMIN_CLIENT_ID=AQ1SW2DE3FR4G5
export OKTA_OFFICE_CLIENT_ID=9f9f9s8s90gig9
export OKTA_API_KEY=notrealapikey8675309
export OKTA_OFFICE_GROUP_ID=notrealgroupId
export OKTA_CUSTOMER_GROUP_ID=notrealcustomergroupId
export DOD_CA_PACKAGE=/builds/milmove/mymove/config/tls/milmove-cert-bundle.p7b
export GITLAB=1
# echo "make server_test_build for app"

# export LOGIN_GOV_SECRET_KEY=$(echo $E2E_LOGIN_GOV_SECRET_KEY | base64 --decode)
# export OKTA_CUST_CLIENT_ID=notrealkey
# export OKTA_CUSTOMER_SECRET_KEY=notrealkey
# export OKTA_OFFICE_SECRET_KEY=notrealkey1
# export OKTA_ADMIN_SECRET_KEY=notrealkey2
# export OKTA_TENANT_ORG_URL=test-milmove.okta.mil
# export GOTEST_PARALLEL=8
# export DB_PORT_TEST=5433
# export DB_NAME=test_db
# export DB_NAME_TEST=test_db
# export DTOD_USE_MOCK='true'
# export ENV=test
# export ENVIRONMENT=test
# export SERVER_REPORT=1
# export COVERAGE=1
# export SERVE_API_INTERNAL='true'
# export OKTA_CUSTOMER_CLIENT_ID=1q2w3e4r5t6y7u8i9o
# export OKTA_ADMIN_CLIENT_ID=AQ1SW2DE3FR4G5
# export OKTA_OFFICE_CLIENT_ID=9f9f9s8s90gig9
# export OKTA_API_KEY=notrealapikey8675309
# export OKTA_OFFICE_GROUP_ID=notrealgroupId
# export OKTA_CUSTOMER_GROUP_ID=notrealcustomergroupId

# .setup_host_intergration_tests: &setup_host_intergration_tests
# - echo "Setting up /etc/hosts for local domain simulation"
Expand Down Expand Up @@ -368,10 +378,6 @@ pre_deps_golang:
- *announce_failure
cache:
- <<: *go_cache
artifacts:
paths:
- /builds/milmove/mymove/bin/
- /builds/milmove/mymove/swagger/
#TODO: Optimization potential
# cache:
# key: "$CI_COMMIT_REF_SLUG-go"
Expand Down Expand Up @@ -618,6 +624,7 @@ pre_test:
[ -d ~/transcom/mymove/spectral ] && cp -r ~/transcom/mymove/spectral /tmp/spectral_baseline || echo "Skipping saving baseline"
- rm -rf ~/transcom/mymove/spectral
- *install_yarn
- ./scripts/pre-commit-go-mod || exit 0
- echo "Run pre-commit tests without golangci-lint, eslint, or prettier"
- SKIP=golangci-lint,eslint,prettier,ato-go-linter,gomod,appcontext-linter pre-commit run --all-files
- |
Expand All @@ -642,7 +649,7 @@ pre_test:
- yarn danger ci --failOnErrors
- echo "Run spectral linter on all files"
- ./scripts/ensure-spectral-lint /tmp/spectral_baseline spectral
- ./scripts/pre-commit-go-mod || exit 0

allow_failure: true
after_script:
- *announce_failure
Expand All @@ -658,7 +665,6 @@ server_test:
- pre_deps_golang
before_script:
- *setup_milmove_env
- *setup_generic_app_env_variables
- *setup_server_env_variables
services:
- name: docker:dind
Expand All @@ -669,6 +675,7 @@ server_test:
DOCKER_HOST: "tcp://docker-backend.gitlab-runner.svc.cluster.local:2375"
DOCKER_TLS_CERTDIR: ""
APPLICATION: app
GITLAB: 1
# 8 since this runs on xlarge with 8 CPUs
GOTEST_PARALLEL: 8
DB_PASSWORD: mysecretpassword
Expand Down Expand Up @@ -696,24 +703,26 @@ server_test:
OKTA_OFFICE_GROUP_ID: notrealgroupId
OKTA_CUSTOMER_GROUP_ID: notrealcustomergroupId
script:
- psql --version
- for i in $(seq 1 5); do go mod download && break || s=$? && sleep 5; done; (exit $s)
- scripts/check-generated-code go.sum
- make bin/swagger
- echo "server test -- TODO Add steps need to potentially pass job id to file and persist"
- echo $GITLAB
- make -j 2 bin/milmove bin/gotestsum
- make server_test for app
# - go install gotest.tools/gotestsum@latest
# - go mod tidy
#- bin/gotestsum --junitfile server_test_report.xml --format server_test
- make server_test
- go mod tidy
- bin/gotestsum --junitfile server_test_report.xml --format server_test
allow_failure: true
cache:
- <<: *go_cache
policy: pull
artifacts:
paths:
- /builds/milmove/mymove/bin/gotestsum
- /builds/milmove/mymove/tmp/test-results
- /builds/milmove/mymove/server_test_report.xml
when: always
reports:
junit: /builds/milmove/mymove/tmp/test-results/gotest/app/go-test-report.xml
junit:
- /builds/milmove/mymove/tmp/test-results/gotest/app/go-test-report.xml
- /builds/milmove/mymove/server_test_report.xml
after_script:
- *announce_failure
rules:
Expand Down Expand Up @@ -771,13 +780,14 @@ client_test:
- pre_deps_yarn
script:
- echo "client test coverage"
- JEST_JUNIT_OUTPUT_DIR=jest-junit-reports yarn test:coverage -results=false >> $CI_PROJECT_DIR/coverage.output
- JEST_JUNIT_OUTPUT_DIR=jest-junit-reports yarn test:coverage -results=false >> $CI_PROJECT_DIR/coverage.output
artifacts:
when: always
reports:
junit:
- jest-junit-reports/junit.xml
paths:
- /builds/milmove/mymove/coverage.output
- /builds/milmove/mymove/coverage
- /builds/milmove/mymove/jest-junit-reports
after_script:
Expand Down Expand Up @@ -861,20 +871,15 @@ integration_tests:
stage: test
tags:
- $RUNNER_TAG
image: $DOCKER_APP_IMAGE
needs:
- pre_deps_yarn
- pre_deps_golang
- compile_app_client
- compile_app_server
- integration_test_my
- integration_test_office
- integration_test_admin
- integration_test_devseed
before_script: *setup_milmove_env
- integration_test_mtls
script:
- echo "TODO Add steps"
- echo "integration_tests"
#no-op to lump integration tests into one status
- echo "integration_tests done"
allow_failure: true
after_script:
- *announce_failure
Expand Down Expand Up @@ -1192,17 +1197,20 @@ push_otel_collector_image_dp3:
- compile_app_server
- compile_app_client
script:
- echo "Logging in to Amazon ECR with Crane..."
- aws ecr get-login-password --region us-gov-west-1 | crane auth login ${ECR_REPOSITORY_URI} -u AWS --password-stdin
- echo "Logging in to DockerHub with Crane..."
- echo "${DOCKERHUB_PASSWORD}" | crane auth login docker.io -u "${DOCKERHUB_USERNAME}" --password-stdin

- echo "Pulling the AWS OTel Collector image from the public registry with Crane..."
- crane pull --insecure public.ecr.aws/aws-observability/aws-otel-collector:v0.31.0 image.tar
- echo "Pulling the AWS OTel Collector image from Dockerhub with Crane..."
- crane pull $ECR_REPOSITORY_OTEL:$OTEL_VERSION image.tar

- echo "Pushing the image to our private ECR using Crane..."
- crane push --insecure image.tar ${ECR_REPOSITORY_URI}/otel-collector:${CI_COMMIT_SHORT_SHA}
- echo "Logging in to AWS ECR with Crane..."
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | crane auth login ${ECR_REPOSITORY_URI} -u AWS --password-stdin

- echo "Cleaning up the temporary image file..."
- rm image.tar
- echo "Pushing the image to our private ECR using Crane..."
- crane push image.tar ${ECR_REPOSITORY_URI}/otel-collector:${CI_COMMIT_SHORT_SHA}

- echo "Cleaning up the temporary image file..."
- rm image.tar
allow_failure: false
after_script:
- *announce_failure
Expand Down Expand Up @@ -1447,17 +1455,20 @@ push_otel_collector_image_stg:
- *setup_aws_vars_stg
- *setup_release_stg
script:
- echo "Logging in to Amazon ECR with Crane..."
- aws ecr get-login-password --region us-gov-west-1 | crane auth login ${ECR_REPOSITORY_URI} -u AWS --password-stdin
- echo "Logging in to DockerHub with Crane..."
- echo "${DOCKERHUB_PASSWORD}" | crane auth login docker.io -u "${DOCKERHUB_USERNAME}" --password-stdin

- echo "Pulling the AWS OTel Collector image from Dockerhub with Crane..."
- crane pull $ECR_REPOSITORY_OTEL:$OTEL_VERSION image.tar

- echo "Pulling the AWS OTel Collector image from the public registry with Crane..."
- crane pull --insecure public.ecr.aws/aws-observability/aws-otel-collector:v0.31.0 image.tar
- echo "Logging in to AWS ECR with Crane..."
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | crane auth login ${ECR_REPOSITORY_URI} -u AWS --password-stdin

- echo "Pushing the image to our private ECR using Crane..."
- crane push --insecure image.tar ${ECR_REPOSITORY_URI}/otel-collector:${CI_COMMIT_SHORT_SHA}
- echo "Pushing the image to our private ECR using Crane..."
- crane push image.tar ${ECR_REPOSITORY_URI}/otel-collector:${CI_COMMIT_SHORT_SHA}

- echo "Cleaning up the temporary image file..."
- rm image.tar
- echo "Cleaning up the temporary image file..."
- rm image.tar
allow_failure: false
after_script:
- *announce_failure
Expand Down Expand Up @@ -1720,17 +1731,20 @@ push_otel_collector_image_prd:
- *setup_aws_vars_prd
- *setup_release_prd
script:
- echo "Logging in to Amazon ECR with Crane..."
- aws ecr get-login-password --region us-gov-west-1 | crane auth login ${ECR_REPOSITORY_URI} -u AWS --password-stdin
- echo "Logging in to DockerHub with Crane..."
- echo "${DOCKERHUB_PASSWORD}" | crane auth login docker.io -u "${DOCKERHUB_USERNAME}" --password-stdin

- echo "Pulling the AWS OTel Collector image from Dockerhub with Crane..."
- crane pull $ECR_REPOSITORY_OTEL:$OTEL_VERSION image.tar

- echo "Pulling the AWS OTel Collector image from the public registry with Crane..."
- crane pull --insecure public.ecr.aws/aws-observability/aws-otel-collector:v0.31.0 image.tar
- echo "Logging in to AWS ECR with Crane..."
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | crane auth login ${ECR_REPOSITORY_URI} -u AWS --password-stdin

- echo "Pushing the image to our private ECR using Crane..."
- crane push --insecure image.tar ${ECR_REPOSITORY_URI}/otel-collector:${CI_COMMIT_SHORT_SHA}
- echo "Pushing the image to our private ECR using Crane..."
- crane push image.tar ${ECR_REPOSITORY_URI}/otel-collector:${CI_COMMIT_SHORT_SHA}

- echo "Cleaning up the temporary image file..."
- rm image.tar
- echo "Cleaning up the temporary image file..."
- rm image.tar
allow_failure: false
after_script:
- *announce_failure
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ repos:
hooks:
- id: gen-docs
args: ['docs/adr']
- id: circleci-validate
- id: markdown-toc
- id: hadolint

Expand Down
Loading
Loading