From 50fb9e42042010c5e36ec491aa8056db90ac63a3 Mon Sep 17 00:00:00 2001 From: Ulzii O Date: Thu, 2 May 2024 09:58:34 -0600 Subject: [PATCH] Use CI context for AWS auth --- .circleci/config.yml | 48 +++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 49dfc6a..e0591b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,28 +1,34 @@ -version: 2 +version: 2.1 jobs: build: docker: - - image: circleci/golang:1.15 + - image: circleci/golang:1.15 environment: CIRCLE_ARTIFACTS: /tmp/circleci-artifacts CIRCLE_TEST_REPORTS: /tmp/circleci-test-results steps: - - run: - command: cd $HOME && git clone --depth 1 -v https://github.com/Clever/ci-scripts.git && cd ci-scripts && git show --oneline -s - name: Clone ci-scripts - - checkout - - restore_cache: - keys: - - go-mod-v1-{{ checksum "go.sum" }} - - setup_remote_docker - - run: - command: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - name: Set up CircleCI artifacts directories - - run: make build - - run: make test - - run: $HOME/ci-scripts/circleci/docker-publish $DOCKER_USER $DOCKER_PASS "$DOCKER_EMAIL" $DOCKER_ORG - - run: if [ "${CIRCLE_BRANCH}" == "master" ]; then make VERSION && make deb && cp deb/sphinx.deb sphinx-amd64.deb && $HOME/ci-scripts/circleci/github-release $GH_RELEASE_TOKEN sphinx-amd64.deb; fi; - - save_cache: - key: go-mod-v1-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" + - run: + command: cd $HOME && git clone --depth 1 -v https://github.com/Clever/ci-scripts.git && cd ci-scripts && git show --oneline -s + name: Clone ci-scripts + - checkout + - restore_cache: + keys: + - go-mod-v1-{{ checksum "go.sum" }} + - setup_remote_docker + - run: + command: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS + name: Set up CircleCI artifacts directories + - run: make build + - run: make test + - run: $HOME/ci-scripts/circleci/docker-publish $DOCKER_USER $DOCKER_PASS "$DOCKER_EMAIL" $DOCKER_ORG + - run: if [ "${CIRCLE_BRANCH}" == "master" ]; then make VERSION && make deb && cp deb/sphinx.deb sphinx-amd64.deb && $HOME/ci-scripts/circleci/github-release $GH_RELEASE_TOKEN sphinx-amd64.deb; fi; + - save_cache: + key: go-mod-v1-{{ checksum "go.sum" }} + paths: + - /go/pkg/mod +workflows: + build_test_publish_deploy: + jobs: + - build: + context: + - aws-ecr-public