version: 0.2 env: secrets-manager: GITUSERNAME: 'arn:aws:secretsmanager:ap-southeast-2:262112264387:secret:secrets.hip-hl7nz-github-m2GhOv:username' GITTOKEN: 'arn:aws:secretsmanager:ap-southeast-2:262112264387:secret:secrets.hip-hl7nz-github-m2GhOv:token' MAVEN_USER: 'arn:aws:secretsmanager:ap-southeast-2:262112264387:secret:hip-secrets.nexus.username:hip-secrets.nexus.username' MAVEN_PASSWORD: 'arn:aws:secretsmanager:ap-southeast-2:262112264387:secret:hip-secrets.nexus.password:hip-secrets.nexus.password' phases: install: runtime-versions: java: corretto17 nodejs: 16 ruby: 3.1 commands: - env - aws s3 cp s3://nz-govt-moh-hip-build/codebuild-common/settings-clean.xml - | envsubst > /root/.m2/settings.xml - export HTTP_PROXY="WebProxy-80fef376c00ea74f.elb.ap-southeast-2.amazonaws.com:3128" - export HTTPS_PROXY="WebProxy-80fef376c00ea74f.elb.ap-southeast-2.amazonaws.com:3128" - export NO_PROXY="10.*,192.168.*,172.16.80.*,172.22.80.*,169.254.169.254,*.ap-southeast-2.amazonaws.com,*.vpce.amazonaws.com,*.moh-aws.nz,lxddypd1.moh.govt.nz" #- wget -e use_proxy=yes -e https_proxy=WebProxy-80fef376c00ea74f.elb.ap-southeast-2.amazonaws.com:3128 https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar >/dev/null 2>&1 - aws s3 cp s3://nz-govt-moh-hip-build/codebuild-common/fhir/publisher/1.6.18/publisher.jar ./publisher.jar - cp publisher.jar ~/publisher.jar - wget -e use_proxy=yes -e https_proxy=WebProxy-80fef376c00ea74f.elb.ap-southeast-2.amazonaws.com:3128 https://github.com/hapifhir/org.hl7.fhir.core/releases/latest/download/validator_cli.jar >/dev/null 2>&1 - cp validator_cli.jar ~/validator_cli.jar - npm config set proxy http://WebProxy-80fef376c00ea74f.elb.ap-southeast-2.amazonaws.com:3128 #- npm install -g fsh-sushi - npm install -g fsh-sushi@2.6.1 - npm install markdown - gem install jekyll bundler - sudo wget -e use_proxy=yes -e https_proxy=WebProxy-80fef376c00ea74f.elb.ap-southeast-2.amazonaws.com:3128 https://github.com/mikefarah/yq/releases/download/v4.28.1/yq_linux_386 -O /usr/bin/yq && - sudo chmod +x /usr/bin/yq - yum install git -y pre_build: commands: - sushi -v - jekyll -v - java -jar ./publisher.jar -v build: commands: - ls - rm -rf ./hpi - git clone --branch $BRANCH https://$GITUSERNAME:$GITTOKEN@github.com/HL7NZ/hpi - cd hpi - git checkout $BRANCH - ls - echo getting depenencies #- mvn package -ntp # get hip-fhir-common package #- mvn validate - mvn clean dependency:purge-local-repository validate - echo building IG - ls -l - sudo chmod +x ./build-ig-cicd.sh - ./build-ig-cicd.sh 2>&1 | tee build-ig.log - echo checking in full-ig.zip - git add -f ./output/full-ig.zip - git commit -m "new IG build" - git push # deploy the hpi conformance artefacts - mvn deploy artifacts: files: - 'hpi/output/full-ig.zip' - 'hpi/target/*.zip' - 'hpi/build-ig.log' name: $BRANCH