diff --git a/.circleci/config.yml b/.circleci/config.yml index 6845aa00..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/Securing-DevOps/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}; - fi + cp "$GOPATH/bin/invoicer-chapter2" bin/invoicer; + fi \ No newline at end of file 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 ========================== diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..69fd7946 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module golang.org/x/mod + +go 1.17