Skip to content

Commit

Permalink
Merge pull request #133 from codacy/publish-to-artifacts-codacy
Browse files Browse the repository at this point in the history
feature: Publish to artifacts.codacy.com CY-3729
  • Loading branch information
lolgab authored Feb 23, 2021
2 parents 737ed78 + 7d5f8fb commit 04d1590
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
codacy: codacy/base@2.7.0
codacy: codacy/base@5.2.0
references:
circleci_job: &circleci_job
docker:
Expand Down Expand Up @@ -57,8 +57,10 @@ jobs:
- attach_workspace:
at: ~/workdir
- run: |
# Uncompress target folders compressed by codacy/sbt orb
tar -xf targets.tar.gz
mkdir -p ~/workdir/artifacts/
upx --lzma -o ~/workdir/artifacts/$CIRCLE_PROJECT_REPONAME-linux-$(cat .version) ~/workdir/target/native-image/$CIRCLE_PROJECT_REPONAME
upx --lzma -o ~/workdir/artifacts/$CIRCLE_PROJECT_REPONAME-linux ~/workdir/target/native-image/$CIRCLE_PROJECT_REPONAME
- persist_to_workspace:
root: ~/workdir
paths:
Expand Down Expand Up @@ -100,11 +102,10 @@ workflows:
- compress_and_package_artifacts:
requires:
- build_native_image
- codacy/shell:
name: publish_bintray
cmd: |
curl -T ~/workdir/artifacts/$CIRCLE_PROJECT_REPONAME-linux-$(cat .version) -ucodacy-ci:$BINTRAY_API_KEY -H "X-Bintray-Package:$CIRCLE_PROJECT_REPONAME" -H "X-Bintray-Version:$(cat .version)" https://api.bintray.com/content/codacy/Binaries/$(cat .version)/$CIRCLE_PROJECT_REPONAME-linux
curl -X POST -ucodacy-ci:$BINTRAY_API_KEY https://api.bintray.com/content/codacy/Binaries/$CIRCLE_PROJECT_REPONAME/$(cat .version)/publish
- codacy/publish_s3:
name: publish_artifacts
files: artifacts/codacy-plugins-test-linux
path: bin/codacy-plugins-test
filters:
branches:
only:
Expand All @@ -127,7 +128,7 @@ workflows:
context: CodacyAWS
requires:
- publish_ghr
- publish_bintray
- publish_artifacts
- publish_dev:
context: CodacyCircleCI
requires:
Expand Down
2 changes: 1 addition & 1 deletion orbs/jobs/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ steps:
command: |
mkdir -p codacy-plugins-test
cd codacy-plugins-test
LINK="https://bintray.com/codacy/Binaries/download_file?file_path=$CODACY_PLUGINS_TEST_VERSION%2Fcodacy-plugins-test-linux"
LINK="https://artifacts.codacy.com/bin/codacy-plugins-test/$CODACY_PLUGINS_TEST_VERSION/codacy-plugins-test-linux"
wget -nc $LINK -O $FILENAME # FILENAME injected in .circle/config.yml
chmod +x $FILENAME
docker load --input << parameters.docker_tar_path >>
Expand Down

0 comments on commit 04d1590

Please sign in to comment.