Skip to content

How to login

Mohamed Hassan edited this page Jan 1, 2025 · 3 revisions

To run any command, user can enter the options -t, --token with the appveyor token and the option -a,--account with appveyor account

appvey use a new user-level API key (v2) that allows working with any account user has access to.

Token can be generated from ci.appveyor.com after login to appveyor account.

Example 1

appvey project list -t 1yqFlMe3hmqe9aADccIsjXM12 -a myaccount

OR

appvey project list --token 1yqFlMe3hmqe9aADccIsjXM12 --account myaccount

Alternative methods to enter Appveyor token:

1- Auto login

If user prefer to auto login without entering token and account every time, create the next environment variables:

APPVEYOR_TOKEN: to store appveyor token 
APPVEYOR_ACCOUNT: to store appveyor account

Using this method, User need not to enter the token for any command. This help in auto login.

2- Store token in a file on disk. Use the option: --token @path/to/my_token.txt , if the token is stored in a file named my_token.txt

Example 2

appvey project list --token @path/to/my_token.tx --account myaccount

3- Create a response file that contains both account and token, eg my_account.rsp

Example 3

The contents of my_account.rsp:

--account  account1
--token  v2.ob3tc6eiymui45flie5q

To use the response file:

appvey project history --slug cloudbuilder @path/to/my_account.rsp

Example 4

Create response file proxy.rsp for token and proxy:

--account  account1
--token  v2.ob3tc6eiymui45flie5q
--proxy-address http://proxy.server:8888
--proxy-user  user1:password1

To use the response file:

appvey project history --slug cloudbuilder @path/to/proxy.rsp

Note:

Using response file to store account/token option is efficient especially if there are more account.

Create a response file per account eg, accoun1.rsp and account2.rsp

Any option can be commented by prefixing it with # and passing it in the terminal.


4- Use dash symbol - as a value for the token to enter the token from the keyboard or paste it.

The token is hidden and it is displayed as star *

Example 5

appvey --token - --account myaccount

The message "Enter token:" is displayed to enter token. you can use backspace to remove the last char(s).

Enter token:***************

  • use pipe input

if user can get the token from an application that store and retrieve secured passwords and dump the token in console, use dash - as a value.

Example 6

Secure store tokens in encrypted form. It retrieve token by its label and pipe the token to appvey by symbol | :

secure get -s secrets.json appveyor -p Pa$$w0rd | appvey project list  -t - 
  • If the token is stored in environment variable APPVEYOR_TOKEN , user need not to enter the token for any command. This help in auto login.

Note:

All examples are using the auto login method.

How to auto create the environment variables:

  • Run the command: config to create environment variables which enables user to auto login each time to run any command.
appvey config -t 1yqFlMe3hmqe9aADccIsjXM12 --account my_account

The environment variables are stored in the user profile.

How to manually creating the environment variables

  • In windows

edit the system environment variables->user profiles and create the variables.

Or, by running the command from cmd terminal:

setx APPVEYOR_TOKEN "my-token"
setx APPVEYOR_ACCOUNT "my-account"
  • In Linux

If you are using bash, ash, ksh or some other Bourne-style shell, you can add:

APPVEYOR_TOKEN="v2.1yqFlMe3hmqe9aADccIsjXM12"; export APPVEYOR_TOKEN
APPVEYOR_ACCOUNT="v2.1yqFlMe3hmqe9aADccIsjXM12"; export APPVEYOR_ACCOUNT

in your .profile file (${HOME}/.profile). This is the default situation on most Unix installations.

Clone this wiki locally