CircleCI: Trigger build when repository that is not mine changes - continuous-deployment

At CircleCI: Is it possible to trigger a build when a git repository that is not mine changes / gets a new tag?

You can trigger a build via the CircleCI API
POST: /project/:vcs-type/:username/:project/tree/:branch
Triggers a new build, returns a summary of the build.
Example:
curl -X POST -H -d "{}" "https://circleci.com/api/v1/project/your_organization/your_project/tree/master?circle-token=3afeaxxxxxxxxxxx"

Related

Add Flink Job Jar in Docker Setup and run Job via Flink Rest API

We're running Flink in Cluster Session mode and automatically add Jars in the Dockerfile:
ADD pipeline-fat.jar /opt/flink/usrlib/pipeline-fat.jar
So that we can run this Jar via the Flink Rest API without the need to upload the Jar in advance:
POST http://localhost:8081/:jarid/run
But the "static" Jar is now shown, to get the :jarid:
GET http://localhost:8081/jars
So my question is:
Is it possible to run a userlib jar using the Flink Rest API?
Or can you only reference such jars via
CLI flink run -d -c ${JOB_CLASS_NAME} /job.jar
and standalone-job --job-classname com.job.ClassName Mode?
My alternative approach (workaround) would be to upload the jar in the Docker entrypoint.sh of the jobmanager container:
curl -X POST http://localhost:8084/jars/upload \
-H "Expect:" \
-F "jarfile=#./pipeline-fat.jar"
I believe that it is unfortunately not possible to currently start a flink cluster in session mode with a jar pre-baked in the docker image, and then start the job using the REST API commands (as you showed).
However your workaround approach seems like a good idea to me. I would be curious to see if it worked for you in practice.
I managed to run a userlib jar using the command line interface.
I edited docker compose to run custom docker-entrypoint.sh.
I've add to original docker-entrypoint.sh
run_user_jars() {
echo "Starting user jars"
exec ./bin/flink run /opt/flink/usrlib/my-job-0.1.jar & }
run_user_jars
...
And edit original entrypoint for jobmanager in docker-compose.yml file
entrypoint: ["bash", "/opt/flink/usrlib/custom-docker-entrypoint.sh"]

Can not deploy create-react-app with token

I have been trying to deploy create-react-app, but got an error
fatal: repository 'https://github.com/charyyev2000/Portfolio-React.git/' not found
then I created a token and tried to deploy with that,
git remote add origin https://<TOKEN>#github.com/charyyev2000/Portfolio-React.git
again got an error;
Deleted repository, created again and tried to deploy, again got the same error
fatal: repository 'https://github.com/charyyev2000/Portfolio-React.git/' not found
What did I do wrong? or, is there something wrong with my homepage in packages.json?
"homepage": "https://charyyev2000.github.io/Portfolio-React",
I cant deploy from any other of my repositories too.
What should I do now.
You are new comer in Git/GitHub tools, I hope you can done this task.
Your remote repository URL is https://github.com/charyyev2000/Portfolio-React
Solution 1:
Create a new repository on the command line
echo "# Portfolio-React" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/charyyev2000/Portfolio-React.git
git push -u origin main
Solution 2: (I think you will prefer this solution, because your source code is exist).
Push an existing repository from the command line
git remote add origin https://github.com/charyyev2000/Portfolio-React.git
git branch -M main
git push -u origin main
Let's follow the guide what you see likes this
P/S: Sometime, you need
git add .
git commit -m"foo"
git push -v
or you see any guide on your console screen, let's follow guide what you see.
Your repository is probably private.
Try this: git remote set-url origin https://YOUR_GITHUB_USER#github.com/charyyev2000/Portfolio-React.git
Or use an ssh key.
https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent&ved=2ahUKEwjoysreiIjzAhVwTTABHQPHDzIQFnoECGwQAQ&sqi=2&usg=AOvVaw2B_nuIizqk0LtbV4qWtzzH

Retrieve latest artifact from JFROG artifactory

I have a few versions of my code in JFROG, which are provided to the clients. How do I specify a generic way to pull latest version(Artifact)? It is not Maven code. I looked up on the Jfrog page:
'''
GET http://localhost:8081/artifactory/ivy-local/org/acme/[RELEASE]/acme-[RELEASE].jar
'''
How do I get [RELEASE] ?
Please help ?
the [RELEASE] in this case is the version number you want to download the latest artifact for. To get that number you can use the REST API call for Artifact Latest Version Search Based on Layout. For example
GET /api/search/latestVersion?g=org.acme&a=artifact&repos=libs-snapshot-local
This would return a string of the latest release version you have.
You can follow the documentation at jfrog
#!/bin/bash
# Note that we don't enable the 'e' option, which would cause the script to
# immediately exit
set -uo pipefail
HOST=myartcloud.jfrog.io
USER=thisIsMyUser
PASS=thisismypass
SNAPSHOT_LAST_VERSION=$(curl --silent --show-error --fail \
-u$USER:"$PASS" \
-X POST https://$HOST/artifactory/api/search/aql \
-H "content-type: text/plain" \
-d 'items.find({ "repo": {"$eq":"my-repo-snapshot"}, "name": {"$match" : "my-project-package-name*"}})'\
| grep -E -o -e 'my-project-package-name-[[:digit:]].[[:digit:]].[[:digit:]]+'| uniq | sort | tail -1 \
| grep -E -o -e '[[:digit:]].[[:digit:]].[[:digit:]]+')
Explanation. Making usage of curl with option
--fail (HTTP) Fail silently (no output at all) on server errors. This is mostly done to better enable scripts etc to better deal with failed attempts.
--silent Silent or quiet mode. Don't show progress meter or error messages. Makes Curl mute.
--show-error When used with -s it makes curl show an error message if it fails.
Then a post request -X POST is made using basic authentication to the api path. The content type of the request is -H "content-type: text/plain".
-d, --data (HTTP) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML.
The data sent, is using a filter query to find an repository and also the content.
After the api results, using grep command line utility where it searches for PATTERNS and return only the version number.
Example: 0.1.1

Push changes to bitbucket using atom

I am using the text editor Atom and it should be possible to upload directly to bitbucket from atom. I found a thread here on stackoverflow someone asked for this and someone recommended git-plus package. I did download this package but it tells me i need to edit user.email and user.name variable in gitconfig file. But it doesnt say anywhere where i can find this gitconfig file. I found a few config files but none of them have these variables. Is this gitconfig file in my .git folder in my project or is it somewhere in atom? I hope someone here can help me with this
Set up git in your shell to use bitbucket as the remote repo.
You will first need to sort that basic Git config thing about the emails:
$ git config --global --get user.name
Your Name Here
$ git config --global --get user.email
your_email#someplace.com
If you don't have these values already added, then simply add them. Put your current directory someplace under the root of your atom repository (or, if you want to use the --global parameters [recommended]), then anywhere will do, really so long as it's your login you're working with.)
$ git config [--global] user.name "Your Name"
$ git config [--global] user.email "your_email#somplace.com"
First set up your ssh key so you don't have to type your password on every command. Once that's done, then go to the Git repo you set up for your Atom project. Most likely that's in the top level of my project. Go there and...
$ git remote -v
$ git remote add origin git#bitbucket.org:youruid/yourrepo.git
Now try it from the shell to make sure all is working:
$ git push
It's very likely you'll get a message similar to:
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
Follow the advice given, then, if you're feeling particularly paranoid, make a change to any file in the repo -- using atom if you like, doesn't matter -- and try it all again:
$ git add -u
$ git commit [-v]
...
$ git push
This time, it should go off without a hitch.
Now back to atom...
If you've configured things there so that atom can access your Git repo locally, there should now be a Fetch widget in the lower right corner:
If you make a change now in atom, you'll see this change to Push... with the functionality to match.
The GitHub widget still doesn't do anything -- which is mildly annoying -- but I believe you might be able to find an atom package out there that does similar things.

Golang Undefined google.JWTAccessTokenSourceFromJSON after installing appengine sdk

I installed the Go app engine packages this evening. This seems to have broken my whole Go installation.
Each time I attempt to run any go command, it fails with:
../../../google.golang.org/grpc/credentials/oauth/oauth.go:85: undefined: google.JWTAccessTokenSourceFromJSON
Erm...
I tried nuking the google.golang.org directory without success. When I run go get -x ./... I get the following:
WORK=/var/folders/94/4lkprvq57vj4svwmt_kz5h6m0000gn/T/go-build842729114
mkdir -p $WORK/google.golang.org/grpc/credentials/oauth/_obj/
mkdir -p $WORK/google.golang.org/grpc/credentials/
cd /Users/simon/Documents/Code/golang/src/google.golang.org/grpc/credentials/oauth
/usr/local/Cellar/go/1.6.2/libexec/pkg/tool/darwin_amd64/compile -o $WORK/google.golang.org/grpc/credentials/oauth.a -trimpath $WORK -p google.golang.org/grpc/credentials/oauth -complete -buildid 8d03dba436005dd3d1e75147bde330259f288075 -D _/Users/simon/Documents/Code/golang/src/google.golang.org/grpc/credentials/oauth -I $WORK -I /Users/simon/Documents/Code/golang/pkg/darwin_amd64 -pack ./oauth.go
# google.golang.org/grpc/credentials/oauth
../../../google.golang.org/grpc/credentials/oauth/oauth.go:85: undefined: google.JWTAccessTokenSourceFromJSON
Help needed fixing before all sanity gone.
I ran into this problem as well. I think the go get functionality pulled an outdated repo when updating the Google app engine packages.
This worked for me:
cd $GOPATH/src/golang.org/x/oauth2/google
git fetch
git pull
Turns out I was 66 commits behind master; this fixed it for me. Hope it works for you.

Resources