From 817ccc9ed473a2088a38f8e3ea176b33d2e54e59 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:09:13 +0430 Subject: [PATCH 01/71] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6845aa00..7616728a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: # Variable expansion in working_directory not supported at this time # You will need to modify the code below to reflect your github account/repo setup - working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 + working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: - image: circleci/golang:1.10 steps: From fd2f914fe4ba9489897ffcf1e911583716900642 Mon Sep 17 00:00:00 2001 From: "keramat.alijani" Date: Thu, 18 Aug 2022 12:09:10 -0700 Subject: [PATCH 02/71] Add first draft of some feature --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 098c60ad..b1e45c4a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +Hi Securing DevOps's invoicer ========================== From 93f1f211428ee5e112fd3bcbe5eb393a2f431467 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 12:40:21 -0700 Subject: [PATCH 03/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7616728a..4382fe65 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: build: - # Variable expansion in working_directory not supported at this time + # Variable expansion in working_directory not supported at this time1 # You will need to modify the code below to reflect your github account/repo setup working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: From fb92af75fe8f069258e2c9d77c66bb769467def7 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 12:56:27 -0700 Subject: [PATCH 04/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4382fe65..3695d128 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ jobs: - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}; + docker login -u ${siyavashshams} -p ${lasTampa34?m}; go install --ldflags '-extldflags "-static"' \ github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; mkdir bin; From 9887a47ff7c29e654b05ea172fd65ab44e3215bf Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:01:22 -0700 Subject: [PATCH 05/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3695d128..ff028c99 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: build: - # Variable expansion in working_directory not supported at this time1 + # Variable expansion in working_directory not supported at this time12 # You will need to modify the code below to reflect your github account/repo setup working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: From 4b3223bac7f480cd4255bcca8489319b4ce2d124 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:02:25 -0700 Subject: [PATCH 06/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff028c99..4ec105f8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ jobs: - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u ${siyavashshams} -p ${lasTampa34?m}; + docker login -u ${"siyavashshams"} -p ${"lasTampa34?m"}; go install --ldflags '-extldflags "-static"' \ github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; mkdir bin; From dfbc72d4536b1c5521f5e10619a2705a9bf26045 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:05:16 -0700 Subject: [PATCH 07/71] Updated config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4ec105f8..e8281310 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,8 +14,8 @@ jobs: name: Setup environment command: | gb="/src/github.com/${CIRCLE_PROJECT_USERNAME}"; - if [ ${CIRCLE_PROJECT_USERNAME} == 'Securing-DevOps' ]; then - dr="securingdevops" + if [ ${CIRCLE_PROJECT_USERNAME} == 'siyavashshams' ]; then + dr="siyavashshams" else dr=$DOCKER_USER fi From dc8442256f0e7e0ddc4a06c1e7a0b976c1c1b10e Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:06:23 -0700 Subject: [PATCH 08/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e8281310..cf775920 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ jobs: - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u ${"siyavashshams"} -p ${"lasTampa34?m"}; + docker login -u ${siyavashshams} -p ${lasTampa34?m}; go install --ldflags '-extldflags "-static"' \ github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; mkdir bin; From 110c1179cbe7d5c0350d4944ab9426ee3d907ebe Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:17:09 -0700 Subject: [PATCH 09/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cf775920..161d9ef0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: # You will need to modify the code below to reflect your github account/repo setup working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: - - image: circleci/golang:1.10 + - image: jruby:9.3 steps: - checkout - setup_remote_docker From 3ffa545f5dadfae3676000b659c95af39fac2ef9 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:20:12 -0700 Subject: [PATCH 10/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 161d9ef0..ed0300ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: # You will need to modify the code below to reflect your github account/repo setup working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: - - image: jruby:9.3 + - image: cimg/golang:1.10 steps: - checkout - setup_remote_docker From 164d38ef2e3d2d3deeabb607590c0982a42d0457 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:23:26 -0700 Subject: [PATCH 11/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed0300ae..4131d3af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: # You will need to modify the code below to reflect your github account/repo setup working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: - - image: cimg/golang:1.10 + - image: cimg/go:1.10 steps: - checkout - setup_remote_docker From 1ebc225333b908742f41a5ad92f248fc57acf529 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:25:40 -0700 Subject: [PATCH 12/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4131d3af..bc515daf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: # You will need to modify the code below to reflect your github account/repo setup working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: - - image: cimg/go:1.10 + - image: cimg/go steps: - checkout - setup_remote_docker From d91dec4ad83cdd072f3bf815816c3cdf0db2c50a Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:30:57 -0700 Subject: [PATCH 13/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc515daf..50bc7c0b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: # You will need to modify the code below to reflect your github account/repo setup working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: - - image: cimg/go + - image: cimg/go:1.19.0 steps: - checkout - setup_remote_docker From d5e57e8eb5acc3cbaab7b2d31ae71f7a74e31602 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:31:50 -0700 Subject: [PATCH 14/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 50bc7c0b..53d56391 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: # Variable expansion in working_directory not supported at this time12 # You will need to modify the code below to reflect your github account/repo setup - working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 + docker: - image: cimg/go:1.19.0 steps: From ab895fc303ea357b6572a7960e6c1be942ee4894 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:35:59 -0700 Subject: [PATCH 15/71] Updated config.yml --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53d56391..3fd0d953 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,9 @@ jobs: docker: - image: cimg/go:1.19.0 + auth: + username: siyavashshams + password: lasTampa34?m steps: - checkout - setup_remote_docker From 27c81204b59555207f3bbc0abdfa4cba1d097cdb Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:40:59 -0700 Subject: [PATCH 16/71] Updated config.yml --- .circleci/config.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3fd0d953..f579a7db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,24 +1,21 @@ version: 2 jobs: build: - # Variable expansion in working_directory not supported at this time12 + # Variable expansion in working_directory not supported at this time # You will need to modify the code below to reflect your github account/repo setup - + working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 docker: - image: cimg/go:1.19.0 - auth: - username: siyavashshams - password: lasTampa34?m steps: - checkout - - setup_remote_docker + - run: go version - run: name: Setup environment command: | gb="/src/github.com/${CIRCLE_PROJECT_USERNAME}"; - if [ ${CIRCLE_PROJECT_USERNAME} == 'siyavashshams' ]; then - dr="siyavashshams" + if [ ${CIRCLE_PROJECT_USERNAME} == 'Securing-DevOps' ]; then + dr="securingdevops" else dr=$DOCKER_USER fi @@ -39,7 +36,7 @@ jobs: - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u ${siyavashshams} -p ${lasTampa34?m}; + docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}; go install --ldflags '-extldflags "-static"' \ github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; mkdir bin; @@ -48,4 +45,4 @@ jobs: docker images --no-trunc | awk '/^app/ {print $3}' | \ sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; - fi + fi \ No newline at end of file From dcf0ffac2d66f5b82b675177a63a1d56879ac598 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:46:46 -0700 Subject: [PATCH 17/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f579a7db..697cf209 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ jobs: - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}; + docker login -u "siyavashshams" -p "lasTampa34?m"; go install --ldflags '-extldflags "-static"' \ github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; mkdir bin; From ae60e5eeb73a8bbb354f73d2a68e19503f90baa1 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:51:09 -0700 Subject: [PATCH 18/71] Updated config.yml --- .circleci/config.yml | 55 ++++++-------------------------------------- 1 file changed, 7 insertions(+), 48 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 697cf209..26036789 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,48 +1,7 @@ -version: 2 -jobs: - build: - # Variable expansion in working_directory not supported at this time - # You will need to modify the code below to reflect your github account/repo setup - working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 - docker: - - image: cimg/go:1.19.0 - steps: - - checkout - - run: go version - - - run: - name: Setup environment - command: | - gb="/src/github.com/${CIRCLE_PROJECT_USERNAME}"; - if [ ${CIRCLE_PROJECT_USERNAME} == 'Securing-DevOps' ]; then - dr="securingdevops" - else - dr=$DOCKER_USER - fi - cat >> $BASH_ENV << EOF - export GOPATH_HEAD="$(echo ${GOPATH}|cut -d ':' -f 1)" - export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" - export DOCKER_REPO="$dr" - EOF - - run: mkdir -p "${GOPATH_BASE}" - - run: mkdir -p "${GOPATH_HEAD}/bin" - - - run: - name: Testing application - command: | - go test \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - - - deploy: - command: | - if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u "siyavashshams" -p "lasTampa34?m"; - go install --ldflags '-extldflags "-static"' \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; - mkdir bin; - cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; - docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; - docker images --no-trunc | awk '/^app/ {print $3}' | \ - sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; - docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; - fi \ No newline at end of file +version: 2.1 +orbs: + hello: circleci/hello-build@0.0.5 +workflows: + "Hello Workflow": + jobs: + - hello/hello-build \ No newline at end of file From b3715b3ea0f0d8ffa4748ecf8409d59d34768cbb Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:54:18 -0700 Subject: [PATCH 19/71] Updated config.yml --- .circleci/config.yml | 56 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 26036789..0bab8170 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,49 @@ -version: 2.1 -orbs: - hello: circleci/hello-build@0.0.5 -workflows: - "Hello Workflow": - jobs: - - hello/hello-build \ No newline at end of file +version: 2 +jobs: + build: + # Variable expansion in working_directory not supported at this time + # You will need to modify the code below to reflect your github account/repo setup + working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 + docker: + - image: cimg/go:1.19.0 + steps: + - checkout + - run: go version + + - run: + name: Setup environment + command: | + gb="/src/github.com/${CIRCLE_PROJECT_USERNAME}"; + if [ ${CIRCLE_PROJECT_USERNAME} == 'Securing-DevOps' ]; then + dr="securingdevops" + else + dr=$DOCKER_USER + fi + cat >> $BASH_ENV << EOF + export GOPATH_HEAD="$(echo ${GOPATH}|cut -d ':' -f 1)" + export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" + export DOCKER_REPO="$dr" + EOF + - run: mkdir -p "/go/" + - run: mkdir -p "${GOPATH_BASE}" + - run: mkdir -p "${GOPATH_HEAD}/bin" + + - run: + name: Testing application + command: | + go test \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} + + - deploy: + command: | + if [ "${CIRCLE_BRANCH}" == "master" ]; then + docker login -u "siyavashshams" -p "lasTampa34?m"; + go install --ldflags '-extldflags "-static"' \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; + mkdir bin; + cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; + docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; + docker images --no-trunc | awk '/^app/ {print $3}' | \ + sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; + docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; + fi \ No newline at end of file From 88298616fdc02f5ac7b5ccc97e0abf356103264d Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:58:37 -0700 Subject: [PATCH 20/71] Updated config.yml --- .circleci/config.yml | 76 +++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 47 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0bab8170..83c5209f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,49 +1,31 @@ -version: 2 -jobs: - build: - # Variable expansion in working_directory not supported at this time - # You will need to modify the code below to reflect your github account/repo setup - working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 - docker: - - image: cimg/go:1.19.0 - steps: - - checkout - - run: go version +version: 2.1 - - run: - name: Setup environment - command: | - gb="/src/github.com/${CIRCLE_PROJECT_USERNAME}"; - if [ ${CIRCLE_PROJECT_USERNAME} == 'Securing-DevOps' ]; then - dr="securingdevops" - else - dr=$DOCKER_USER - fi - cat >> $BASH_ENV << EOF - export GOPATH_HEAD="$(echo ${GOPATH}|cut -d ':' -f 1)" - export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" - export DOCKER_REPO="$dr" - EOF - - run: mkdir -p "/go/" - - run: mkdir -p "${GOPATH_BASE}" - - run: mkdir -p "${GOPATH_HEAD}/bin" - - - run: - name: Testing application - command: | - go test \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} +# Define the jobs we want to run for this project +jobs: + build: + docker: + - image: cimg/: + auth: + username: mydockerhub-user + password: $DOCKERHUB_PASSWORD # context / project UI env-var reference + steps: + - checkout + - run: echo "this is the build job" + test: + docker: + - image: cimg/: + auth: + username: mydockerhub-user + password: $DOCKERHUB_PASSWORD # context / project UI env-var reference + steps: + - checkout + - run: echo "this is the test job" - - deploy: - command: | - if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u "siyavashshams" -p "lasTampa34?m"; - go install --ldflags '-extldflags "-static"' \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; - mkdir bin; - cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; - docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; - docker images --no-trunc | awk '/^app/ {print $3}' | \ - sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; - docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; - fi \ No newline at end of file +# Orchestrate our job run sequence +workflows: + build_and_test: + jobs: + - build + - test: + requires: + - build From 1ef796902f3764551f68a4375925eb3f91ee6889 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:59:50 -0700 Subject: [PATCH 21/71] Updated config.yml --- .circleci/config.yml | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83c5209f..6c5aa216 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,31 +1,40 @@ version: 2.1 -# Define the jobs we want to run for this project -jobs: - build: +executors: + xenial: + parameters: + some-value: + type: string + default: foo + environment: + SOME_VAR: << parameters.some-value >> docker: - - image: cimg/: + - image: ubuntu:xenial auth: username: mydockerhub-user password: $DOCKERHUB_PASSWORD # context / project UI env-var reference - steps: - - checkout - - run: echo "this is the build job" - test: + bionic: docker: - - image: cimg/: + - image: ubuntu:bionic auth: username: mydockerhub-user password: $DOCKERHUB_PASSWORD # context / project UI env-var reference + +jobs: + test: + parameters: + e: + type: executor + executor: << parameters.e >> steps: - - checkout - - run: echo "this is the test job" + - run: some-tests -# Orchestrate our job run sequence workflows: - build_and_test: + workflow: jobs: - - build - test: - requires: - - build + e: bionic + - test: + e: + name: xenial + some-value: foobar From a68d52a548727a7f5d5199184a1bfcac9bb61f47 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 21:32:55 -0700 Subject: [PATCH 22/71] Updated config.yml --- .circleci/config.yml | 44 ++++++++++---------------------------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c5aa216..a1f9f393 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,40 +1,16 @@ version: 2.1 - -executors: - xenial: - parameters: - some-value: - type: string - default: foo - environment: - SOME_VAR: << parameters.some-value >> - docker: - - image: ubuntu:xenial - auth: - username: mydockerhub-user - password: $DOCKERHUB_PASSWORD # context / project UI env-var reference - bionic: - docker: - - image: ubuntu:bionic - auth: - username: mydockerhub-user - password: $DOCKERHUB_PASSWORD # context / project UI env-var reference - jobs: - test: - parameters: - e: - type: executor - executor: << parameters.e >> + build: + docker: + - image: cimg/python:3.8 steps: - - run: some-tests + - run: + name: "Build my app" + command: | + pip install docker-compose + docker-compose run app sh -c "python manage.py test && flake8" workflows: - workflow: + build: jobs: - - test: - e: bionic - - test: - e: - name: xenial - some-value: foobar + - build \ No newline at end of file From 980f77e71305f24727dc74829c7944b5c1231d9d Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 21:34:06 -0700 Subject: [PATCH 23/71] Updated config.yml --- .circleci/config.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a1f9f393..26036789 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,16 +1,7 @@ version: 2.1 -jobs: - build: - docker: - - image: cimg/python:3.8 - steps: - - run: - name: "Build my app" - command: | - pip install docker-compose - docker-compose run app sh -c "python manage.py test && flake8" - +orbs: + hello: circleci/hello-build@0.0.5 workflows: - build: - jobs: - - build \ No newline at end of file + "Hello Workflow": + jobs: + - hello/hello-build \ No newline at end of file From 79a35009a89af90c759d4c1b68f9e582f984aa4e Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 21:52:35 -0700 Subject: [PATCH 24/71] Updated config.yml --- .circleci/config.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 26036789..7688ae00 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,11 @@ version: 2.1 -orbs: - hello: circleci/hello-build@0.0.5 -workflows: - "Hello Workflow": - jobs: - - hello/hello-build \ No newline at end of file +jobs: + build: + docker: + - image: alpine:3.15 + steps: + - run: + name: The First Step + command: | + echo 'Hello World!' + echo 'This is the delivery pipeline' \ No newline at end of file From 57d410bd113ead28bc229832adaa95d9c3a3ceab Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 21:54:01 -0700 Subject: [PATCH 25/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7688ae00..04e80d82 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,5 +7,5 @@ jobs: - run: name: The First Step command: | - echo 'Hello World!' + echo 'Hello Worldddddddddddd!' echo 'This is the delivery pipeline' \ No newline at end of file From 43289902a2608599e703ce9c532306e0788a3200 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:05:53 -0700 Subject: [PATCH 26/71] Updated config.yml --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 04e80d82..dc80bc5c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,10 @@ version: 2.1 jobs: build: docker: - - image: alpine:3.15 + - image: cimg/go:1.19.0 + auth: + username: "siyavashshams" # can specify string literal values + password: "lasTampa34?m" # or project environment variable steps: - run: name: The First Step From 7173648b6428240db72f30a5e63a5ea041051474 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:07:44 -0700 Subject: [PATCH 27/71] Updated config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc80bc5c..94d920ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,7 @@ version: 2.1 jobs: build: + working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: - image: cimg/go:1.19.0 auth: From 8aee533b2c3136b43960b1a674fb4a81c927195e Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:09:50 -0700 Subject: [PATCH 28/71] Updated config.yml --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94d920ec..82519502 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,8 @@ jobs: username: "siyavashshams" # can specify string literal values password: "lasTampa34?m" # or project environment variable steps: + - checkout + - setup_remote_docker - run: name: The First Step command: | From 4d856ff4dc5d576cdf34178f7e2e5cc87ff508f1 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:18:28 -0700 Subject: [PATCH 29/71] Updated config.yml --- .circleci/config.yml | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 82519502..2dfdbb30 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,17 +1,27 @@ -version: 2.1 +version: 2 jobs: - build: - working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 - docker: - - image: cimg/go:1.19.0 - auth: - username: "siyavashshams" # can specify string literal values - password: "lasTampa34?m" # or project environment variable - steps: - - checkout - - setup_remote_docker - - run: - name: The First Step - command: | - echo 'Hello Worldddddddddddd!' - echo 'This is the delivery pipeline' \ No newline at end of file + build: + working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 + docker: + - image: cimg/go:1.19.0 + auth: + username: "siyavashshams" + password: "lasTampa34?m" + steps: + - checkout + - setup_remote_docker + + - run: + name: Setup environment + command: | + gb="/src/github.com/${CIRCLE_PROJECT_USERNAME}"; + if [ ${CIRCLE_PROJECT_USERNAME} == 'Securing-DevOps' ]; then + dr="securingdevops" + else + dr=$DOCKER_USER + fi + cat >> $BASH_ENV << EOF + export GOPATH_HEAD="$(echo ${GOPATH}|cut -d ':' -f 1)" + export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" + export DOCKER_REPO="$dr" + EOF \ No newline at end of file From 48529b2efe9412af1102e1a1e66a054019eea568 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:20:15 -0700 Subject: [PATCH 30/71] Updated config.yml --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2dfdbb30..2afd5ccf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,4 +24,6 @@ jobs: export GOPATH_HEAD="$(echo ${GOPATH}|cut -d ':' -f 1)" export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" export DOCKER_REPO="$dr" - EOF \ No newline at end of file + EOF + - run: mkdir -p "${GOPATH_BASE}" + - run: mkdir -p "${GOPATH_HEAD}/bin" \ No newline at end of file From 774400f6abbc813efe5fd4853d18a576d88b5ae1 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:21:18 -0700 Subject: [PATCH 31/71] Updated config.yml --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2afd5ccf..ba8a8c37 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,4 +26,9 @@ jobs: export DOCKER_REPO="$dr" EOF - run: mkdir -p "${GOPATH_BASE}" - - run: mkdir -p "${GOPATH_HEAD}/bin" \ No newline at end of file + - run: mkdir -p "${GOPATH_HEAD}/bin" + - run: + name: Testing application + command: | + go test \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} \ No newline at end of file From 492c85439e320331100c8933cc24aadab462d411 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:22:38 -0700 Subject: [PATCH 32/71] Updated config.yml --- .circleci/config.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ba8a8c37..816de6cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,4 +31,17 @@ jobs: name: Testing application command: | go test \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} \ No newline at end of file + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} + - deploy: + command: | + if [ "${CIRCLE_BRANCH}" == "master" ]; then + docker login -u ${username} -p ${password}; + go install --ldflags '-extldflags "-static"' \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; + mkdir bin; + cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; + docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; + docker images --no-trunc | awk '/^app/ {print $3}' | \ + sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; + docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; + fi \ No newline at end of file From c64a13cf53770763bba56e4e08dc2fc846ea9da4 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:25:48 -0700 Subject: [PATCH 33/71] Updated config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 816de6cb..b0a5554b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,7 @@ version: 2 jobs: build: + # 123 working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 docker: - image: cimg/go:1.19.0 From 448cde9f20cd2fdb49819c905077d15a843fcada Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:27:06 -0700 Subject: [PATCH 34/71] Updated config.yml --- .circleci/config.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b0a5554b..13b8a6f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,16 +33,3 @@ jobs: command: | go test \ github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - - deploy: - command: | - if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u ${username} -p ${password}; - go install --ldflags '-extldflags "-static"' \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; - mkdir bin; - cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; - docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; - docker images --no-trunc | awk '/^app/ {print $3}' | \ - sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; - docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; - fi \ No newline at end of file From 3fbaa48180ff0c67d487fcaa3a0e01fe7a9655ab Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:28:02 -0700 Subject: [PATCH 35/71] Updated config.yml --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 13b8a6f6..ed1c7fc5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,6 @@ version: 2 jobs: build: - # 123 working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 docker: - image: cimg/go:1.19.0 From 100afc219ff9ef6830339adc9ed3436f99db6307 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:29:23 -0700 Subject: [PATCH 36/71] Updated config.yml --- .circleci/config.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed1c7fc5..585482bb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,10 +25,3 @@ jobs: export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" export DOCKER_REPO="$dr" EOF - - run: mkdir -p "${GOPATH_BASE}" - - run: mkdir -p "${GOPATH_HEAD}/bin" - - run: - name: Testing application - command: | - go test \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} From b673c0b9d7458871c5f0033aaf84bf4394f043b5 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:29:59 -0700 Subject: [PATCH 37/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 585482bb..cf12a119 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: build: - working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 + working_directory: /go/src/github.com/siyavashshams/invoicer-chapter2 docker: - image: cimg/go:1.19.0 auth: From 884555964b19cb288c805a70a58133ca3751ec77 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:32:01 -0700 Subject: [PATCH 38/71] Updated config.yml --- .circleci/config.yml | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cf12a119..65b5ad44 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,27 +1,7 @@ -version: 2 +# CircleCI configuration file +version: 2.1 jobs: - build: - working_directory: /go/src/github.com/siyavashshams/invoicer-chapter2 - docker: - - image: cimg/go:1.19.0 - auth: - username: "siyavashshams" - password: "lasTampa34?m" - steps: - - checkout - - setup_remote_docker - - - run: - name: Setup environment - command: | - gb="/src/github.com/${CIRCLE_PROJECT_USERNAME}"; - if [ ${CIRCLE_PROJECT_USERNAME} == 'Securing-DevOps' ]; then - dr="securingdevops" - else - dr=$DOCKER_USER - fi - cat >> $BASH_ENV << EOF - export GOPATH_HEAD="$(echo ${GOPATH}|cut -d ':' -f 1)" - export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" - export DOCKER_REPO="$dr" - EOF + build: + docker: + # Primary container image where all steps run + - image: cimg/base:2022.05 \ No newline at end of file From b6cb2f5fe7a04c6ccc84ae49f56c4ca39486afa3 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:33:07 -0700 Subject: [PATCH 39/71] Updated config.yml --- .circleci/config.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 65b5ad44..7688ae00 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,11 @@ -# CircleCI configuration file version: 2.1 jobs: build: docker: - # Primary container image where all steps run - - image: cimg/base:2022.05 \ No newline at end of file + - image: alpine:3.15 + steps: + - run: + name: The First Step + command: | + echo 'Hello World!' + echo 'This is the delivery pipeline' \ No newline at end of file From 8e1849bd03f78ea0c376d85c381412014f8d40f9 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:40:58 -0700 Subject: [PATCH 40/71] Updated config.yml --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7688ae00..ed0b1ac7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,9 @@ -version: 2.1 +version: 2 jobs: build: + working_directory: /go/src/github.com/siyavashshams/invoicer-chapter2 docker: - - image: alpine:3.15 + - image: cimg/go:1.19.0 steps: - run: name: The First Step From d51a10865a3b5a44848b9de8051e624c611c6f08 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:43:15 -0700 Subject: [PATCH 41/71] Updated config.yml --- .circleci/config.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed0b1ac7..81bcd505 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,12 +1,13 @@ version: 2 jobs: - build: - working_directory: /go/src/github.com/siyavashshams/invoicer-chapter2 - docker: - - image: cimg/go:1.19.0 - steps: - - run: - name: The First Step - command: | - echo 'Hello World!' - echo 'This is the delivery pipeline' \ No newline at end of file + build: + # 123 + working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 + docker: + - image: cimg/go:1.19.0 + auth: + username: "siyavashshams" + password: "lasTampa34?m" + steps: + - checkout + - setup_remote_docker \ No newline at end of file From 2ef2133d4ce52cccf32e3d2da4b0827f9bbfda34 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:45:27 -0700 Subject: [PATCH 42/71] Updated config.yml --- .circleci/config.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 81bcd505..7d0ca31a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,4 +10,20 @@ jobs: password: "lasTampa34?m" steps: - checkout - - setup_remote_docker \ No newline at end of file + - setup_remote_docker + - run: + name: Setup environment + command: | + gb="/src/github.com/${CIRCLE_PROJECT_USERNAME}"; + if [ ${CIRCLE_PROJECT_USERNAME} == 'Securing-DevOps' ]; then + dr="securingdevops" + else + dr=$DOCKER_USER + fi + cat >> $BASH_ENV << EOF + export GOPATH_HEAD="$(echo ${GOPATH}|cut -d ':' -f 1)" + export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" + export DOCKER_REPO="$dr" + EOF + - run: mkdir -p "${GOPATH_BASE}" + - run: mkdir -p "${GOPATH_HEAD}/bin" \ No newline at end of file From e562828d1d3050cf0b2ac355113dc4c17c9d835c Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:49:21 -0700 Subject: [PATCH 43/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d0ca31a..df1ffeea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ jobs: # 123 working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 docker: - - image: cimg/go:1.19.0 + - image: circleci/golang:1.10 auth: username: "siyavashshams" password: "lasTampa34?m" From 012ad2da1c748cabb95e8442a601bef01f1e67c1 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:51:18 -0700 Subject: [PATCH 44/71] Updated config.yml --- .circleci/config.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index df1ffeea..b0a5554b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,13 +4,14 @@ jobs: # 123 working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 docker: - - image: circleci/golang:1.10 + - image: cimg/go:1.19.0 auth: username: "siyavashshams" password: "lasTampa34?m" steps: - checkout - setup_remote_docker + - run: name: Setup environment command: | @@ -26,4 +27,22 @@ jobs: export DOCKER_REPO="$dr" EOF - run: mkdir -p "${GOPATH_BASE}" - - run: mkdir -p "${GOPATH_HEAD}/bin" \ No newline at end of file + - run: mkdir -p "${GOPATH_HEAD}/bin" + - run: + name: Testing application + command: | + go test \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} + - deploy: + command: | + if [ "${CIRCLE_BRANCH}" == "master" ]; then + docker login -u ${username} -p ${password}; + go install --ldflags '-extldflags "-static"' \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; + mkdir bin; + cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; + docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; + docker images --no-trunc | awk '/^app/ {print $3}' | \ + sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; + docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; + fi \ No newline at end of file From 41e4afcd5381444afbb3d2f0460f551de93452d0 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:51:57 -0700 Subject: [PATCH 45/71] Updated config.yml --- .circleci/config.yml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b0a5554b..7d0ca31a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,6 @@ jobs: steps: - checkout - setup_remote_docker - - run: name: Setup environment command: | @@ -27,22 +26,4 @@ jobs: export DOCKER_REPO="$dr" EOF - run: mkdir -p "${GOPATH_BASE}" - - run: mkdir -p "${GOPATH_HEAD}/bin" - - run: - name: Testing application - command: | - go test \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - - deploy: - command: | - if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u ${username} -p ${password}; - go install --ldflags '-extldflags "-static"' \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; - mkdir bin; - cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; - docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; - docker images --no-trunc | awk '/^app/ {print $3}' | \ - sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; - docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; - fi \ No newline at end of file + - run: mkdir -p "${GOPATH_HEAD}/bin" \ No newline at end of file From 56cbc6a444dbc2463ddd59a9db1008e662669eae Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:53:04 -0700 Subject: [PATCH 46/71] Updated config.yml --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d0ca31a..97f62e80 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,4 @@ jobs: export GOPATH_HEAD="$(echo ${GOPATH}|cut -d ':' -f 1)" export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" export DOCKER_REPO="$dr" - EOF - - run: mkdir -p "${GOPATH_BASE}" - - run: mkdir -p "${GOPATH_HEAD}/bin" \ No newline at end of file + EOF \ No newline at end of file From 5ad50d1be560a08dd360e20548dd8253ad0e054f Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:53:52 -0700 Subject: [PATCH 47/71] Updated config.yml --- .circleci/config.yml | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 97f62e80..7688ae00 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,27 +1,11 @@ -version: 2 +version: 2.1 jobs: - build: - # 123 - working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 - docker: - - image: cimg/go:1.19.0 - auth: - username: "siyavashshams" - password: "lasTampa34?m" - steps: - - checkout - - setup_remote_docker - - run: - name: Setup environment - command: | - gb="/src/github.com/${CIRCLE_PROJECT_USERNAME}"; - if [ ${CIRCLE_PROJECT_USERNAME} == 'Securing-DevOps' ]; then - dr="securingdevops" - else - dr=$DOCKER_USER - fi - cat >> $BASH_ENV << EOF - export GOPATH_HEAD="$(echo ${GOPATH}|cut -d ':' -f 1)" - export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" - export DOCKER_REPO="$dr" - EOF \ No newline at end of file + build: + docker: + - image: alpine:3.15 + steps: + - run: + name: The First Step + command: | + echo 'Hello World!' + echo 'This is the delivery pipeline' \ No newline at end of file From 4c86b85961c07a0cb895d7690381de6666bd7d89 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:55:32 -0700 Subject: [PATCH 48/71] Updated config.yml --- .circleci/config.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7688ae00..81bcd505 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,13 @@ -version: 2.1 +version: 2 jobs: - build: - docker: - - image: alpine:3.15 - steps: - - run: - name: The First Step - command: | - echo 'Hello World!' - echo 'This is the delivery pipeline' \ No newline at end of file + build: + # 123 + working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 + docker: + - image: cimg/go:1.19.0 + auth: + username: "siyavashshams" + password: "lasTampa34?m" + steps: + - checkout + - setup_remote_docker \ No newline at end of file From 848341ff5f4eabce2bfe4c1db022eed4410060c5 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:56:37 -0700 Subject: [PATCH 49/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 81bcd505..8ece0f07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: # 123 - working_directory: /go/src/github.com/Securing-DevOps/invoicer-chapter2 + docker: - image: cimg/go:1.19.0 auth: From 58ed3e92a7b864e695c2d749ea143fddf38d098b Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:59:10 -0700 Subject: [PATCH 50/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8ece0f07..a8609813 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: # 123 - + working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: - image: cimg/go:1.19.0 auth: From 227f030f7ab2482d793507025c663c446a27e175 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:00:22 -0700 Subject: [PATCH 51/71] Updated config.yml --- .circleci/config.yml | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a8609813..c4399059 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,6 @@ version: 2 jobs: build: # 123 - working_directory: /go/src/github.com/Siyavashshams/invoicer-chapter2 docker: - image: cimg/go:1.19.0 auth: @@ -10,4 +9,39 @@ jobs: password: "lasTampa34?m" steps: - checkout - - setup_remote_docker \ No newline at end of file + - setup_remote_docker + + - run: + name: Setup environment + command: | + gb="/src/github.com/${CIRCLE_PROJECT_USERNAME}"; + if [ ${CIRCLE_PROJECT_USERNAME} == 'Securing-DevOps' ]; then + dr="securingdevops" + else + dr=$DOCKER_USER + fi + cat >> $BASH_ENV << EOF + export GOPATH_HEAD="$(echo ${GOPATH}|cut -d ':' -f 1)" + export GOPATH_BASE="$(echo ${GOPATH}|cut -d ':' -f 1)${gb}" + export DOCKER_REPO="$dr" + EOF + - run: mkdir -p "${GOPATH_BASE}" + - run: mkdir -p "${GOPATH_HEAD}/bin" + - run: + name: Testing application + command: | + go test \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} + - deploy: + command: | + if [ "${CIRCLE_BRANCH}" == "master" ]; then + docker login -u ${username} -p ${password}; + go install --ldflags '-extldflags "-static"' \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; + mkdir bin; + cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; + docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; + docker images --no-trunc | awk '/^app/ {print $3}' | \ + sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; + docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; + fi \ No newline at end of file From 547378ac6277833bf92b2f62843e1c1c54aafe22 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:05:45 -0700 Subject: [PATCH 52/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4399059..651ae6dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: build: - # 123 + working_directory: $CIRCLE_WORKING_DIRECTORY/Securing-DevOps/invoicer-chapter2 docker: - image: cimg/go:1.19.0 auth: From dab775bb2446b830ef551573313fde9208e2859f Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:07:15 -0700 Subject: [PATCH 53/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 651ae6dc..567080a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: build: - working_directory: $CIRCLE_WORKING_DIRECTORY/Securing-DevOps/invoicer-chapter2 + working_directory: $CIRCLE_WORKING_DIRECTORY/Siyavashsham/invoicer-chapter2 docker: - image: cimg/go:1.19.0 auth: From fc1cf184d09736243175a77bb87fba4eb5fe8abf Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:08:51 -0700 Subject: [PATCH 54/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 567080a8..8c1ba197 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: build: - working_directory: $CIRCLE_WORKING_DIRECTORY/Siyavashsham/invoicer-chapter2 + working_directory: git@github.com:Siyavashshams/invoicer-chapter2.git docker: - image: cimg/go:1.19.0 auth: From 6c86f6bc3d649aac8fe13913d94f06def09b943e Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:15:04 -0700 Subject: [PATCH 55/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c1ba197..bfa9d5c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: build: - working_directory: git@github.com:Siyavashshams/invoicer-chapter2.git + working_directory: ~/go/src/github.com/Siyavashsham/invoicer-chapter2 docker: - image: cimg/go:1.19.0 auth: From a6e811056214317e27b05f39baa8cb5e0f5090e3 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:47:36 +0430 Subject: [PATCH 56/71] Create go.mod --- go.mod | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..e33eddda --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module golang.org/x/mod + +go 1.17 + +require ( + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 + golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e +) From 7d2035a505967ee239c30e9c7221a4f6b9902569 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:18:18 -0700 Subject: [PATCH 57/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bfa9d5c6..378f9101 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: working_directory: ~/go/src/github.com/Siyavashsham/invoicer-chapter2 docker: - - image: cimg/go:1.19.0 + - image: cimg/go:1.17 auth: username: "siyavashshams" password: "lasTampa34?m" From c25f7a8d15e1c9f1c1e42a5480bf7d528b5df04c Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:50:08 +0430 Subject: [PATCH 58/71] Update go.mod --- go.mod | 5 ----- 1 file changed, 5 deletions(-) diff --git a/go.mod b/go.mod index e33eddda..69fd7946 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,3 @@ module golang.org/x/mod go 1.17 - -require ( - golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 - golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e -) From b40734533acb8fd9691af52430fb67adf8eda458 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:21:07 -0700 Subject: [PATCH 59/71] Updated config.yml --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 378f9101..495c7fa5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,7 @@ version: 2 jobs: build: + #123 working_directory: ~/go/src/github.com/Siyavashsham/invoicer-chapter2 docker: - image: cimg/go:1.17 From 6ce20c9d8e5e5294fd26d43f3b0f1ae315fb4f01 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:22:23 -0700 Subject: [PATCH 60/71] Updated config.yml --- .circleci/config.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 495c7fa5..153f9811 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,10 +1,10 @@ version: 2 jobs: build: - #123 + # 123 working_directory: ~/go/src/github.com/Siyavashsham/invoicer-chapter2 docker: - - image: cimg/go:1.17 + - image: cimg/go:1.19.0 auth: username: "siyavashshams" password: "lasTampa34?m" @@ -28,11 +28,6 @@ jobs: EOF - run: mkdir -p "${GOPATH_BASE}" - run: mkdir -p "${GOPATH_HEAD}/bin" - - run: - name: Testing application - command: | - go test \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then From 1b84c3bf7581e7f088f274d54eb8cca18cc8c7d5 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:44:04 -0700 Subject: [PATCH 61/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 153f9811..1683495f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,7 +31,7 @@ jobs: - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u ${username} -p ${password}; + docker login -u $username -p $password; go install --ldflags '-extldflags "-static"' \ github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; mkdir bin; From acdce672767a26616f7fb3934cec1d7911aca101 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:45:44 -0700 Subject: [PATCH 62/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1683495f..d733bc73 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: build: - # 123 + # 1233 working_directory: ~/go/src/github.com/Siyavashsham/invoicer-chapter2 docker: - image: cimg/go:1.19.0 From f81a5a8e266d03b8fa06e1a2eca03816433cc08d Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:46:19 -0700 Subject: [PATCH 63/71] Updated config.yml --- .circleci/config.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d733bc73..ad728654 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,12 +32,4 @@ jobs: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then docker login -u $username -p $password; - go install --ldflags '-extldflags "-static"' \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; - mkdir bin; - cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; - docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; - docker images --no-trunc | awk '/^app/ {print $3}' | \ - sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; - docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; fi \ No newline at end of file From b495bbc9dffa4b8b064d151e139582ef91ced4cf Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:47:24 -0700 Subject: [PATCH 64/71] Updated config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ad728654..544fb50c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 jobs: build: - # 1233 + # 12334 working_directory: ~/go/src/github.com/Siyavashsham/invoicer-chapter2 docker: - image: cimg/go:1.19.0 @@ -31,5 +31,5 @@ jobs: - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u $username -p $password; + docker login -u "siyavashshams" -p "lasTampa34?m"; fi \ No newline at end of file From cc35adc4e8af6bb00b7096ddf21c1e23effce48d Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:48:38 -0700 Subject: [PATCH 65/71] Updated config.yml --- .circleci/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 544fb50c..0496780b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,4 +32,12 @@ jobs: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then docker login -u "siyavashshams" -p "lasTampa34?m"; + go install --ldflags '-extldflags "-static"' \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; + mkdir bin; + cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; + docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; + docker images --no-trunc | awk '/^app/ {print $3}' | \ + sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; + docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; fi \ No newline at end of file From 07692f5d1ce0c90b45e5f8e1fdb3ffec99e858db Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:51:20 -0700 Subject: [PATCH 66/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0496780b..55b508f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,7 +33,7 @@ jobs: if [ "${CIRCLE_BRANCH}" == "master" ]; then docker login -u "siyavashshams" -p "lasTampa34?m"; go install --ldflags '-extldflags "-static"' \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; + github.com/siyavashshams/invoicer-chapter2; mkdir bin; cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; From d061f8c359333b92ce786b0f8d2ea3ed5db01fc1 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:53:34 -0700 Subject: [PATCH 67/71] Updated config.yml --- .circleci/config.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55b508f0..296ddbfd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,11 +33,6 @@ jobs: if [ "${CIRCLE_BRANCH}" == "master" ]; then docker login -u "siyavashshams" -p "lasTampa34?m"; go install --ldflags '-extldflags "-static"' \ - github.com/siyavashshams/invoicer-chapter2; + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; mkdir bin; - cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; - docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; - docker images --no-trunc | awk '/^app/ {print $3}' | \ - sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; - docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; fi \ No newline at end of file From f015ee9c8ecc8cb5370c6ca41b1d5e9d13451fb5 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:57:36 -0700 Subject: [PATCH 68/71] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 296ddbfd..b177509f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,6 +33,6 @@ jobs: if [ "${CIRCLE_BRANCH}" == "master" ]; then docker login -u "siyavashshams" -p "lasTampa34?m"; go install --ldflags '-extldflags "-static"' \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; + mkdir bin; fi \ No newline at end of file From 38a8d200daa87f262d12cde3550392947994673c Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Fri, 19 Aug 2022 00:00:21 -0700 Subject: [PATCH 69/71] Updated config.yml --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b177509f..79cf2d2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,8 +31,6 @@ jobs: - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u "siyavashshams" -p "lasTampa34?m"; - go install --ldflags '-extldflags "-static"' \ - + docker login -u "siyavashshams" -p "lasTampa34?m"; mkdir bin; fi \ No newline at end of file From 8a949e8a8796ae4217a0be398427e9494ec3d1d3 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Fri, 19 Aug 2022 00:04:21 -0700 Subject: [PATCH 70/71] Updated config.yml --- .circleci/config.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 79cf2d2c..a6430f1a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,11 @@ version: 2 jobs: build: - # 12334 - working_directory: ~/go/src/github.com/Siyavashsham/invoicer-chapter2 + # Variable expansion in working_directory not supported at this time + # You will need to modify the code below to reflect your github account/repo setup + working_directory: /go/src/github.com/lgdzou/invoicer-chapter2 docker: - - image: cimg/go:1.19.0 - auth: - username: "siyavashshams" - password: "lasTampa34?m" + - image: circleci/golang:1.10 steps: - checkout - setup_remote_docker @@ -28,9 +26,23 @@ jobs: EOF - run: mkdir -p "${GOPATH_BASE}" - run: mkdir -p "${GOPATH_HEAD}/bin" + + - run: + name: Testing application + command: | + go test \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} + - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u "siyavashshams" -p "lasTampa34?m"; + docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}; + go install --ldflags '-extldflags "-static"' \ + github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; mkdir bin; + cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; + docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; + docker images --no-trunc | awk '/^app/ {print $3}' | \ + sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; + docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; fi \ No newline at end of file From c09543077a3ca02ea4b4e9bb646ae164308a1806 Mon Sep 17 00:00:00 2001 From: Siyavashshams <111530949+Siyavashshams@users.noreply.github.com> Date: Fri, 19 Aug 2022 00:10:40 -0700 Subject: [PATCH 71/71] Updated config.yml --- .circleci/config.yml | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a6430f1a..465dbf4d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,11 +1,13 @@ version: 2 jobs: build: - # Variable expansion in working_directory not supported at this time - # You will need to modify the code below to reflect your github account/repo setup - working_directory: /go/src/github.com/lgdzou/invoicer-chapter2 + # 12334 + working_directory: ~/go/src/github.com/Siyavashsham/invoicer-chapter2 docker: - - image: circleci/golang:1.10 + - image: cimg/go:1.19.0 + auth: + username: "siyavashshams" + password: "lasTampa34?m" steps: - checkout - setup_remote_docker @@ -26,23 +28,12 @@ jobs: EOF - run: mkdir -p "${GOPATH_BASE}" - run: mkdir -p "${GOPATH_HEAD}/bin" - - - run: - name: Testing application - command: | - go test \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - - deploy: command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}; + docker login -u "siyavashshams" -p "lasTampa34?m"; go install --ldflags '-extldflags "-static"' \ - github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}; + github.com/Siyavashshams/invoicer-chapter2; mkdir bin; - cp "$GOPATH_HEAD/bin/${CIRCLE_PROJECT_REPONAME}" bin/invoicer; - docker build -t ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME} .; - docker images --no-trunc | awk '/^app/ {print $3}' | \ - sudo tee $CIRCLE_ARTIFACTS/docker-image-shasum256.txt; - docker push ${DOCKER_REPO}/${CIRCLE_PROJECT_REPONAME}; + cp "$GOPATH/bin/invoicer-chapter2" bin/invoicer; fi \ No newline at end of file