diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 4d8e0aa..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,157 +0,0 @@ -version: 2.1 - -executors: - gradle_docker: - docker: - # This image isn't used to build Java project, rather to invoke Docker with Gradle. - # The version of Docker on cimg/openjdk tends to be slightly behind cimg/base. - - image: cimg/openjdk:14.0.2 - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - helm: - docker: - - image: hypertrace/helm-gcs-packager:0.3.0 - auth: - username: $DOCKERHUB_USERNAME - password: $DOCKERHUB_PASSWORD - -commands: - gradle: - description: 'Run the provided gradle command' - parameters: - args: - type: string - when: - default: "on_success" - type: enum - enum: ["on_fail", "on_success", "always"] - steps: - - run: - name: << parameters.args >> - command: ./gradlew << parameters.args >> --info --max-workers=2 -Dorg.gradle.jvmargs=-Xmx2g -Dorg.gradle.console=plain - when: << parameters.when >> - setup_build_environment: - description: 'Checkout, restore the cache, and setup docker' - steps: - - checkout - - restore_cache: - keys: # Use gradle version for cache, so it doesn't download every time - - v1-dependencies-{{ checksum "./gradle/wrapper/gradle-wrapper.properties" }} - # The remote docker version is independent from what's installed in the gradle_docker image and defaults to Docker 17. - # Use the latest value from https://circleci.com/docs/2.0/building-docker-images/#docker-version - - setup_remote_docker: - version: 19.03.12 - - run: - name: Dockerhub login - command: echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USERNAME --password-stdin - save_populated_cache: - description: "Save the gradle binary to the cache so it doesn't have to redownload" - steps: - - save_cache: - paths: - - ~/.gradle - key: v1-dependencies-{{ checksum "./gradle/wrapper/gradle-wrapper.properties" }} - -jobs: - build: - executor: gradle_docker - steps: - - setup_build_environment - - gradle: - args: dockerBuildImages - - save_populated_cache - merge-publish: - executor: gradle_docker - steps: - - setup_build_environment - - gradle: - args: dockerPushImages - release-publish: - executor: gradle_docker - steps: - - setup_build_environment - - gradle: - args: dockerPushImages - validate-charts: - executor: helm - steps: - - checkout - - run: - name: Helm Charts Lint and Template Render - command: | - helm lint --strict ./helm/ - helm lint --strict ./helm/ --set replicaSet.enabled=true --set backup.enabled=true - helm template --dry-run ./helm/ --set replicaSet.enabled=true --set backup.enabled=true - release-charts: - executor: helm - steps: - - checkout - - run: - name: Add release tag - command: | - git config --global user.email "${CIRCLE_USERNAME}@hypertrace.org" - git config --global user.name "$CIRCLE_USERNAME" - git tag -am "Released by $CIRCLE_USERNAME" $(git describe --abbrev=0 --tags | sed 's/^release-//') - - run: - name: Remove trigger tag - command: git tag -d release-$(git describe --abbrev=0) - - run: - name: Package and Publish Helm Charts - # Read the "name:" from Chart.yaml. The chart version is - - command: | - CHART_VERSION=$(git describe --abbrev=0) - CHART_NAME=$(awk '/^name:/ {print $2}' ./helm/Chart.yaml) - export GOOGLE_APPLICATION_CREDENTIALS=${HOME}/helm-gcs-key.json - echo ${HELM_GCS_CREDENTIALS} > ${GOOGLE_APPLICATION_CREDENTIALS} - helm repo add helm-gcs ${HELM_GCS_REPOSITORY} - helm package --version ${CHART_VERSION} --app-version ${CHART_VERSION} ./helm/ - helm gcs push ${CHART_NAME}-${CHART_VERSION}.tgz helm-gcs --public --retry - - add_ssh_keys: - fingerprints: - - '5e:5d:02:29:b8:8b:08:5b:b0:d3:20:b9:36:d4:72:00' - - run: - name: Update remote tags - command: git push origin refs/tags/$(git describe --abbrev=0) :refs/tags/release-$(git describe --abbrev=0) - -workflows: - version: 2 - build-and-publish: - jobs: - - build: - context: - - dockerhub-read - - validate-charts: - context: - - dockerhub-read - - merge-publish: - context: - - hypertrace-publishing - - dockerhub-read - requires: - - build - - validate-charts - filters: - branches: - only: - - main - - release-publish: - context: - - hypertrace-publishing - - dockerhub-read - filters: - branches: - ignore: /.*/ - tags: - only: /^release-.*/ - - release-charts: - context: - - hypertrace-publishing - - dockerhub-read - requires: - - release-publish - filters: - branches: - ignore: /.*/ - tags: - only: /^release-.*/ diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3d41425..69d8499 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,3 +2,6 @@ # global * @buchi-busireddy @aaron-steinfeld @tim-mwangi @ravisingal @laxmanchekka + +# GH action +.github/ @aaron-steinfeld @jbahire @kotharironak @buchi-busireddy \ No newline at end of file diff --git a/.github/workflows/merge-publish.yml b/.github/workflows/merge-publish.yml new file mode 100644 index 0000000..f4b5e83 --- /dev/null +++ b/.github/workflows/merge-publish.yml @@ -0,0 +1,42 @@ +name: merge-publish +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + merge-publish: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_READ_USER }} + password: ${{ secrets.DOCKERHUB_READ_TOKEN }} + + - name: push docker image + uses: hypertrace/github-actions/gradle@main + with: + args: dockerPushImages + env: + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }} + DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }} diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml new file mode 100644 index 0000000..0875e53 --- /dev/null +++ b/.github/workflows/pr-build.yml @@ -0,0 +1,47 @@ +name: build and validate +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: Build with Gradle + uses: hypertrace/github-actions/gradle@main + with: + args: build dockerBuildImages + + validate-helm-charts: + runs-on: ubuntu-20.04 + steps: + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: validate charts + uses: hypertrace/github-actions/validate-charts@main + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..4941d12 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,60 @@ +name: Publish artifacts +on: +# Will only run when release is published. + release: + types: + - created + workflow_dispatch: + +jobs: + publish-artifacts: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_READ_USER }} + password: ${{ secrets.DOCKERHUB_READ_TOKEN }} + + - name: publish docker image + uses: hypertrace/github-actions/gradle@main + with: + args: dockerPushImages + env: + DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }} + DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }} + + publish-helm-charts: + needs: publish-artifacts + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Checkout Repository + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - name: package and release charts + uses: hypertrace/github-actions/helm-gcs-publish@main + with: + helm-gcs-credentials: ${{ secrets.HELM_GCS_CREDENTIALS }} + helm-gcs-repository: ${{ secrets.HELM_GCS_REPOSITORY }} + diff --git a/mongodb-backup/build.gradle.kts b/mongodb-backup/build.gradle.kts index 773cafd..ab7c351 100644 --- a/mongodb-backup/build.gradle.kts +++ b/mongodb-backup/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - id("org.hypertrace.docker-plugin") version "0.7.0" - id("org.hypertrace.docker-publish-plugin") version "0.7.0" + id("org.hypertrace.docker-plugin") version "0.8.1" + id("org.hypertrace.docker-publish-plugin") version "0.8.1" } hypertraceDocker { diff --git a/mongodb/build.gradle.kts b/mongodb/build.gradle.kts index eb4d813..f5ed54d 100644 --- a/mongodb/build.gradle.kts +++ b/mongodb/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - id("org.hypertrace.docker-plugin") version "0.7.0" - id("org.hypertrace.docker-publish-plugin") version "0.7.0" + id("org.hypertrace.docker-plugin") version "0.8.1" + id("org.hypertrace.docker-publish-plugin") version "0.8.1" } hypertraceDocker {