I have created this yam file to create a binary image for my iot board with circle ci..
version: 2.1
orbs:
python: circleci/python#1.4.0
jobs:
build:
executor: python/default
steps:
- checkout # checkout source code to working directory
- run:
name: Install PlatformIO
command: pip install --upgrade platformio
- run:
name: Compile Project
command: pio run
- run:
name: Creating Dummy Artifacts
command: |
cd .pio/build/esp32dev
echo "firmare.bin" > /tmp/art-1;
mkdir /tmp/artifacts;
echo "my artifact files in a dir" > /tmp/artifacts/art-2;
- store_artifacts:
path: /tmp/art-1
destination: artifact-file
- store_artifacts:
path: /tmp/artifacts
workflows:
main:
jobs:
- build
I would like to store the artifact the firmware.bin in a bucket in aws...
Do you know how to do it or a similar example that I can check and modify ?
Thanks a lot
I guess the simple option is to use CircleCI's circleci/aws-s3 orb.
Related
I tried to create CI/CD pipeline for Selenium maven project using CircleCI. but I found webDriverException. Here, I attached screenshot and circleCI.yml file. enter image description here
enter image description hereenter image description here
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/openjdk:11-jdk
working_directory: ~/demoProject
environment:
# Customize the JVM maximum heap limit
MAVEN_OPTS: -Xmx3200m
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: mvn dependency:go-offline
- run:
name: Running X virtual framebuffer
command: Xvfb :0 -ac &
- run:
name: Run Tests
command: |
export DISPLAY=:99
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}
# run tests!
- run: mvn clean test
- store_artifacts:
path: target/surefire-reports
destination: tr1
- store_test_results:
path: target/surefire-reports
Having trouble deploying to HEROKU with CircleCI. I have already tested deploying git push heroku master to heroku manually, which is working. However when I use CircleCI, deployment no longer works.
Github repo url: https://github.com/dulerong/vue-test-circleci
I have set HEROKU environment variables in CircleCI project setting.
HEROKU_API_KEY=my_key
HEROKU_APP_NAME=my_app_name
Error message follows.
#!/bin/bash -eo pipefail
if false;then
force="-f"
fi
heroku_url="https://heroku:$HEROKU_API_KEY#git.heroku.com/$HEROKU_APP_NAME.git"
if [ -n "$CIRCLE_BRANCH" ]; then
git push $force $heroku_url $CIRCLE_BRANCH:main
elif [ -n "$CIRCLE_TAG" ]; then
git push $force $heroku_url $CIRCLE_TAG^{}:main
else
echo "No branch or tag found."
exit 1
fi
fatal: Not a git repository (or any of the parent directories): .git
Exited with code exit status 128
CircleCI received exit code 128
Below is my circleCI config.yml
version: 2.1
orbs:
heroku: circleci/heroku#1.2.5
jobs:
build-job:
working_directory: ~/repo
docker:
- image: circleci/node:12.18.2
steps:
- checkout
- run:
name: Install dependencies
command: npm install
- run:
name: Build
command: npm run build
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: lint
command: npm run lint
- run:
name: test
command: npm run test:unit
deploy-job:
working_directory: ~/repo
docker:
- image: circleci/node:12.18.2
steps:
- attach_workspace:
at: ~/repo
- heroku/deploy-via-git
workflows:
version: 2.1
deploy:
jobs:
- build-job
- deploy-job:
requires:
- build-job
filters:
branches:
only: master
I have linked CircleCI to my Github repo
I have created .circleci folder config.yml
I have created an app on heroku, which works when I deploy manually
The build part of my CircleCI works, however deployment does not work
Any help is appreciated, thanks in advance.
Found out what I was missing.
- checkout
I was missing this line of code in my deploy-job. Hence after changing the deploy-job yml config code to following, everything worked.
deploy-job:
working_directory: ~/repo
docker:
- image: circleci/node:12.18.2
steps:
- checkout<--- INSERT THIS CODE HERE!!!!
- attach_workspace:
at: ~/repo
- heroku/deploy-via-git
Reason: checkout command leads CircleCI to the root directory of your project. Hence without this line of code, you're looking at a folder directory that's not even the root of your project.
Other useful command include
- run:
name: show directory
command: pwd
- run:
name: look in directory
command: ls -ltr
If you place those commands beneath checkouk, and look into the job progress in your CircleCI project, you can actually see which directory CircleCI is looking at, during that exact moment, very useful to check which directory CircleCI is working in. I put in those two commands and found out that my CircleCI was not looking at the root directory, hence discovering my problem.
Took me a few hours to figure this out!!!
I'm creating a .net build with github actions. I'm stuck on the last step for my build process, I'd like to automatically add the release folder as the artifact to upload, however, I'm not sure which variable, or if there is one to use to identify. Any assistance would be appreciated.
Example code below:
name: Build Capcom
on: [push]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout#v1
name: Checkout Code
- name: Setup MSBuild Path
uses: warrenbuckley/Setup-MSBuild#v1
- name: Setup NuGet
uses: NuGet/setup-nuget#v1.0.2
- name: Install Windows 8.1 SDK
shell: powershell
run: |
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=323507 -OutFile sdksetup.exe -UseBasicParsing
Start-Process -Wait sdksetup.exe -ArgumentList "/q", "/norestart", "/features", "OptionId.WindowsDesktopSoftwareDevelopmentKit", "OptionId.NetFxSoftwareDevelopmentKit"
- name: Restore NuGet Packages
run: nuget restore ExploitCapcom.sln
- name: Build App
run: msbuild ExploitCapcom.sln /p:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=FolderProfile
- name: Upload artifact
uses: actions/upload-artifact#v2
with:
name: Capcom
path: "D:/a/newbuild/"
I am trying to migrating circleci 1.0 to 2.0 ,
and I got this error.
in job ‘build’: steps is not a list
can someone help me what is the reason ?
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.2.3-jessie
environment:
AWS_REGION: eu-central-1
steps:
- checkout
- run: echo "Tests are skipped because of static site."
- run: mkdir -p /tmp/test-data
deploy:
production:
branch: master
commands:
- bundle exec middleman s3_sync
The identation of the array below steps seems to be off. Try this:
steps:
- checkout
- run: echo "Tests are skipped because of static site."
- run: mkdir -p /tmp/test-data
My Deployment fails in CircleCI
In my config file, I have the following:
deploy:
docker:
- image: circleci/python:2.7-jessie
working_directory: ~/circleci-docs
steps:
- run:
name: Install awscli
command: sudo pip install awscli
- run:
name: Deploy to s3
command: aws s3 sync <filepath> s3://BUCKET-NAME/ --delete
It fails on the deploy and I get the error
The user provided path does not exist
I have tried a few different file paths:
/
~/applicationname
~/working-directoryname
~/
But they all give the same error.
Then I tried using the working_directory name and also /home/circleci/working_directory_name
Both seem to succeed, yet no files appear in the bucket
What is the path that I should be using for the filepath?