-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into github-workflow-publish
- Loading branch information
Showing
64 changed files
with
1,317 additions
and
1,086 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,18 @@ | ||
version: 2 | ||
version: 2.1 | ||
aliases: | ||
- &google-sdk-container-config | ||
docker: | ||
- image: google/cloud-sdk:latest | ||
auth: | ||
username: $DOCKERHUB_LOGIN | ||
password: $DOCKERHUB_PASSWORD | ||
- &GCP-auth-docker | ||
name: GCP authentication with docker | ||
command: | | ||
echo $DOCKER_PASSWORD > ${HOME}/account-auth.json | ||
- &jfrog-login | ||
name: Rename jfrog environment variable for maven setting.xml | ||
command: | | ||
echo "export JFROG_USER=$ARTIFACTORY_USER" >> $BASH_ENV | ||
echo "export JFROG_PASS=$ARTIFACTORY_PASSWORD" >> $BASH_ENV | ||
- &tag-git-version | ||
name: Tag git commit with build version and push to github | ||
- &post_build | ||
name: Trigger downstream builds | ||
command: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "circleci" | ||
git tag $VERSION | ||
git push origin $VERSION | ||
- &create-image-version | ||
name: Create new image version and store to env var and as file in workspace | ||
command: | | ||
echo "export VERSION=$CIRCLE_BRANCH-v$CIRCLE_BUILD_NUM-$(echo -n $CIRCLE_SHA1 | tail -c 8)" >> $BASH_ENV | ||
echo "$CIRCLE_BRANCH-v$CIRCLE_BUILD_NUM-$(echo -n $CIRCLE_SHA1 | tail -c 8)" > version | ||
- &read-image-version | ||
name: Read new image version from workspace | ||
command: | | ||
echo "export VERSION=$(cat ./version)" >> $BASH_ENV | ||
- &docker-build-and-push | ||
name: Docker build and push | ||
command: | | ||
IMAGE="eu.gcr.io/entur-system-1287/${CIRCLE_PROJECT_REPONAME}" | ||
echo "Image: ${IMAGE}" | ||
docker build -t $IMAGE . | ||
docker tag $IMAGE "${IMAGE}":"${VERSION}" | ||
docker login -u _json_key --password-stdin https://eu.gcr.io < ${HOME}/account-auth.json | ||
docker push "${IMAGE}":"${VERSION}" | ||
wget https://raw.githubusercontent.com/entur/circleci-toolbox-image-java11/master/tools/trigger_build_v2.sh -O .circleci/trigger_build_v2.sh | ||
chmod +x .circleci/trigger_build_v2.sh | ||
echo 'export CIRCLE_SHA1="$CIRCLE_SHA1"' >> $BASH_ENV | ||
echo 'export CIRCLE_PROJECT_REPONAME="$CIRCLE_PROJECT_REPONAME"' >> $BASH_ENV | ||
.circleci/trigger_build_v2.sh "entur/uttu-deployment-config.git" "master" "$(git log -1 --pretty=%B)" | ||
- &sonar-scan | ||
name: Sonar scan | ||
command: | | ||
|
@@ -55,7 +28,7 @@ aliases: | |
-Dsonar.host.url=https://sonarcloud.io \ | ||
-Dsonar.token=${ENTUR_SONAR_PASSWORD} | ||
jobs: | ||
build: | ||
test: | ||
machine: | ||
image: ubuntu-2204:2024.04.3 | ||
environment: | ||
|
@@ -94,36 +67,49 @@ jobs: | |
path: ~/junit | ||
- store_artifacts: | ||
path: ~/junit | ||
- run: *create-image-version | ||
- run: *tag-git-version | ||
- persist_to_workspace: | ||
root: ~/project | ||
paths: | ||
- target | ||
- Dockerfile | ||
- .circleci | ||
- ./version | ||
deploy-docker: | ||
<<: *google-sdk-container-config | ||
build: | ||
docker: | ||
- image: cimg/openjdk:21.0.2-node | ||
auth: | ||
username: $DOCKERHUB_LOGIN | ||
password: $DOCKERHUB_PASSWORD | ||
environment: | ||
MAVEN_OPTS: -Xmx3G | ||
steps: | ||
- setup_remote_docker: | ||
version: default | ||
docker_layer_caching: true | ||
- attach_workspace: | ||
at: ~/project | ||
- run: *GCP-auth-docker | ||
- run: *read-image-version | ||
- run: *docker-build-and-push | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- dep-cache-v2-{{ checksum "pom.xml" }} | ||
- dep-cache-v2- | ||
- run: | ||
name: Download Maven settings | ||
command: wget https://raw.githubusercontent.com/entur/circleci-toolbox-image-java11/master/tools/m2/settings.xml -O .circleci/settings.xml | ||
- run: *jfrog-login | ||
- run: | ||
name: Refresh cache | ||
command: mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.0:go-offline -s .circleci/settings.xml | ||
- save_cache: | ||
paths: | ||
- ~/.m2 | ||
key: dep-cache-v2-{{ checksum "pom.xml" }} | ||
# Cannot use -o because of snapshot dependencies. | ||
- run: mvn deploy -s .circleci/settings.xml -P prettierSkip -DskipTests | ||
- run: *post_build | ||
workflows: | ||
version: 2 | ||
build_test_deploy: | ||
release: | ||
jobs: | ||
- build: | ||
- test: | ||
context: global | ||
- deploy-docker: | ||
- build: | ||
context: global | ||
requires: | ||
- build | ||
filters: | ||
branches: | ||
only: master | ||
only: | ||
- master | ||
requires: | ||
- test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
api/apiproxy/policies/flowCallout.generalStackdriverLogging.xml
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
api/apiproxy/policies/flowCallout.getEnvironmentConfiguration.xml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.