operation timedout while publishing artifacts to gitlab using goreleser - go

I am using golang to create a simple CLI application. I am using GoReleaser to release this to Gitlab. I followed the steps outlined in https://goreleaser.com/quick-start/ to release changes to gitlab.
I have generated a personal access token with API scope. I am tagging the changes and pushing them before I use the goreleaser to publish artifacts.
I always get the error which says release failed after 452.34s error=github/gitlab/gitea releases: failed to publish artifacts: Get "https://PRIVATEGITLABURL/api/v4/projects/PRIVATE_GITLAB_PROJECT/releases/v1%2E0%2E3": dial tcp IP_ADDRESS:443: connect: operation timed out.
My .gorelease.yml file
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- windows
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
# .goreleaser.yml
gitlab_urls:
api: https://PRIVATE_GITLAB_REPO/api/v4/
download: https://PRIVATE_GITLAB_REPO
# set to true if you use a self-signed certificate
skip_tls_verify: false
Any Ideas? My gitlab version is GitLab Enterprise Edition 14.1.5-ee

Check first if this is because of goreleaser/goreleaser issue 1879 ("
Using goreleaser behind a http(s) proxy "), which is supported since PR 1885 and goreleaser v0.147.0:
either your GitLab server is accessible through internet, and you have not set HTTP(S)_PROXY environment variables
or your GitLab server is on your intranet, you have set HTTP(S)_PROXY, but forgot the NO_PROXY (to not use the proxy when accessing through https:// an intranet resource).
Batuhan Apaydın suggests in the OP's discussion to apply the gitlab configuration:
# .goreleaser.yml
release:
# Default is extracted from the origin remote URL or empty if its private hosted.
# You can also use Gitlab's internal project id by setting it in the name
# field and leaving the owner field empty.
gitlab:
owner: user
name: repo.
The OP GrailsTest confirms, from GH discussion, in the comments:
I could not push my release as I can only access GitLab via SSH.
HTTP does not seem to work. Https has never worked on my machine, possibly because I have not set environment variables.
I could get this working on my colleagues machine who can access GitLab via HHTPS and SSH.

Related

Laravel Forge: How to add multiple deploy keys to one Github repository

I have one server on my Forge account with two sites. One is a production site while the other is a staging website. For example:
domain.com
test.domain.com
Both rely on the same Github repository, the staging site should be deployed when a commit is pushed to the develop branch while production should be deployed when anything is pushed to the main branch.
What did I do:
I added the deployment hook of both sites into the secrets of the Github repository:
FORGE_DEPLOYMENT_HOOK_PRODUCTION
FORGE_DEPLOYMENT_HOOK_STAGING
Then I created a Github action for both sites which starts on push to either branch and makes a curl request to the deployment hook:
name: Deploy production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy Site
run: curl ${{ secrets.FORGE_DEPLOYMENT_HOOK_PRODUCTION }}
I added the site’s deploy key of the production site (domain.com) to the repository deploy keys. When I try to add the staging key (test.domain.com) I get the error: Key is already in use. If I check the key it is actually a different key except for the first x amount of characters. Because I can’t add the key the action only works for the production site and not the staging site. I get this error when deploying staging:
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
So my question is: how can I add the second deploy key? And if this is not possible, what would be the best way to setup my Github actions to achieve the same goal? I thought this to be the easiest way.

Using Travis Ci with GitHub Pages Error: gh-token is invalid

I'm setting up my Travis Ci integration with my GitHub pages repo and I'm getting this error when committing to my dev branch, which on completion should automatically commit to my master branch.
My Error:
gh-token is invalid. Details: GET https://api.github.com/user: 401 - Bad credentials // See: https://developer.github.com/v3
My git flow is as follows:
I use dev as an intermediary branch. The application is using vue.js and required a production build, which the production build is what should be pushed to master.
push local branch to remote branch
create a pull request on remote feature branch to the dev branch
merge feature branch with dev branch (this is when Travis CI should push to master)
Here is my current .travis.yml
if: branch = dev
language: node_js
node_js:
- "lts/*"
cache:
directories:
- "node_modules"
script:
- set -e
- npm run build
deploy:
provider: pages
skip_cleanup: true
github_token: GITHUB_TOKEN
keep_history: true
local_dir: build
target_branch: master
on:
branch: dev
I've confirmed my GitHub access token and tried increasing permissions. The token I'm currently using only has public repo access, which is based on the Travis CI docs
Might be an easy fix.
Have you tried access GITHUB_TOKEN like an environment variable?
github_token: $GITHUB_TOKEN

travis-ci GitHub release upload is unauthorized

I am trying to automate uploading binaries of C++ library as GitHub Releases with Travis-CI. The release is set up to proceed with encrypted token from a user with admin privileges on repository.
Everything is according to the docs, but still getting my builds failed with this error:
`on_complete': GET https://api.github.com/user: 401 - Bad credentials // See: https://developer.github.com/v3 (Octokit::Unauthorized)
Please see details at: https://api.travis-ci.com/v3/job/161301399/log.txt
Let me clarify how I set up a release:
$ travis login
# Answer the security challenge with GitHub username/password
$ travis setup releases --com
# Answer the security challenge with GitHub username/password
# Answer few more questions
I do the --com part since the repository was recently moved to travis-ci.com and the job is performed there. However, I also tried the --pro and `` (no option, default to .org).
So here is deploy section of my .travis.yml:
deploy:
provider: releases
skip_cleanup: true
draft: true
overwrite: true
api_key:
secure: [... omitted ...]
file: ${DISTRIBUTION_NAME}
on:
all_branches: true
As for now I've run out of options, so any advice would be highly appreciated.
Well, after banging my head against the wall for the straight 3 hours, it come to my attention that I was encrypting OAuth token as secret for different repo.
Namely, travis setup releases (and updated .travis.yml) mentioned Multy-io/Multy-back while I was working on script for Multy-io/Multy-Core project.
This is leftover from setting up previous project. Please note that you might want to explicitly set the repository to avoid similar issue with:
with travis setup releases -r Name/Repo

Netlify CMS offline local host

I would like to run the NetlifyCMS locally but in an offline environment.
I was looking here: https://www.netlifycms.org/docs/authentication-backends/ and am wondering about attributes such as "auth_type". My two main questions are:
1) I have a legitimate application_id, etc. If I enter those, but run it offline, will it work?
2) Is there an "auth_type" value that I can use to disable authentication all together.
Thank you in advance for the help!
Netlify has launched a beta feature which allows working with local repo.
Navigate to a local Git repository configured with the CMS.
Run npx netlify-cms-proxy-server from the root directory of the above repository.
Update your config.yml to connect to the server:
backend:
name: proxy
proxy_url: http://localhost:8081/api/v1
branch: master # optional, defaults to master
You can check more details here

Heroku deploy using bitbucket pipelines

I am trying to use the Bitbucket Pipelines feature to deploy a node.js project to Heroku. The script(taken from documentation) is:
image: node:6
clone:
depth: full
pipelines:
default:
- step:
script:
- npm install
- git push https://heroku:$HEROKU_API_KEY#git.heroku.com/$HEROKU_APP_NAME.git master
I have set up the enviorment variables for the API key and project name however I am getting the following error:
+ git push https://heroku:$HEROKU_API_KEY#git.heroku.com/$HEROKU_APP_NAME.git master
fatal: remote part of refspec is not a valid name in .git
What am I doing wrong here?
As it turned out when I copied the app_name environment variable I copied it with a trailing space which was the error.
This will work, but in my experience so far the token expires every 8 hours so you'll have to find a different solution.

Resources