How to update your surge.sh project? - surge.sh

I deployed a surge.sh project and it was published successfully, however, I want to make some updates to the project, the updates have been applied locally and can be seen working but it tried to publish it to the same domain again yet it doesn't appear updated. I also tried to tear down the project and re-upload it still it shows the old project, I cleared the cache too but it still didn't update. Any idea why?

To update a project you just need to publish it again to the same domain.
You can do this quickly by creating a file called CNAME in the project root directory to set the default domain name, like this:
echo site-name.surge.sh >CNAME
Then each time to update:
surge .
Alternatively, without a CNAME file, specify the domain in the surge command like this:
surge --domain site-name.surge.sh .
See https://surge.sh/help/remembering-a-domain .
This will not solve the need to tear down and republish the site described in the original post, but if you're not having that problem, it will make it quick to update your surge.sh project, as per the title question, without the need to edit the domain the usual prompt.

Open Git Bash.
Switch to the project directory.
Type surge and click Enter.
Click Enter in line "project".
Enter URL of your project in line "domain" and click Enter.
That's it!

Use the following deploy script to update your deployed Surge Project
"deploy": "surge --project ./path_to_build_folder --domain custom-domain.surge.sh"

Just go to your project folder, use cd to select your project directory, then type npm run build , then change directory to build directory cd build and then use surge
Edit:
Example \
You need go to your project directory, in my case it's jamming
$ cd ../
King#DESKTOP-5ERNS17 MINGW64 ~/Documents/Projects/jamming (main)
$ pwd
/c/Users/King/Documents/Projects/jamming
King#DESKTOP-5ERNS17 MINGW64 ~/Documents/Projects/jamming (main)
Then you do npm run build, I guess you need to update the build.
King#DESKTOP-5ERNS17 MINGW64 ~/Documents/Projects/jamming (main)
$ npm run build
Once the build is compiled, go in to the build directory by using cd build and then do surge
King#DESKTOP-5ERNS17 MINGW64 ~/Documents/Projects/jamming (main)
$ cd build
King#DESKTOP-5ERNS17 MINGW64 ~/Documents/Projects/jamming/build
$ surge
That's how it worked with me. If I don't do npm run build before the surge just won't update it... I don't know if this is the right way...

To update your Surge project, simply run surge in the project directory and input the same domain you're already using in the domain: prompt.
Some users are describing a problem where they have to do a hard refresh to see their updates. This is to be expected, and happens with any static file host, since static files are cached by your browser to make page loads faster.
So to see the latest version of your Surge site, press Ctrl+Shift+J or F12 to open the developer tools, and right-click on the reload button in the browser's unibar, and click on Empty Cache and Hard Reload.

Open Cmd.
Switch to the project directory.
Type surge . and click Enter.
and change the random domain with your web that's want to update and hit enter.
That's it <3

Go to the directory project and use git or cmd and this structure:
type surge and hit enter
hit enter in project line
replace the random domain with your web url
hit enter

Related

I try CircleCI but failed

I want use CircleCI.
I try getting start.
I create a new repository.
https://circleci.com/docs/2.0/getting-started/#section=getting-started
repository name is 'hello-world', and specific branch name 'circleci-project-setup'
We’ll commit the config below to duri0214/hello-world on a new branch called circleci-project-setup. If you prefer, you can use an existing config.
Setting up CircleCI
click Set Up Project. hmm... I like python.
Upload config.yml on 'circleci-project-setup' branch.
Click Start Building and follow the prompt to add your config to a new branch and start your first pipeline. Note: You can also manually add a config.yml to your project root under a .circleci folder and push this to your VCS provider.
Click Start Building??? this is nothing. document is old?
I try commit and run button.
failed, failed, failed
Why can't i
Next try
error computing cache key: template: cacheKey:1:7: executing
"cacheKey" at <checksum "requirements.txt">: error calling checksum:
open /home/circleci/project/requirements.txt: no such file or
directory
#!/bin/bash -eo pipefail if true; then pip install --user -r requirements.txt else pip install -r requirements.txt fi
ERROR: Could not open requirements file: [Errno 2] No such file or
directory: 'requirements.txt'
Exited with code exit status 1 CircleCI received exit code 1
As the documentation says, you need to place the circleci configuration in the .circlei directory
Click Start Building and follow the prompt to add your config to a new branch and start your first pipeline. Note: You can also manually add a config.yml to your project root under a .circleci folder and push this to your VCS provider.
About Click Start Building , I'm guessing it's a documentation miss, likely.
oh my goodness..
I use circleci directory instead .circleci.
success...

Jenkins cannot find g++

I am learning all of these new technologies. I have a home server for private development with latest version of centos 7.6 (minimal installation). I am trying to keep the server as light as possible.
I have installed jenkins (v2.164.2) and it is up and running correctly. I have created a new Freestyle project to compile a g++ project hosted on another own gogs server. I have defined gogs url and credentials and then added the following in the execute shell command:
which g++; make clean; make;
When I press the "Build Now" button, it fails with the following message:
which: no g++ in (/sbin:/usr/sbin:/bin:/usr/bin)
Cloning the repository, etc seems to be working fine.
I have NOT installed the default g++ version but instead I have installed the one that comes with devtools-7 (g++ v7.3.1). I have created a new file under /etc/profile.d/devtools.sh with the following text:
!#/bin/bash
source scl_source enable devtoolset-7
If I login into a bash shell in the server and then run which g++, I get the expected output.
Finally, the question: why jenkins is not picking this up? As far as I know, adding that file under /etc/profile.d ensures that everyone will be able to access g++.
Thanks very much in advance for any help.
I have managed to fix it at the end. I leave the question just in case someone else runs into the same problem. I only had to add the following line as first line in the "execute shell" command field:
#!/bin/bash -l
make clean; make;
That #!/bin/bash -l did the trick. (Please mind the -l).
Found it here: What shell does Jenkins use?

How can I run reaction-next-starterkit of reactioncommerce in Windows?

I've been trying to install and run Reaction Commerce with Reaction Plataform using Windows.
I followed all the steps, however after the make command the reaction-next-starterkit doesn't run (I checked using docker ps), and even trying make start it also doesn't work.
I checked the logs with docker-compose logs -f, and the output doesn't show me many things:
': No such file or directory'sh
reaction-next-starterkit_web_1 exited with code 127
And I tried running with other method, like this:
docker-compose up -d - inside the reaction-next-starterkit folder, but also don't keep that running.
I checked all of the containers (including the not running) and I see all of them.
Accordingly to this issue there is a config of Git in Windows that change some files when you make a git clone of any repo, in that specific case it make some projects to break.
So, the solution was to change the specific configuration:
git config --global core.autocrlf input
Then make clean to delete everything made until now, delete the cloned repository, and start from scratch.

Windows is not recognizing serverless as internal or external command

I wanted to install serverless in my windows 7 machine.My npm version is 6.1.0.
I used the command
npm install -g serverless
C:\Users\ADMIN\AppData\Roaming\npm\serverless -> C:\Users\ADMIN\AppData\Roaming\npm\node_modules\serverless\bin\serverless
C:\Users\ADMIN\AppData\Roaming\npm\slss -> C:\Users\ADMIN\AppData\Roaming\npm\node_modules\serverless\bin\serverless
C:\Users\ADMIN\AppData\Roaming\npm\sls -> C:\Users\ADMIN\AppData\Roaming\npm\node_modules\serverless\bin\serverless
> spawn-sync#1.0.15 postinstall C:\Users\ADMIN\AppData\Roaming\npm\node_modules\serverless\node_modules\spawn-sync
> node postinstall
> serverless#1.30.1 postinstall C:\Users\ADMIN\AppData\Roaming\npm\node_modules\serverless
> node ./scripts/postinstall.js
+ serverless#1.30.1
added 351 packages from 269 contributors in 154.064s
But when I type serverless in command prompt, it tells me
'serverless' is not recognized as an internal or external command,
operable program or batch file.
I had the same issue and I believe you are missing the npm path from your environment variables.
Go to Windows search and type:
"Edit the system environment variables"
(at least this is how you can find the Environment Variables in Windows 10).
Go to Advanced tab and click on Environment Variables.
Select Path from the User Variables and click Edit.
Click New and provide the following:
C:\Users[USER_NAME]\AppData\Roaming\npm\
or whatever is the path that you have installed npm - just change the [USER_NAME] with your username account.
Else you could navigate to the path above and execute "serverless" from inside that path.
Hope that helps :)
Try make use of npx
Example:
npx sls deploy
I had the same issue. In my Windows 10 system, I wanted to install serverless under Git Bash.
I was able to install serverless with the normal account just fine, but then the serverless command was not found (even after closing Git Bash and launching it again). After doing the same steps using Administrator privileges, everything worked fine even using the normal user account. Perhaps this will help someone.
^^Adding both environment paths, to npm and serverless/bin, worked for me. Same issue. Windows 10, trying to start a Serverless project after it seemingly installed correctly.
Going to it from /npm also worked, but the adding both environment paths was the permanent solution by #Suday Ghosh
Go to System Window (Control Panel\System and Security\System);
Click "Advanced System Settings"
Click "Environment Variables"
Select "Path" variables and click "Edit" Button
Under "Edit environment variable" window, Click "New" Button
Provide the following paths separately:
C:\Users[USER_NAME]\AppData\Roaming\npm\
AND
C:\Users[USER_NAME]\AppData\Roaming\npm\node_modules\serverless\bin
Happy !!!!!!

Docker on Windows 10 Pro: error file conflict when building new Jekyll site

I am using PowerShell on Windows 10 Pro and have installed Docker version 18.03.1-ce.
I CD into a local directory where I want to edit a set of config files to build my Jekyll webpage. I ran the following command:
docker run -e JEKYLL_NEW=true -p 80:4000 -v ${pwd}:/site bretfisher/jekyll-serve
and the the following message:
NOTE: making new jekyll site!
Conflict: /site exists and is not empty.
Ensure /site is empty or else try again with `--force` to proceed and overwrite any files.
If I use the --force flag inside the call above it tells me unknown flag. Anyone has any idea how to fix this and successfully build a jekyll container linked to my local directory of files to be able to edit and preview on localhost in the browser before pushing it into production?
Pay close attention to the steps in the Jekyll quick start. In step 3, Jekyll creates the directory for your web site. The error message is telling you that there's already an existing site directory with files in it, so Jekyll quits rather than overwrite existing files. If you delete the contents of that directory or move them elsewhere, your jekyll new command can proceed.
You might try picking a different site name, by the way. Jekyll creates its own _site directory where it puts the built HTML files for your site. You're asking for confusion when you have a site/_site directory.

Resources